Skip to content

Commit 2e99b0b

Browse files
author
Alfranio Correia
committed
BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a
transaction BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW Post-merge fixes.
1 parent 9cd21e8 commit 2e99b0b

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

mysql-test/include/commit.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0);
640640
--echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
641641
--echo #
642642
drop temporary table t2;
643-
call p_verify_status_increment(1, 0, 0, 0);
643+
call p_verify_status_increment(1, 0, 1, 0);
644644
commit;
645-
call p_verify_status_increment(1, 0, 0, 0);
645+
call p_verify_status_increment(1, 0, 1, 0);
646646

647647
--echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit
648648
--echo #

mysql-test/r/commit_1innodb.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,11 +709,11 @@ SUCCESS
709709
# 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
710710
#
711711
drop temporary table t2;
712-
call p_verify_status_increment(1, 0, 0, 0);
712+
call p_verify_status_increment(1, 0, 1, 0);
713713
SUCCESS
714714

715715
commit;
716-
call p_verify_status_increment(1, 0, 0, 0);
716+
call p_verify_status_increment(1, 0, 1, 0);
717717
SUCCESS
718718

719719
# 26. Verify that SET AUTOCOMMIT issues an implicit commit

mysql-test/r/ctype_cp932_binlog_stm.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ CREATE TABLE t1 (b VARCHAR(2));
7878
INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
7979
INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
8080
CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
81-
Warnings:
82-
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe.
8381
CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
84-
Warnings:
85-
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe.
8682
DROP TABLE t1;
8783
CREATE TABLE t1 AS
8884
SELECT concat(head, tail) AS code, ' ' AS a

mysql-test/t/ctype_cp932_binlog_stm.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
6464
#
6565
# Populate tables head and tail with values '00'-'FF'
6666
#
67+
--disable_warnings
6768
CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
6869
CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
70+
--enable_warnings
6971
DROP TABLE t1;
7072
#
7173
# Populate table t1 with all codes [80..FF][20..FF]

mysql-test/t/mysqlbinlog.test

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,14 @@ EOF
145145
# must be digestable for both client and server. In 4.1 the client
146146
# should use default-character-set same as the server.
147147
flush logs;
148-
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
148+
# Due to BUG#18337 that wrongly suppresses the BINLOG EVENTS when
149+
# --short-form is used, the "insert into t5 select * from `������`"
150+
# which is unsafe and thus written to the binary log in the row
151+
# format is not executed. This makes the assertion select * from t5
152+
# /* must be (1),(1) */; to fail. To temporary fix the bug, we
153+
# removed the option --short-form.
154+
#--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
155+
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
149156
select * from t5 /* must be (1),(1) */;
150157
drop table t5;
151158

0 commit comments

Comments
 (0)