summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorPhilip Stoev <philip.stoev@galeracluster.com>2017-03-13 02:30:01 -0700
committerJan Lindström <jan.lindstrom@mariadb.com>2017-08-14 11:44:27 +0300
commite2ccbe1aeac1f866344b33d564f1983aaea3ea80 (patch)
tree0022f766f5d1a8f353fec6580999f14112ffc5b3 /mysql-test
parent795713405b0605caddf77f422a0414f1169487b9 (diff)
downloadmariadb-git-e2ccbe1aeac1f866344b33d564f1983aaea3ea80.tar.gz
Galera MTR Tests: Tests for MW-360 DROP TABLE containing temporary tables results in binlog divergence
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/galera/r/MW-360.result161
-rw-r--r--mysql-test/suite/galera/r/galera_ddl_multiline.result80
-rw-r--r--mysql-test/suite/galera/t/MW-360-master.opt2
-rw-r--r--mysql-test/suite/galera/t/MW-360.test103
-rw-r--r--mysql-test/suite/galera/t/galera_ddl_multiline.test54
5 files changed, 400 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/r/MW-360.result b/mysql-test/suite/galera/r/MW-360.result
new file mode 100644
index 00000000000..4195b8f07bc
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-360.result
@@ -0,0 +1,161 @@
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+DROP TABLE t1, t2;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+DROP TABLE t1, t2;
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+CREATE TEMPORARY TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+DROP TABLE t1;
+DROP TABLE t1;
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 120 Previous_gtids 1 151
+mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<local_uuid>:1'
+mysqld-bin.000001 199 Query 1 339 use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+mysqld-bin.000001 339 Gtid 1 387 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:1'
+mysqld-bin.000001 387 Query 1 503 use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 503 Gtid 1 551 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:2'
+mysqld-bin.000001 551 Query 1 628 BEGIN
+mysqld-bin.000001 628 Table_map 1 673 table_id: # (test.t2)
+mysqld-bin.000001 673 Write_rows 1 713 table_id: # flags: STMT_END_F
+mysqld-bin.000001 713 Xid 1 744 COMMIT /* xid=# */
+mysqld-bin.000001 744 Gtid 1 792 SET @@SESSION.GTID_NEXT= '<local_uuid>:2'
+mysqld-bin.000001 792 Query 1 927 use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+mysqld-bin.000001 927 Gtid 1 975 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:3'
+mysqld-bin.000001 975 Query 1 1090 use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001 1090 Gtid 1 1138 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:4'
+mysqld-bin.000001 1138 Query 1 1254 use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 1254 Gtid 1 1302 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:5'
+mysqld-bin.000001 1302 Query 1 1379 BEGIN
+mysqld-bin.000001 1379 Table_map 1 1424 table_id: # (test.t1)
+mysqld-bin.000001 1424 Write_rows 1 1464 table_id: # flags: STMT_END_F
+mysqld-bin.000001 1464 Xid 1 1495 COMMIT /* xid=# */
+mysqld-bin.000001 1495 Gtid 1 1543 SET @@SESSION.GTID_NEXT= '<local_uuid>:3'
+mysqld-bin.000001 1543 Query 1 1678 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
+mysqld-bin.000001 1678 Gtid 1 1726 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:6'
+mysqld-bin.000001 1726 Query 1 1841 use `test`; DROP TABLE `t1` /* generated by server */
+mysqld-bin.000001 1841 Gtid 1 1889 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:7'
+mysqld-bin.000001 1889 Query 1 2005 use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 2005 Gtid 1 2053 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:8'
+mysqld-bin.000001 2053 Query 1 2130 BEGIN
+mysqld-bin.000001 2130 Table_map 1 2175 table_id: # (test.t2)
+mysqld-bin.000001 2175 Write_rows 1 2215 table_id: # flags: STMT_END_F
+mysqld-bin.000001 2215 Xid 1 2246 COMMIT /* xid=# */
+mysqld-bin.000001 2246 Gtid 1 2294 SET @@SESSION.GTID_NEXT= '<local_uuid>:4'
+mysqld-bin.000001 2294 Query 1 2434 use `test`; DROP TEMPORARY TABLE IF EXISTS `t1`,`t3` /* generated by server */
+mysqld-bin.000001 2434 Gtid 1 2482 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:9'
+mysqld-bin.000001 2482 Query 1 2597 use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001 2597 Gtid 1 2645 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:10'
+mysqld-bin.000001 2645 Query 1 2761 use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 2761 Gtid 1 2809 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:11'
+mysqld-bin.000001 2809 Query 1 2886 BEGIN
+mysqld-bin.000001 2886 Table_map 1 2931 table_id: # (test.t1)
+mysqld-bin.000001 2931 Write_rows 1 2971 table_id: # flags: STMT_END_F
+mysqld-bin.000001 2971 Xid 1 3002 COMMIT /* xid=# */
+mysqld-bin.000001 3002 Gtid 1 3050 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:12'
+mysqld-bin.000001 3050 Query 1 3166 use `test`; CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 3166 Gtid 1 3214 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:13'
+mysqld-bin.000001 3214 Query 1 3291 BEGIN
+mysqld-bin.000001 3291 Table_map 1 3336 table_id: # (test.t3)
+mysqld-bin.000001 3336 Write_rows 1 3376 table_id: # flags: STMT_END_F
+mysqld-bin.000001 3376 Xid 1 3407 COMMIT /* xid=# */
+mysqld-bin.000001 3407 Gtid 1 3455 SET @@SESSION.GTID_NEXT= '<local_uuid>:5'
+mysqld-bin.000001 3455 Query 1 3590 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
+mysqld-bin.000001 3590 Gtid 1 3638 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:14'
+mysqld-bin.000001 3638 Query 1 3758 use `test`; DROP TABLE `t1`,`t3` /* generated by server */
+mysqld-bin.000001 3758 Gtid 1 3806 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:15'
+mysqld-bin.000001 3806 Query 1 3922 use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 3922 Gtid 1 3970 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:16'
+mysqld-bin.000001 3970 Query 1 4047 BEGIN
+mysqld-bin.000001 4047 Table_map 1 4092 table_id: # (test.t1)
+mysqld-bin.000001 4092 Write_rows 1 4132 table_id: # flags: STMT_END_F
+mysqld-bin.000001 4132 Xid 1 4163 COMMIT /* xid=# */
+mysqld-bin.000001 4163 Gtid 1 4211 SET @@SESSION.GTID_NEXT= '<local_uuid>:6'
+mysqld-bin.000001 4211 Query 1 4351 use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+mysqld-bin.000001 4351 Gtid 1 4399 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:17'
+mysqld-bin.000001 4399 Query 1 4514 use `test`; DROP TABLE `t1` /* generated by server */
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 120 Previous_gtids 2 151
+mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:1'
+mysqld-bin.000001 199 Query 1 315 use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 315 Gtid 1 363 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:2'
+mysqld-bin.000001 363 Query 1 431 BEGIN
+mysqld-bin.000001 431 Table_map 1 476 table_id: # (test.t2)
+mysqld-bin.000001 476 Write_rows 1 516 table_id: # flags: STMT_END_F
+mysqld-bin.000001 516 Xid 1 547 COMMIT /* xid=# */
+mysqld-bin.000001 547 Gtid 1 595 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:3'
+mysqld-bin.000001 595 Query 1 710 use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001 710 Gtid 1 758 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:4'
+mysqld-bin.000001 758 Query 1 874 use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 874 Gtid 1 922 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:5'
+mysqld-bin.000001 922 Query 1 990 BEGIN
+mysqld-bin.000001 990 Table_map 1 1035 table_id: # (test.t1)
+mysqld-bin.000001 1035 Write_rows 1 1075 table_id: # flags: STMT_END_F
+mysqld-bin.000001 1075 Xid 1 1106 COMMIT /* xid=# */
+mysqld-bin.000001 1106 Gtid 1 1154 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:6'
+mysqld-bin.000001 1154 Query 1 1269 use `test`; DROP TABLE `t1` /* generated by server */
+mysqld-bin.000001 1269 Gtid 1 1317 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:7'
+mysqld-bin.000001 1317 Query 1 1433 use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 1433 Gtid 1 1481 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:8'
+mysqld-bin.000001 1481 Query 1 1549 BEGIN
+mysqld-bin.000001 1549 Table_map 1 1594 table_id: # (test.t2)
+mysqld-bin.000001 1594 Write_rows 1 1634 table_id: # flags: STMT_END_F
+mysqld-bin.000001 1634 Xid 1 1665 COMMIT /* xid=# */
+mysqld-bin.000001 1665 Gtid 1 1713 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:9'
+mysqld-bin.000001 1713 Query 1 1828 use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001 1828 Gtid 1 1876 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:10'
+mysqld-bin.000001 1876 Query 1 1992 use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 1992 Gtid 1 2040 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:11'
+mysqld-bin.000001 2040 Query 1 2108 BEGIN
+mysqld-bin.000001 2108 Table_map 1 2153 table_id: # (test.t1)
+mysqld-bin.000001 2153 Write_rows 1 2193 table_id: # flags: STMT_END_F
+mysqld-bin.000001 2193 Xid 1 2224 COMMIT /* xid=# */
+mysqld-bin.000001 2224 Gtid 1 2272 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:12'
+mysqld-bin.000001 2272 Query 1 2388 use `test`; CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 2388 Gtid 1 2436 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:13'
+mysqld-bin.000001 2436 Query 1 2504 BEGIN
+mysqld-bin.000001 2504 Table_map 1 2549 table_id: # (test.t3)
+mysqld-bin.000001 2549 Write_rows 1 2589 table_id: # flags: STMT_END_F
+mysqld-bin.000001 2589 Xid 1 2620 COMMIT /* xid=# */
+mysqld-bin.000001 2620 Gtid 1 2668 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:14'
+mysqld-bin.000001 2668 Query 1 2788 use `test`; DROP TABLE `t1`,`t3` /* generated by server */
+mysqld-bin.000001 2788 Gtid 1 2836 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:15'
+mysqld-bin.000001 2836 Query 1 2952 use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 2952 Gtid 1 3000 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:16'
+mysqld-bin.000001 3000 Query 1 3068 BEGIN
+mysqld-bin.000001 3068 Table_map 1 3113 table_id: # (test.t1)
+mysqld-bin.000001 3113 Write_rows 1 3153 table_id: # flags: STMT_END_F
+mysqld-bin.000001 3153 Xid 1 3184 COMMIT /* xid=# */
+mysqld-bin.000001 3184 Gtid 1 3232 SET @@SESSION.GTID_NEXT= '<cluster_uuid>:17'
+mysqld-bin.000001 3232 Query 1 3347 use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/mysql-test/suite/galera/r/galera_ddl_multiline.result b/mysql-test/suite/galera/r/galera_ddl_multiline.result
new file mode 100644
index 00000000000..602f18326e8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ddl_multiline.result
@@ -0,0 +1,80 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB;;
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t5 (f1 INTEGER) ENGINE=InnoDB;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t6 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t2 VALUES (1);;
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1, t2, t3, t4, t5, t6;
diff --git a/mysql-test/suite/galera/t/MW-360-master.opt b/mysql-test/suite/galera/t/MW-360-master.opt
new file mode 100644
index 00000000000..6cfaed135e4
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-360-master.opt
@@ -0,0 +1,2 @@
+--gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency
+
diff --git a/mysql-test/suite/galera/t/MW-360.test b/mysql-test/suite/galera/t/MW-360.test
new file mode 100644
index 00000000000..7ea743cdb3d
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-360.test
@@ -0,0 +1,103 @@
+#
+# MW-360 DROP TABLE containing temporary tables results in binlog divergence
+#
+
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+
+--connection node_1
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+
+--connection node_2
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+
+--connection node_1
+
+#
+# Straightforward temporary table
+#
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+--let $local_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+
+#
+# A mix of normal and temporary tables
+#
+
+# Temp table first, normal table second
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+DROP TABLE t1, t2;
+
+# Normal table first, temporary table second
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+DROP TABLE t1, t2;
+
+# Temporary table first, normal table second, temp table third
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+CREATE TEMPORARY TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+
+DROP TABLE t1, t2, t3;
+
+# Normal table first, temporary table second, normal table third
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+
+DROP TABLE t1, t2, t3;
+
+#
+# A temporary table masking a normal one
+#
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+
+DROP TABLE t1;
+DROP TABLE t1;
+
+--connection node_2
+--let $cluster_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+
+--connection node_1
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+--replace_result $local_uuid <local_uuid> $cluster_uuid <cluster_uuid>
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+--connection node_2
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+--replace_result $local_uuid <local_uuid> $cluster_uuid <cluster_uuid>
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
diff --git a/mysql-test/suite/galera/t/galera_ddl_multiline.test b/mysql-test/suite/galera/t/galera_ddl_multiline.test
new file mode 100644
index 00000000000..c7155d066fa
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ddl_multiline.test
@@ -0,0 +1,54 @@
+#
+# Test that Galera works correctly with multiline statements, in particular involving DDLs
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection node_2
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection node_1
+--send CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+--reap
+
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+
+--connection node_2
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+
+--connection node_1
+INSERT INTO t1 VALUES (1); CREATE TABLE t5 (f1 INTEGER) ENGINE=InnoDB;
+
+SELECT COUNT(*) = 1 FROM t1;
+SHOW CREATE TABLE t5;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SHOW CREATE TABLE t5;
+
+--connection node_1
+--send CREATE TABLE t6 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t2 VALUES (1);
+--reap
+
+SELECT COUNT(*) = 1 FROM t2;
+SHOW CREATE TABLE t6;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t2;
+SHOW CREATE TABLE t6;
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1, t2, t3, t4, t5, t6;
+