Skip to content

Commit fdef9f9

Browse files
committed
Merge 10.2 into 10.3
2 parents 55d8ff0 + a7e9395 commit fdef9f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+528
-924
lines changed

mysql-test/include/binlog_parallel_replication_marks.test

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,16 @@ connection default;
4949

5050
# We need to wait for the implicit DROP TEMPORARY TABLE to be logged after
5151
# tmp_con disconnect, otherwise we get sporadic test failures.
52+
# MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written to
53+
# binlog only if the corresponding temporary table exists. In row based
54+
# replication temporary tables are not replicated hence their corresponding
55+
# DROP TEMPORARY TABLE statement will be not be written to binary log upon
56+
# session closure.
57+
58+
if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
5259
--let $wait_condition= SELECT variable_value > $before_drop_pos FROM information_schema.global_status WHERE variable_name = 'binlog_snapshot_position'
5360
--source include/wait_condition.inc
54-
61+
}
5562
--let $binlog_pos2=query_get_value(SHOW MASTER STATUS, Position, 1)
5663

5764
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)

mysql-test/suite/binlog/include/drop_temp_table.test

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ CREATE TEMPORARY TABLE `table:name` (a INT);
1414
CREATE 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
##############################################################################
2420
CREATE TEMPORARY TABLE tmp(c1 int);
2521
CREATE TEMPORARY TABLE tmp1(c1 int);
@@ -30,12 +26,12 @@ CREATE TABLE t(c1 int);
3026
DROP 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.
3531
DROP 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.
3935
DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
4036
DROP 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

8385
RESET 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
98102
RESET MASTER;
99103

mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,4 @@ BEGIN
105105
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
106106
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
107107
COMMIT/*!*/;
108-
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
109-
DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t5`
110108
DROP TABLE t1;

mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,9 @@ master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test`
3535
master-bin.000001 # Gtid # # GTID #-#-#
3636
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
3737
master-bin.000001 # Gtid # # GTID #-#-#
38-
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
39-
master-bin.000001 # Gtid # # GTID #-#-#
40-
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
41-
master-bin.000001 # Gtid # # GTID #-#-#
4238
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
4339
master-bin.000001 # Gtid # # GTID #-#-#
4440
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */
45-
master-bin.000001 # Gtid # # GTID #-#-#
46-
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
4741
DROP DATABASE `drop-temp+table-test`;
4842
RESET MASTER;
4943
CREATE TABLE t1 ( i text );
@@ -65,7 +59,5 @@ master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES ('1')
6559
master-bin.000001 # Table_map # # table_id: # (test.t1)
6660
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
6761
master-bin.000001 # Query # # COMMIT
68-
master-bin.000001 # Gtid # # GTID #-#-#
69-
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
7062
RESET MASTER;
7163
DROP TABLE t1;

mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,6 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
348348
master-bin.000001 # Query # # COMMIT
349349
master-bin.000001 # Gtid # # GTID #-#-#
350350
master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb
351-
master-bin.000001 # Gtid # # GTID #-#-#
352-
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti`
353351
do release_lock("lock1");
354352
drop table t0,t2;
355353
set autocommit=0;

mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,8 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
5151
master-bin.000001 # Gtid # # GTID #-#-#
5252
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
5353
master-bin.000001 # Gtid # # GTID #-#-#
54-
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
55-
master-bin.000001 # Gtid # # GTID #-#-#
5654
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1` /* generated by server */
5755
master-bin.000001 # Gtid # # GTID #-#-#
58-
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
59-
master-bin.000001 # Gtid # # GTID #-#-#
6056
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE `tmp3` /* generated by server */
6157
master-bin.000001 # Gtid # # GTID #-#-#
6258
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */

mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
# is any
3333
# Drop-Temp-TT-Temp - Drops two temporary T-tables if there is any
3434
# Drop-Temp-NN-Temp - Drops two temporary N-tables if there is any
35+
#
36+
# Note: MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written
37+
# to binlog only if the corresponding temporary table exists.
38+
#
3539
# Drop-Temp-Xe-Temp - Tries to drop a temporary table that does not exist
3640
# Drop-Temp-NXe-Temp - Drops a temporary N-table if there is any and
3741
# a temporary table that does not exist

mysql-test/suite/rpl/r/create_or_replace_mix.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ set binlog_format="STATEMENT";
265265
ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
266266
drop temporary table t8;
267267
set @@binlog_format=@org_binlog_format;
268+
set @@session.binlog_format=default;
269+
drop temporary table if exists t9;
270+
Warnings:
271+
Note 1051 Unknown table 'test.t9'
272+
connect con1,localhost,root,,;
273+
set session binlog_format=default;
274+
create temporary table t9 (i int);
275+
*** Must be no DROP logged for t9 when there was no CREATE, at disconnect too ***
276+
disconnect con1;
277+
connection server_1;
268278
include/show_binlog_events.inc
269279
Log_name Pos Event_type Server_id End_log_pos Info
270280
master-bin.000001 # Gtid # # GTID #-#-#
@@ -275,5 +285,9 @@ master-bin.000001 # Gtid # # GTID #-#-#
275285
master-bin.000001 # Query # # use `test`; create temporary table t7 (a int)
276286
master-bin.000001 # Gtid # # GTID #-#-#
277287
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t7` /* generated by server */
288+
master-bin.000001 # Gtid # # GTID #-#-#
289+
master-bin.000001 # Query # # use `test`; create temporary table t9 (i int)
290+
master-bin.000001 # Gtid # # GTID #-#-#
291+
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t9`
278292
drop table t2;
279293
include/rpl_end.inc

mysql-test/suite/rpl/r/create_or_replace_row.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,16 @@ set binlog_format="STATEMENT";
293293
ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
294294
drop temporary table t8;
295295
set @@binlog_format=@org_binlog_format;
296+
set @@session.binlog_format=default;
297+
drop temporary table if exists t9;
298+
Warnings:
299+
Note 1051 Unknown table 'test.t9'
300+
connect con1,localhost,root,,;
301+
set session binlog_format=default;
302+
create temporary table t9 (i int);
303+
*** Must be no DROP logged for t9 when there was no CREATE, at disconnect too ***
304+
disconnect con1;
305+
connection server_1;
296306
include/show_binlog_events.inc
297307
Log_name Pos Event_type Server_id End_log_pos Info
298308
master-bin.000001 # Gtid # # GTID #-#-#

mysql-test/suite/rpl/r/create_or_replace_statement.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,16 @@ set binlog_format="STATEMENT";
252252
ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
253253
drop temporary table t8;
254254
set @@binlog_format=@org_binlog_format;
255+
set @@session.binlog_format=default;
256+
drop temporary table if exists t9;
257+
Warnings:
258+
Note 1051 Unknown table 'test.t9'
259+
connect con1,localhost,root,,;
260+
set session binlog_format=default;
261+
create temporary table t9 (i int);
262+
*** Must be no DROP logged for t9 when there was no CREATE, at disconnect too ***
263+
disconnect con1;
264+
connection server_1;
255265
include/show_binlog_events.inc
256266
Log_name Pos Event_type Server_id End_log_pos Info
257267
master-bin.000001 # Gtid # # GTID #-#-#
@@ -262,5 +272,9 @@ master-bin.000001 # Gtid # # GTID #-#-#
262272
master-bin.000001 # Query # # use `test`; create temporary table t7 (a int)
263273
master-bin.000001 # Gtid # # GTID #-#-#
264274
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t7` /* generated by server */
275+
master-bin.000001 # Gtid # # GTID #-#-#
276+
master-bin.000001 # Query # # use `test`; create temporary table t9 (i int)
277+
master-bin.000001 # Gtid # # GTID #-#-#
278+
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t9`
265279
drop table t2;
266280
include/rpl_end.inc

0 commit comments

Comments
 (0)