@@ -14,12 +14,8 @@ CREATE TEMPORARY TABLE `table:name` (a INT);
1414CREATE TEMPORARY TABLE shortn2 (a INT);
1515
1616##############################################################################
17- # BUG#46572 DROP TEMPORARY table IF EXISTS does not have a consistent behavior
18- # in ROW mode
19- #
20- # In RBR, 'DROP TEMPORARY TABLE ...' statement should never be binlogged no
21- # matter if the tables exist or not. In contrast, both in SBR and MBR, the
22- # statement should be always binlogged no matter if the tables exist or not.
17+ # MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written
18+ # to binlog only if the corresponding temporary table exists.
2319##############################################################################
2420CREATE TEMPORARY TABLE tmp(c1 int);
2521CREATE TEMPORARY TABLE tmp1(c1 int);
@@ -30,12 +26,12 @@ CREATE TABLE t(c1 int);
3026DROP TEMPORARY TABLE IF EXISTS tmp;
3127
3228--disable_warnings
33- # Before fixing BUG#46572, ' DROP TEMPORARY TABLE IF EXISTS...' statement was
34- # binlogged when the table did not exist in RBR .
29+ # Post MDEV-20091: Following DROP TEMPORARY TABLE statement should not be
30+ # logged as the table is already dropped above .
3531DROP TEMPORARY TABLE IF EXISTS tmp;
3632
37- # In RBR, ' DROP TEMPORARY TABLE ...' statement is never binlogged no matter if
38- # the tables exist or not .
33+ # Post MDEV-20091: Only DROP TEMPORARY TABLE statement should be written only
34+ # for 'tmp1' table .
3935DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
4036DROP TEMPORARY TABLE tmp3;
4137
@@ -79,6 +75,12 @@ DROP DATABASE `drop-temp+table-test`;
7975# if there are open temporary tables. As such the implicit drop
8076# for temporary tables on session closing must be logged.
8177#
78+ # MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written to
79+ # binlog only if the corresponding temporary table exists. In row based
80+ # replication temporary tables are not replicated hence their corresponding
81+ # DROP TEMPORARY TABLE statement will be not be written to binary log upon
82+ # session closure.
83+ #
8284
8385RESET MASTER;
8486
@@ -92,8 +94,10 @@ SELECT @@session.binlog_format;
9294--disconnect con1
9395
9496-- connection default
97+ if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
9598--let $wait_binlog_event= DROP
9699--source include/wait_for_binlog_event.inc
100+ }
97101-- source include/show_binlog_events.inc
98102RESET MASTER;
99103
0 commit comments