mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.5' into '10.6'
This commit is contained in:
@@ -5474,4 +5474,31 @@ INSERT INTO t VALUES (1,POINT(0,0)),(2,POINT(0,0));
|
||||
SELECT NTH_VALUE(a,b) OVER () FROM t;
|
||||
ERROR HY000: Illegal parameter data types point and bigint for operation '-'
|
||||
DROP TABLE t;
|
||||
#
|
||||
# MDEV-32619 Settng SRID on geometry with ST_*FromWKKB(g, srid)
|
||||
#
|
||||
SELECT
|
||||
ST_SRID(g1),
|
||||
ST_SRID(ST_GeomFromWKB(g1, 4326)),
|
||||
ST_SRID(ST_GeomFromWKB(g1)),
|
||||
ST_AsText(g1),
|
||||
ST_SRID(ST_PointFromWKB(g2, 4326)),
|
||||
ST_SRID(g2),
|
||||
ST_SRID(ST_LineStringFromWKB(g3, 3)),
|
||||
ST_SRID(ST_PolygonFromWKB(g4, 4)),
|
||||
ST_SRID(ST_MultiPointFromWKB(g5, 5)),
|
||||
ST_SRID(ST_MultiLineStringFromWKB(g6, 6)),
|
||||
ST_SRID(ST_MultiPolygonFromWKB(g7, 7))
|
||||
FROM (
|
||||
SELECT
|
||||
POINT(1, 2) AS g1,
|
||||
POINT(4, 3) AS g2,
|
||||
LINESTRING(POINT(4, 3), POINT(4, 4)) AS g3,
|
||||
POLYGON(LINESTRING(POINT(4, 3), POINT(4, 4), POINT(3, 4), POINT(4, 3))) AS g4,
|
||||
MULTIPOINT(POINT(4, 3)) AS g5,
|
||||
MULTILINESTRING(LINESTRING(POINT(4, 3), POINT(4, 4))) AS g6,
|
||||
MULTIPOLYGON(POLYGON(LINESTRING(POINT(4, 3), POINT(4, 4), POINT(3, 4), POINT(4, 3)))) AS g7
|
||||
) AS t;
|
||||
ST_SRID(g1) ST_SRID(ST_GeomFromWKB(g1, 4326)) ST_SRID(ST_GeomFromWKB(g1)) ST_AsText(g1) ST_SRID(ST_PointFromWKB(g2, 4326)) ST_SRID(g2) ST_SRID(ST_LineStringFromWKB(g3, 3)) ST_SRID(ST_PolygonFromWKB(g4, 4)) ST_SRID(ST_MultiPointFromWKB(g5, 5)) ST_SRID(ST_MultiLineStringFromWKB(g6, 6)) ST_SRID(ST_MultiPolygonFromWKB(g7, 7))
|
||||
0 4326 0 POINT(1 2) 4326 0 3 4 5 6 7
|
||||
# End of 10.5 tests
|
||||
|
@@ -3482,4 +3482,30 @@ INSERT INTO t VALUES (1,POINT(0,0)),(2,POINT(0,0));
|
||||
SELECT NTH_VALUE(a,b) OVER () FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32619 Settng SRID on geometry with ST_*FromWKKB(g, srid)
|
||||
--echo #
|
||||
SELECT
|
||||
ST_SRID(g1),
|
||||
ST_SRID(ST_GeomFromWKB(g1, 4326)),
|
||||
ST_SRID(ST_GeomFromWKB(g1)),
|
||||
ST_AsText(g1),
|
||||
ST_SRID(ST_PointFromWKB(g2, 4326)),
|
||||
ST_SRID(g2),
|
||||
ST_SRID(ST_LineStringFromWKB(g3, 3)),
|
||||
ST_SRID(ST_PolygonFromWKB(g4, 4)),
|
||||
ST_SRID(ST_MultiPointFromWKB(g5, 5)),
|
||||
ST_SRID(ST_MultiLineStringFromWKB(g6, 6)),
|
||||
ST_SRID(ST_MultiPolygonFromWKB(g7, 7))
|
||||
FROM (
|
||||
SELECT
|
||||
POINT(1, 2) AS g1,
|
||||
POINT(4, 3) AS g2,
|
||||
LINESTRING(POINT(4, 3), POINT(4, 4)) AS g3,
|
||||
POLYGON(LINESTRING(POINT(4, 3), POINT(4, 4), POINT(3, 4), POINT(4, 3))) AS g4,
|
||||
MULTIPOINT(POINT(4, 3)) AS g5,
|
||||
MULTILINESTRING(LINESTRING(POINT(4, 3), POINT(4, 4))) AS g6,
|
||||
MULTIPOLYGON(POLYGON(LINESTRING(POINT(4, 3), POINT(4, 4), POINT(3, 4), POINT(4, 3)))) AS g7
|
||||
) AS t;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
31
mysql-test/suite/galera/r/MDEV-35748.result
Normal file
31
mysql-test/suite/galera/r/MDEV-35748.result
Normal file
@@ -0,0 +1,31 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
INSTALL PLUGIN IF NOT EXISTS connect SONAME 'ha_connect';
|
||||
CREATE TABLE t1 (f INT) ENGINE=CONNECT;
|
||||
Warnings:
|
||||
Warning 1105 No table_type. Will be set to DOS
|
||||
Warning 1105 No file name. Table will use t1.dos
|
||||
CREATE TABLE t2 (f INT) ENGINE=ROCKSDB;
|
||||
CREATE TABLE t3 (f INT) ENGINE=SEQUENCE;
|
||||
ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster'
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1235 This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster'
|
||||
Note 1235 ENGINE=SEQUENCE not supported by Galera
|
||||
connection node_2;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f` int(11) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`f` int(11) DEFAULT NULL
|
||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
show create table t3;
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
connection node_1;
|
||||
DROP TABLE t1, t2;
|
||||
UNINSTALL PLUGIN IF EXISTS connect;
|
167
mysql-test/suite/galera/r/galera_partitioned_tables.result
Normal file
167
mysql-test/suite/galera/r/galera_partitioned_tables.result
Normal file
@@ -0,0 +1,167 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
# wsrep-strict_ddl = OFF
|
||||
SET GLOBAL wsrep_strict_ddl = OFF;
|
||||
SELECT @@wsrep_strict_ddl;
|
||||
@@wsrep_strict_ddl
|
||||
0
|
||||
CREATE OR REPLACE TABLE t1 (v1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
CREATE OR REPLACE TABLE t2 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
ALTER TABLE t1 ADD COLUMN v2 int;
|
||||
ALTER TABLE t2 ADD COLUMN v2 int;
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
INSERT INTO t2 VALUES (1,1),(2,2);
|
||||
ALTER TABLE t1 ADD COLUMN v3 int, ENGINE=MyISAM;
|
||||
ALTER TABLE t2 ADD COLUMN v3 int, ENGINE=Aria;
|
||||
UPDATE t1 SET v3 = 3;
|
||||
UPDATE t2 SET v3 = 3;
|
||||
CREATE INDEX xx1 ON t1(v2);
|
||||
CREATE INDEX xx2 ON t2(v2);
|
||||
DROP INDEX xx1 ON t1;
|
||||
DROP INDEX xx2 ON t2;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
RENAME TABLE t1 TO t1_v2;
|
||||
RENAME TABLE t2 TO t2_v2;
|
||||
CREATE VIEW x1 AS SELECT * FROM t1_v2;
|
||||
CREATE VIEW x2 AS SELECT * FROM t2_v2;
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t1
|
||||
AFTER INSERT ON t1_v2 FOR EACH ROW
|
||||
UPDATE t1_v2 SET t1_v2.v3 = t1_v2.v3+1;
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t2
|
||||
AFTER INSERT ON t2_v2 FOR EACH ROW
|
||||
UPDATE t2_v2 SET t2_v2.v3 = t2_v2.v3+1;
|
||||
connection node_2;
|
||||
SHOW CREATE TABLE t1_v2;
|
||||
Table Create Table
|
||||
t1_v2 CREATE TABLE `t1_v2` (
|
||||
`v1` int(11) NOT NULL,
|
||||
`v2` int(11) DEFAULT NULL,
|
||||
`v3` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`v1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY KEY (`v1`)
|
||||
PARTITIONS 2
|
||||
SHOW CREATE TABLE t2_v2;
|
||||
Table Create Table
|
||||
t2_v2 CREATE TABLE `t2_v2` (
|
||||
`v1` int(11) NOT NULL,
|
||||
`v2` int(11) DEFAULT NULL,
|
||||
`v3` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`v1`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY KEY (`v1`)
|
||||
PARTITIONS 2
|
||||
SHOW CREATE VIEW x1;
|
||||
View Create View character_set_client collation_connection
|
||||
x1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `x1` AS select `t1_v2`.`v1` AS `v1`,`t1_v2`.`v2` AS `v2`,`t1_v2`.`v3` AS `v3` from `t1_v2` latin1 latin1_swedish_ci
|
||||
SHOW CREATE VIEW x2;
|
||||
View Create View character_set_client collation_connection
|
||||
x2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `x2` AS select `t2_v2`.`v1` AS `v1`,`t2_v2`.`v2` AS `v2`,`t2_v2`.`v3` AS `v3` from `t2_v2` latin1 latin1_swedish_ci
|
||||
SELECT * FROM t1_v2;
|
||||
v1 v2 v3
|
||||
SELECT * FROM t2_v2;
|
||||
v1 v2 v3
|
||||
connection node_1;
|
||||
DROP VIEW x1;
|
||||
DROP VIEW x2;
|
||||
DROP TRIGGER increment_before_t1;
|
||||
DROP TRIGGER increment_before_t2;
|
||||
DROP TABLE t1_v2;
|
||||
DROP TABLE t2_v2;
|
||||
SET GLOBAL wsrep_strict_ddl = OFF;
|
||||
CREATE OR REPLACE TABLE t2 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
# wsrep-strict_ddl = ON
|
||||
SET GLOBAL wsrep_strict_ddl = ON;
|
||||
SELECT @@wsrep_strict_ddl;
|
||||
@@wsrep_strict_ddl
|
||||
1
|
||||
CREATE OR REPLACE TABLE t1 (v1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
CREATE OR REPLACE TABLE t3 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
ALTER TABLE t1 ADD COLUMN v2 int;
|
||||
ALTER TABLE t2 ADD COLUMN v2 int;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
ALTER TABLE t1 ADD COLUMN v3 int, ENGINE=MyISAM;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
ALTER TABLE t2 ADD COLUMN v3 int, ENGINE=Aria;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
UPDATE t1 SET v2 = v2 + 3;
|
||||
UPDATE t2 SET v1 = v1 + 3;
|
||||
CREATE INDEX xx1 ON t1(v2);
|
||||
CREATE INDEX xx2 ON t2(v2);
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
DROP INDEX xx1 ON t1;
|
||||
DROP INDEX xx2 on t2;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
RENAME TABLE t1 TO t1_v2;
|
||||
RENAME TABLE t2 TO t2_v2;
|
||||
RENAME TABLE t2_v2 TO t2;
|
||||
CREATE VIEW x1 AS SELECT * FROM t1_v2;
|
||||
CREATE VIEW x2 AS SELECT * FROM t2;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t1
|
||||
AFTER INSERT ON t1_v2 FOR EACH ROW
|
||||
UPDATE t1_v2 SET t1_v2.v2 = t1_v2.v2+1;
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t2
|
||||
AFTER INSERT ON t2 FOR EACH ROW
|
||||
UPDATE t2 SET t2.v1 = t2.v1+1;
|
||||
ERROR HY000: DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
connection node_2;
|
||||
SHOW CREATE TABLE t1_v2;
|
||||
Table Create Table
|
||||
t1_v2 CREATE TABLE `t1_v2` (
|
||||
`v1` int(11) NOT NULL,
|
||||
`v2` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`v1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY KEY (`v1`)
|
||||
PARTITIONS 2
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`v1` int(11) NOT NULL,
|
||||
`v2` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`v1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY KEY (`v1`)
|
||||
PARTITIONS 2
|
||||
SHOW CREATE VIEW x1;
|
||||
View Create View character_set_client collation_connection
|
||||
x1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `x1` AS select `t1_v2`.`v1` AS `v1`,`t1_v2`.`v2` AS `v2` from `t1_v2` latin1 latin1_swedish_ci
|
||||
SELECT * FROM t1_v2;
|
||||
v1 v2
|
||||
SELECT * FROM t2;
|
||||
v1 v2
|
||||
connection node_1;
|
||||
DROP VIEW x1;
|
||||
DROP TRIGGER increment_before_t1;
|
||||
DROP TABLE t1_v2;
|
||||
DROP TABLE t2;
|
||||
SET GLOBAL wsrep_strict_ddl=OFF;
|
||||
CREATE OR REPLACE TABLE t2 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
# wsrep-strict_ddl = ON
|
||||
SET GLOBAL wsrep_strict_ddl = ON;
|
||||
SELECT @@wsrep_strict_ddl;
|
||||
@@wsrep_strict_ddl
|
||||
1
|
||||
ALTER TABLE t2 ENGINE=InnoDB;
|
||||
DROP TABLE t2;
|
||||
SET GLOBAL wsrep_strict_ddl = DEFAULT;
|
44
mysql-test/suite/galera/r/mdev-29775.result
Normal file
44
mysql-test/suite/galera/r/mdev-29775.result
Normal file
@@ -0,0 +1,44 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
CREATE TABLE t (f0 CHAR(0)) ENGINE=MyISAM;
|
||||
INSERT INTO t VALUES();
|
||||
SELECT * FROM t;
|
||||
f0
|
||||
NULL
|
||||
connection node_2;
|
||||
SELECT * FROM t;
|
||||
f0
|
||||
NULL
|
||||
DROP TABLE t;
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
SET GLOBAL wsrep_forced_binlog_format=ROW;
|
||||
CREATE TABLE t (f0 CHAR(0)) ENGINE=MyISAM;
|
||||
INSERT INTO t VALUES();
|
||||
SELECT * FROM t;
|
||||
f0
|
||||
NULL
|
||||
connection node_2;
|
||||
SELECT * FROM t;
|
||||
f0
|
||||
NULL
|
||||
DROP TABLE t;
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_forced_binlog_format=DEFAULT;
|
||||
SET GLOBAL wsrep_replicate_myisam=OFF;
|
||||
SET GLOBAL wsrep_forced_binlog_format=MIXED;
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
ERROR HY000: wsrep_replicate_myisam=ON can't be enabled if wsrep_forced_binlog != [NONE|ROW]
|
||||
SET GLOBAL wsrep_forced_binlog_format=STATEMENT;
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
ERROR HY000: wsrep_replicate_myisam=ON can't be enabled if wsrep_forced_binlog != [NONE|ROW]
|
||||
SET GLOBAL wsrep_forced_binlog_format=NONE;
|
||||
SET GLOBAL wsrep_replicate_myisam=OFF;
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
SET GLOBAL wsrep_forced_binlog_format=MIXED;
|
||||
ERROR HY000: wsrep_forced_binlog_format=[MIXED|STATEMENT] can't be set if wsrep_replicate_myisam=ON
|
||||
SET GLOBAL wsrep_forced_binlog_format=STATEMENT;
|
||||
ERROR HY000: wsrep_forced_binlog_format=[MIXED|STATEMENT] can't be set if wsrep_replicate_myisam=ON
|
||||
SET GLOBAL wsrep_forced_binlog_format=NONE;
|
||||
SET GLOBAL wsrep_replicate_myisam=OFF;
|
@@ -19,8 +19,8 @@ CREATE TABLE t1(a int) engine=Aria;
|
||||
ERROR HY000: Galera replication not supported
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 4165 Galera replication not supported
|
||||
Warning 1031 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine Aria not supported.
|
||||
Error 4165 DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
Warning 1031 WSREP: wsrep_strict_dll enabled. Storage engine Aria not supported.
|
||||
connection node_2;
|
||||
SHOW CREATE TABLE t1;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
@@ -30,8 +30,10 @@ ALTER TABLE t2 engine=MyISAM;
|
||||
ERROR HY000: Galera replication not supported
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 4165 Galera replication not supported
|
||||
Warning 1031 WSREP: wsrep_mode = STRICT_REPLICATION enabled. Storage engine MyISAM not supported.
|
||||
Error 4165 DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
Warning 1031 WSREP: wsrep_strict_dll enabled. Storage engine MyISAM not supported.
|
||||
Error 4165 DDL-statement is forbidden as table storage engine does not support Galera replication
|
||||
Warning 1031 WSREP: wsrep_strict_dll enabled. Storage engine MyISAM not supported.
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
|
1
mysql-test/suite/galera/t/MDEV-35748.opt
Normal file
1
mysql-test/suite/galera/t/MDEV-35748.opt
Normal file
@@ -0,0 +1 @@
|
||||
--plugin-load=$HA_ROCKSDB_SO
|
22
mysql-test/suite/galera/t/MDEV-35748.test
Normal file
22
mysql-test/suite/galera/t/MDEV-35748.test
Normal file
@@ -0,0 +1,22 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_rocksdb.inc
|
||||
|
||||
--connection node_1
|
||||
INSTALL PLUGIN IF NOT EXISTS connect SONAME 'ha_connect';
|
||||
|
||||
CREATE TABLE t1 (f INT) ENGINE=CONNECT;
|
||||
CREATE TABLE t2 (f INT) ENGINE=ROCKSDB;
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
CREATE TABLE t3 (f INT) ENGINE=SEQUENCE;
|
||||
show warnings;
|
||||
|
||||
--connection node_2
|
||||
show create table t1;
|
||||
show create table t2;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
show create table t3;
|
||||
|
||||
--connection node_1
|
||||
DROP TABLE t1, t2;
|
||||
UNINSTALL PLUGIN IF EXISTS connect;
|
131
mysql-test/suite/galera/t/galera_partitioned_tables.test
Normal file
131
mysql-test/suite/galera/t/galera_partitioned_tables.test
Normal file
@@ -0,0 +1,131 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_partition.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_aria.inc
|
||||
|
||||
--echo # wsrep-strict_ddl = OFF
|
||||
SET GLOBAL wsrep_strict_ddl = OFF;
|
||||
SELECT @@wsrep_strict_ddl;
|
||||
CREATE OR REPLACE TABLE t1 (v1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
CREATE OR REPLACE TABLE t2 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
ALTER TABLE t1 ADD COLUMN v2 int;
|
||||
ALTER TABLE t2 ADD COLUMN v2 int;
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
INSERT INTO t2 VALUES (1,1),(2,2);
|
||||
ALTER TABLE t1 ADD COLUMN v3 int, ENGINE=MyISAM;
|
||||
ALTER TABLE t2 ADD COLUMN v3 int, ENGINE=Aria;
|
||||
UPDATE t1 SET v3 = 3;
|
||||
UPDATE t2 SET v3 = 3;
|
||||
CREATE INDEX xx1 ON t1(v2);
|
||||
CREATE INDEX xx2 ON t2(v2);
|
||||
DROP INDEX xx1 ON t1;
|
||||
DROP INDEX xx2 ON t2;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
RENAME TABLE t1 TO t1_v2;
|
||||
RENAME TABLE t2 TO t2_v2;
|
||||
CREATE VIEW x1 AS SELECT * FROM t1_v2;
|
||||
CREATE VIEW x2 AS SELECT * FROM t2_v2;
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t1
|
||||
AFTER INSERT ON t1_v2 FOR EACH ROW
|
||||
UPDATE t1_v2 SET t1_v2.v3 = t1_v2.v3+1;
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t2
|
||||
AFTER INSERT ON t2_v2 FOR EACH ROW
|
||||
UPDATE t2_v2 SET t2_v2.v3 = t2_v2.v3+1;
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE TABLE t1_v2;
|
||||
SHOW CREATE TABLE t2_v2;
|
||||
SHOW CREATE VIEW x1;
|
||||
SHOW CREATE VIEW x2;
|
||||
|
||||
SELECT * FROM t1_v2;
|
||||
SELECT * FROM t2_v2;
|
||||
|
||||
--connection node_1
|
||||
DROP VIEW x1;
|
||||
DROP VIEW x2;
|
||||
DROP TRIGGER increment_before_t1;
|
||||
DROP TRIGGER increment_before_t2;
|
||||
DROP TABLE t1_v2;
|
||||
DROP TABLE t2_v2;
|
||||
|
||||
SET GLOBAL wsrep_strict_ddl = OFF;
|
||||
CREATE OR REPLACE TABLE t2 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
--echo # wsrep-strict_ddl = ON
|
||||
SET GLOBAL wsrep_strict_ddl = ON;
|
||||
SELECT @@wsrep_strict_ddl;
|
||||
CREATE OR REPLACE TABLE t1 (v1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
CREATE OR REPLACE TABLE t3 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
ALTER TABLE t1 ADD COLUMN v2 int;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
ALTER TABLE t2 ADD COLUMN v2 int;
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
ALTER TABLE t1 ADD COLUMN v3 int, ENGINE=MyISAM;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
ALTER TABLE t2 ADD COLUMN v3 int, ENGINE=Aria;
|
||||
UPDATE t1 SET v2 = v2 + 3;
|
||||
UPDATE t2 SET v1 = v1 + 3;
|
||||
CREATE INDEX xx1 ON t1(v2);
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
CREATE INDEX xx2 ON t2(v2);
|
||||
DROP INDEX xx1 ON t1;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
DROP INDEX xx2 on t2;
|
||||
TRUNCATE TABLE t1;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
TRUNCATE TABLE t2;
|
||||
# At the moment can't restrict rename
|
||||
RENAME TABLE t1 TO t1_v2;
|
||||
RENAME TABLE t2 TO t2_v2;
|
||||
RENAME TABLE t2_v2 TO t2;
|
||||
CREATE VIEW x1 AS SELECT * FROM t1_v2;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
CREATE VIEW x2 AS SELECT * FROM t2;
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t1
|
||||
AFTER INSERT ON t1_v2 FOR EACH ROW
|
||||
UPDATE t1_v2 SET t1_v2.v2 = t1_v2.v2+1;
|
||||
--error ER_GALERA_REPLICATION_NOT_SUPPORTED
|
||||
CREATE DEFINER=`root`@`localhost` TRIGGER increment_before_t2
|
||||
AFTER INSERT ON t2 FOR EACH ROW
|
||||
UPDATE t2 SET t2.v1 = t2.v1+1;
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE TABLE t1_v2;
|
||||
SHOW CREATE TABLE t2;
|
||||
SHOW CREATE VIEW x1;
|
||||
|
||||
SELECT * FROM t1_v2;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--connection node_1
|
||||
DROP VIEW x1;
|
||||
DROP TRIGGER increment_before_t1;
|
||||
DROP TABLE t1_v2;
|
||||
# We allow dropping table
|
||||
DROP TABLE t2;
|
||||
SET GLOBAL wsrep_strict_ddl=OFF;
|
||||
|
||||
CREATE OR REPLACE TABLE t2 (v1 INT NOT NULL PRIMARY KEY) ENGINE=MyISAM
|
||||
PARTITION BY KEY (v1)
|
||||
PARTITIONS 2;
|
||||
--echo # wsrep-strict_ddl = ON
|
||||
SET GLOBAL wsrep_strict_ddl = ON;
|
||||
SELECT @@wsrep_strict_ddl;
|
||||
ALTER TABLE t2 ENGINE=InnoDB;
|
||||
DROP TABLE t2;
|
||||
|
||||
SET GLOBAL wsrep_strict_ddl = DEFAULT;
|
@@ -3,7 +3,6 @@
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
45
mysql-test/suite/galera/t/mdev-29775.test
Normal file
45
mysql-test/suite/galera/t/mdev-29775.test
Normal file
@@ -0,0 +1,45 @@
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
#
|
||||
# MDEV-29775 : Assertion `0' failed in void Protocol::end_statement() when adding data to the MyISAM table after setting wsrep_mode=replicate_myisam
|
||||
#
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
CREATE TABLE t (f0 CHAR(0)) ENGINE=MyISAM;
|
||||
INSERT INTO t VALUES();
|
||||
SELECT * FROM t;
|
||||
--connection node_2
|
||||
SELECT * FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
SET GLOBAL wsrep_forced_binlog_format=ROW;
|
||||
CREATE TABLE t (f0 CHAR(0)) ENGINE=MyISAM;
|
||||
INSERT INTO t VALUES();
|
||||
SELECT * FROM t;
|
||||
--connection node_2
|
||||
SELECT * FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_forced_binlog_format=DEFAULT;
|
||||
SET GLOBAL wsrep_replicate_myisam=OFF;
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format=MIXED;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
SET GLOBAL wsrep_forced_binlog_format=STATEMENT;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format=NONE;
|
||||
SET GLOBAL wsrep_replicate_myisam=OFF;
|
||||
|
||||
SET GLOBAL wsrep_replicate_myisam=ON;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
SET GLOBAL wsrep_forced_binlog_format=MIXED;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
SET GLOBAL wsrep_forced_binlog_format=STATEMENT;
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format=NONE;
|
||||
SET GLOBAL wsrep_replicate_myisam=OFF;
|
7
mysql-test/suite/wsrep/t/wsrep_forced_binlog_format.cnf
Normal file
7
mysql-test/suite/wsrep/t/wsrep_forced_binlog_format.cnf
Normal file
@@ -0,0 +1,7 @@
|
||||
!include ../my.cnf
|
||||
|
||||
[mysqld.1]
|
||||
wsrep-on=ON
|
||||
wsrep-cluster-address=gcomm://
|
||||
wsrep-provider=@ENV.WSREP_PROVIDER
|
||||
binlog-format=ROW
|
@@ -1,4 +1,7 @@
|
||||
--source include/have_wsrep.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_wsrep_provider.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # wsrep_forced_binlog_format
|
@@ -91,6 +91,15 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
|
||||
{
|
||||
String *str_ret= args[0]->val_str(str);
|
||||
null_value= args[0]->null_value;
|
||||
if (!null_value && arg_count == 2 && !args[1]->null_value) {
|
||||
srid= (uint32)args[1]->val_int();
|
||||
|
||||
if (str->copy(*str_ret))
|
||||
return 0;
|
||||
|
||||
int4store(str->ptr(), srid);
|
||||
return str;
|
||||
}
|
||||
return str_ret;
|
||||
}
|
||||
|
||||
|
@@ -141,6 +141,7 @@ public:
|
||||
handlerton **ha,
|
||||
bool tmp_table);
|
||||
bool is_set() { return m_storage_engine_name.str != NULL; }
|
||||
const LEX_CSTRING *name() const { return &m_storage_engine_name; }
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1445,12 +1445,19 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
|
||||
else
|
||||
{
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd) && hton && !wsrep_should_replicate_ddl(thd, hton))
|
||||
if (WSREP(thd) && hton)
|
||||
{
|
||||
handlerton *ht= hton;
|
||||
// For partitioned tables resolve underlying handlerton
|
||||
if (table->table && table->table->file->partition_ht())
|
||||
ht= table->table->file->partition_ht();
|
||||
if (!wsrep_should_replicate_ddl(thd, ht))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
if (thd->locked_tables_mode == LTM_LOCK_TABLES ||
|
||||
thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES)
|
||||
@@ -4800,11 +4807,28 @@ bool wsrep_check_sequence(THD* thd,
|
||||
|
||||
// In Galera cluster we support only InnoDB sequences
|
||||
if (db_type != DB_TYPE_INNODB)
|
||||
{
|
||||
// Currently any dynamic storage engine is not possible to identify
|
||||
// using DB_TYPE_XXXX and ENGINE=SEQUENCE is one of them.
|
||||
// Therefore, we get storage engine name from lex.
|
||||
const LEX_CSTRING *tb_name= thd->lex->m_sql_cmd->option_storage_engine_name()->name();
|
||||
// (1) CREATE TABLE ... ENGINE=SEQUENCE OR
|
||||
// (2) ALTER TABLE ... ENGINE= OR
|
||||
// Note in ALTER TABLE table->s->sequence != nullptr
|
||||
// (3) CREATE SEQUENCE ... ENGINE=
|
||||
if ((thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
|
||||
lex_string_eq(tb_name, STRING_WITH_LEN("SEQUENCE"))) ||
|
||||
(thd->lex->sql_command == SQLCOM_ALTER_TABLE) ||
|
||||
(thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE))
|
||||
{
|
||||
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
|
||||
"non-InnoDB sequences in Galera cluster");
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
|
||||
ER_NOT_SUPPORTED_YET,
|
||||
"ENGINE=%s not supported by Galera", tb_name->str);
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
|
||||
// In Galera cluster it is best to use INCREMENT BY 0 with CACHE
|
||||
// or NOCACHE
|
||||
@@ -10014,10 +10038,21 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
|
||||
if (WSREP(thd) && table &&
|
||||
(thd->lex->sql_command == SQLCOM_ALTER_TABLE ||
|
||||
thd->lex->sql_command == SQLCOM_CREATE_INDEX ||
|
||||
thd->lex->sql_command == SQLCOM_DROP_INDEX) &&
|
||||
!wsrep_should_replicate_ddl(thd, table->s->db_type()))
|
||||
thd->lex->sql_command == SQLCOM_DROP_INDEX))
|
||||
{
|
||||
handlerton *ht= table->s->db_type();
|
||||
|
||||
// If alter used ENGINE= we use that
|
||||
if (create_info->used_fields & HA_CREATE_USED_ENGINE)
|
||||
ht= create_info->db_type;
|
||||
// For partitioned tables resolve underlying handlerton
|
||||
else if (table->file->partition_ht())
|
||||
ht= table->file->partition_ht();
|
||||
|
||||
if (!wsrep_should_replicate_ddl(thd, ht))
|
||||
DBUG_RETURN(true);
|
||||
#endif /* WITH_WSREP */
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG_SYNC(thd, "alter_table_after_open_tables");
|
||||
|
||||
|
@@ -622,7 +622,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
|
||||
table= tables->table;
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd) && !wsrep_should_replicate_ddl(thd, table->s->db_type()))
|
||||
/* Resolve should we replicate creation of the trigger.
|
||||
It should be replicated if storage engine(s) associated
|
||||
to trigger are replicated by Galera.
|
||||
*/
|
||||
if (WSREP(thd) &&
|
||||
!wsrep_should_replicate_ddl_iterate(thd, tables))
|
||||
goto end;
|
||||
#endif
|
||||
|
||||
|
@@ -336,8 +336,15 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref,
|
||||
versioned= table->versioned();
|
||||
hton= table->file->ht;
|
||||
#ifdef WITH_WSREP
|
||||
/* Resolve should we replicate truncate. It should
|
||||
be replicated if storage engine(s) associated
|
||||
are replicated by Galera. If this is partitioned
|
||||
table we need to find out default partition
|
||||
handlerton.
|
||||
*/
|
||||
if (WSREP(thd) &&
|
||||
!wsrep_should_replicate_ddl(thd, hton))
|
||||
!wsrep_should_replicate_ddl(thd, table->file->partition_ht() ?
|
||||
table->file->partition_ht() : hton))
|
||||
DBUG_RETURN(TRUE);
|
||||
#endif
|
||||
|
||||
@@ -359,13 +366,23 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref,
|
||||
sequence= share->table_type == TABLE_TYPE_SEQUENCE;
|
||||
hton= share->db_type();
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd) &&
|
||||
hton != view_pseudo_hton &&
|
||||
!wsrep_should_replicate_ddl(thd, hton))
|
||||
if (WSREP(thd) && hton != view_pseudo_hton)
|
||||
{
|
||||
/* Resolve should we replicate truncate. It should
|
||||
be replicated if storage engine(s) associated
|
||||
are replicated by Galera. If this is partitioned
|
||||
table we need to find out default partition
|
||||
handlerton.
|
||||
*/
|
||||
const handlerton *ht= share->default_part_plugin ?
|
||||
plugin_hton(share->default_part_plugin) : hton;
|
||||
|
||||
if (ht && !wsrep_should_replicate_ddl(thd, ht))
|
||||
{
|
||||
tdc_release_share(share);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!versioned)
|
||||
|
@@ -452,8 +452,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
||||
lex->link_first_table_back(view, link_to_local);
|
||||
view->open_type= OT_BASE_ONLY;
|
||||
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
|
||||
|
||||
/*
|
||||
ignore lock specs for CREATE statement
|
||||
*/
|
||||
@@ -471,13 +469,20 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
||||
}
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if(!wsrep_should_replicate_ddl_iterate(thd, static_cast<const TABLE_LIST *>(tables)))
|
||||
/* Resolve should we replicate creation of the view.
|
||||
It should be replicated if storage engine(s) associated
|
||||
to view are replicated by Galera.
|
||||
*/
|
||||
if (WSREP(thd) &&
|
||||
!wsrep_should_replicate_ddl_iterate(thd, tables))
|
||||
{
|
||||
res= TRUE;
|
||||
goto err_no_relink;
|
||||
}
|
||||
#endif
|
||||
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
|
||||
|
||||
view= lex->unlink_first_table(&link_to_local);
|
||||
|
||||
if (check_db_dir_existence(view->db.str))
|
||||
|
@@ -6146,7 +6146,9 @@ static const char *wsrep_binlog_format_names[]=
|
||||
static Sys_var_enum Sys_wsrep_forced_binlog_format(
|
||||
"wsrep_forced_binlog_format", "binlog format to take effect over user's choice",
|
||||
GLOBAL_VAR(wsrep_forced_binlog_format), CMD_LINE(REQUIRED_ARG),
|
||||
wsrep_binlog_format_names, DEFAULT(BINLOG_FORMAT_UNSPEC));
|
||||
wsrep_binlog_format_names, DEFAULT(BINLOG_FORMAT_UNSPEC),
|
||||
NO_MUTEX_GUARD, NOT_IN_BINLOG,
|
||||
ON_CHECK(wsrep_forced_binlog_format_check));
|
||||
|
||||
static Sys_var_mybool Sys_wsrep_recover_datadir(
|
||||
"wsrep_recover", "Recover database state after crash and exit",
|
||||
@@ -6156,7 +6158,8 @@ static Sys_var_mybool Sys_wsrep_recover_datadir(
|
||||
static Sys_var_mybool Sys_wsrep_replicate_myisam(
|
||||
"wsrep_replicate_myisam", "To enable myisam replication",
|
||||
GLOBAL_VAR(wsrep_replicate_myisam), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
|
||||
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
|
||||
NO_MUTEX_GUARD, NOT_IN_BINLOG,
|
||||
ON_CHECK(wsrep_replicate_myisam_check),
|
||||
ON_UPDATE(wsrep_replicate_myisam_update),
|
||||
DEPRECATED("'@@wsrep_mode=REPLICATE_MYISAM'")); // since 10.6.0
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2008, 2023 Codership Oy <http://www.codership.com>
|
||||
Copyright (c) 2020, 2022, MariaDB
|
||||
/* Copyright (c) 2008, 2024, Codership Oy <http://www.codership.com>
|
||||
Copyright (c) 2020, 2024, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -2440,19 +2440,12 @@ static int wsrep_drop_table_query(THD* thd, uchar** buf, size_t* buf_len)
|
||||
/* Forward declarations. */
|
||||
int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len);
|
||||
|
||||
bool wsrep_should_replicate_ddl_iterate(THD* thd, const TABLE_LIST* table_list)
|
||||
{
|
||||
if (WSREP(thd))
|
||||
{
|
||||
for (const TABLE_LIST* it= table_list; it; it= it->next_global)
|
||||
{
|
||||
if (it->table &&
|
||||
!wsrep_should_replicate_ddl(thd, it->table->s->db_type()))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/*! Should DDL be replicated by Galera
|
||||
*
|
||||
* @param thd thread handle
|
||||
* @param hton real storage engine handlerton
|
||||
*
|
||||
* @retval true if we should replicate DDL, false if not */
|
||||
|
||||
bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton)
|
||||
{
|
||||
@@ -2462,6 +2455,8 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton)
|
||||
if (!hton)
|
||||
return true;
|
||||
|
||||
DBUG_ASSERT(hton != nullptr);
|
||||
|
||||
switch (hton->db_type)
|
||||
{
|
||||
case DB_TYPE_INNODB:
|
||||
@@ -2473,6 +2468,11 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton)
|
||||
else
|
||||
WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd));
|
||||
break;
|
||||
case DB_TYPE_PARTITION_DB:
|
||||
/* In most cases this means we could not find out
|
||||
table->file->partition_ht() */
|
||||
return true;
|
||||
break;
|
||||
case DB_TYPE_ARIA:
|
||||
if (wsrep_check_mode(WSREP_MODE_REPLICATE_ARIA))
|
||||
return true;
|
||||
@@ -2493,6 +2493,27 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton)
|
||||
ha_resolve_storage_engine_name(hton));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wsrep_should_replicate_ddl_iterate(THD* thd, const TABLE_LIST* table_list)
|
||||
{
|
||||
for (const TABLE_LIST* it= table_list; it; it= it->next_global)
|
||||
{
|
||||
if (it->table)
|
||||
{
|
||||
/* If this is partitioned table we need to find out
|
||||
implementing storage engine handlerton.
|
||||
*/
|
||||
const handlerton *ht= it->table->file->partition_ht() ?
|
||||
it->table->file->partition_ht() :
|
||||
it->table->s->db_type();
|
||||
|
||||
if (!wsrep_should_replicate_ddl(thd, ht))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Decide if statement should run in TOI.
|
||||
|
||||
@@ -2601,7 +2622,6 @@ bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table,
|
||||
if (create_info)
|
||||
{
|
||||
const handlerton *hton= create_info->db_type;
|
||||
|
||||
if (!hton)
|
||||
hton= ha_default_handlerton(thd);
|
||||
if (!wsrep_should_replicate_ddl(thd, hton))
|
||||
|
@@ -355,7 +355,7 @@ int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_,
|
||||
const wsrep::key_array *fk_tables= nullptr,
|
||||
const HA_CREATE_INFO* create_info= nullptr);
|
||||
|
||||
bool wsrep_should_replicate_ddl(THD* thd, const handlerton *db_type);
|
||||
bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton);
|
||||
bool wsrep_should_replicate_ddl_iterate(THD* thd, const TABLE_LIST* table_list);
|
||||
|
||||
void wsrep_to_isolation_end(THD *thd);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2008-2022 Codership Oy <http://www.codership.com>
|
||||
/* Copyright 2008-2023 Codership Oy <http://www.codership.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -353,14 +353,12 @@ bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var)
|
||||
var->save_result.string_value.length);
|
||||
start_pos_buf[var->save_result.string_value.length]= 0;
|
||||
|
||||
|
||||
WSREP_DEBUG("SST wsrep_start_position check for new position %s old %s",
|
||||
start_pos_buf, wsrep_start_position);
|
||||
|
||||
// Verify the format.
|
||||
if (wsrep_start_position_verify(start_pos_buf)) return true;
|
||||
|
||||
|
||||
// Give error if position is updated when wsrep is not enabled or
|
||||
// provider is not loaded.
|
||||
if ((!WSREP_ON || !Wsrep_server_state::instance().is_provider_loaded())
|
||||
@@ -1150,3 +1148,35 @@ bool wsrep_replicate_myisam_update(sys_var *self, THD* thd, enum_var_type var_ty
|
||||
wsrep_mode&= (~WSREP_MODE_REPLICATE_MYISAM);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wsrep_replicate_myisam_check(sys_var *self, THD* thd, set_var* var)
|
||||
{
|
||||
bool new_replicate_myisam= (bool)var->save_result.ulonglong_value;
|
||||
|
||||
if (new_replicate_myisam &&
|
||||
!(wsrep_forced_binlog_format == BINLOG_FORMAT_UNSPEC ||
|
||||
wsrep_forced_binlog_format == BINLOG_FORMAT_ROW))
|
||||
{
|
||||
my_message(ER_WRONG_ARGUMENTS, "wsrep_replicate_myisam=ON can't be enabled "
|
||||
"if wsrep_forced_binlog != [NONE|ROW]", MYF(0));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wsrep_forced_binlog_format_check(sys_var *self, THD* thd, set_var* var)
|
||||
{
|
||||
ulonglong new_forced_binlog_format= var->save_result.ulonglong_value;
|
||||
if (!(new_forced_binlog_format == BINLOG_FORMAT_UNSPEC ||
|
||||
new_forced_binlog_format == BINLOG_FORMAT_ROW))
|
||||
{
|
||||
if (wsrep_replicate_myisam)
|
||||
{
|
||||
my_message(ER_WRONG_ARGUMENTS, "wsrep_forced_binlog_format=[MIXED|STATEMENT] can't be set "
|
||||
"if wsrep_replicate_myisam=ON", MYF(0));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2013 Codership Oy <info@codership.com>
|
||||
/* Copyright (C) 2013-2023 Codership Oy <info@codership.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -112,6 +112,8 @@ extern bool wsrep_gtid_domain_id_update UPDATE_ARGS;
|
||||
extern bool wsrep_mode_check CHECK_ARGS;
|
||||
extern bool wsrep_strict_ddl_update UPDATE_ARGS;
|
||||
extern bool wsrep_replicate_myisam_update UPDATE_ARGS;
|
||||
extern bool wsrep_replicate_myisam_check CHECK_ARGS;
|
||||
extern bool wsrep_forced_binlog_format_check CHECK_ARGS;
|
||||
#else /* WITH_WSREP */
|
||||
|
||||
#define wsrep_provider_init(X)
|
||||
|
Reference in New Issue
Block a user