mariadb/mysql-test/suite/galera/t/MDEV-22051.test
sjaakola 49791cbc6f 10.4-MDEV-27275 CREATE TABLE with FK not safe for PA
This commit contains a fix, where the replication write set for a CREATE TABLE
will contain, as certification keys, table names for all FK references.
With this, all DML for the FK parent tables will conflict with the CREATE TABLE
statement.

There is also new test galera.MDEV-27276 to verify the fix.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2021-12-20 13:34:54 +02:00

34 lines
763 B
Text

#
# If FTWRL is issued on node, DDL statement should report error back to
# user.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
FLUSH TABLES WITH READ LOCK;
--error ER_UNKNOWN_COM_ERROR
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SET wsrep_OSU_method=RSU;
--error ER_UNKNOWN_COM_ERROR
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SET wsrep_OSU_method=TOI;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--error ER_UNKNOWN_COM_ERROR
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
--connection node_1
UNLOCK TABLES;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
FLUSH TABLES WITH READ LOCK;
--error ER_CANT_UPDATE_WITH_READLOCK
INSERT INTO t1 VALUES (1);
UNLOCK TABLES;
DROP TABLE t1;
CALL mtr.add_suppression("CREATE TABLE isolation failure");