Debian Codegraph @

mysql-test/suite/rpl/t/rpl_row_drop_temp_table.test

raw
1 # ==== Purpose ====
2 #
3 # Test verifies that plain DROP TEMPORARY TABLE IF EXISTS statements are not
4 # replicated during row based replication.
5 #
6 # ==== Implementation ====
7 #
8 # Steps:
9 # 0 - Have a read_only master and slave. Binlog format should be "ROW".
10 # 1 - Create a procedure which executes DROP TEMPORARY TABLE IF EXISTS
11 # statements prior to CREATE TEMPORARY TABLE.
12 # 2 - Execute the procedure.
13 # 3 - Verify that the DROP TEMPORARY TABLE IF EXISTS statements within the
14 # procedure are not written to the binary log.
15 #
16 # ==== References ====
17 #
18 # MDEV-20091: DROP TEMPORARY table is logged despite no CREATE was logged
19 #
20
21 --source include/have_binlog_format_row.inc
22 --source include/have_innodb.inc
23 --source include/master-slave.inc
24
25 connection slave;
26 SET GLOBAL read_only=1;
27
28 connection master;
29 DELIMITER |;
30 CREATE PROCEDURE testproc()
31 BEGIN
32 DROP TEMPORARY TABLE IF EXISTS t1_tmp;
33 DROP TEMPORARY TABLE IF EXISTS t2_tmp;
34 CREATE TEMPORARY TABLE IF NOT EXISTS t1_tmp ( t1 varchar(400) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;
35 CREATE TEMPORARY TABLE IF NOT EXISTS t2_tmp ( t2 varchar(16) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
36 END|
37 DELIMITER ;|
38 SET GLOBAL read_only=1;
39 CALL testproc();
40 --echo ******** None of the above DROP TEMPORARY TABLE statement should be found in binary log ********
41 --source include/show_binlog_events.inc
42 --sync_slave_with_master
43 SELECT @@read_only;
44
45 --echo ======== CLEAN UP =========
46 connection master;
47 DROP TEMPORARY TABLE t1_tmp;
48 DROP TEMPORARY TABLE t2_tmp;
49 DROP PROCEDURE testproc;
50 SET GLOBAL read_only=0;
51 --sync_slave_with_master
52 SET GLOBAL read_only=0;
53
54 --source include/rpl_end.inc