commit a96264b19cad128ba0dc80425853ba97ef41bf89 Author: Laurynas Biveinis Date: Thu Dec 1 09:22:34 2016 +0200 Fix bug 72475 / 1313901 (Binlog events with binlog_format=MIXED are unconditionally logged in ROW format) The bug is a result of an old fix for bug 20499. This fix changes mixed replication behavior as follows: If using MIXED mode replication, all DDL and DML statements that touch a temporary table will be marked to binlog in ROW format. This means that any statement that is using exclusively temporary tables will not be binlogged at all. Any DDL or DML that uses a mix of temporary and non-temporary tables will be binlogged in ROW format for the non-temporary table operations. The one exception is DROP table when dropping a temporary table which will always be binlogged as DROP TEMPORARY TABLE IF EXISTS on the master. diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 240553df6c5..1fd23e9d2cd 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -129,8 +129,8 @@ XA END 'idle_at_disconnect'; --let $wait_binlog_event= DROP --source include/wait_for_binlog_event.inc --echo # Dump binlog to show that, either the generated DROP comes after tx ---echo # commit (stmt or mixed), or there is no trace of the XA txn and ---echo # the temp table (row) +--echo # commit (stmt), or there is no trace of the XA txn and the temp +--echo # table (row or mixed) --source include/show_binlog_events.inc --echo # --echo # Start XA txn and leave in XA_idle diff --git a/mysql-test/extra/binlog_tests/enforce_gtid_consistency_statement.inc b/mysql-test/extra/binlog_tests/enforce_gtid_consistency_statement.inc index bb90893b58b..dba16a6bec5 100644 --- a/mysql-test/extra/binlog_tests/enforce_gtid_consistency_statement.inc +++ b/mysql-test/extra/binlog_tests/enforce_gtid_consistency_statement.inc @@ -12,7 +12,7 @@ # --let $statement= STATEMENT # --let $gtid_violation= [0|1] # --let $statement_ends_transaction= [0|1] -# [--let $statement_ends_transaction_row= [0|1]] +# [--let $statement_ends_transaction_row_mixed= [0|1]] # --let $violation_result= [0|1|2] # --let $error_code= ER_SOMETHING # --let $error_message= some text @@ -53,14 +53,14 @@ # transaction that increases the counters will decrease them when # the transaction ends. # -# $statement_ends_transaction_row +# $statement_ends_transaction_row_mixed # Normally, $statement_ends_transaction is used regardless of # BINLOG_FORMAT. But in some corner cases, the value of # $statement_ends_transaction depends on BINLOG_FORMAT. For those # cases, the caller should set $statement_ends_transaction to the -# expected value when BINLOG_FORMAT==STATEMENT or MIXED, and -# $statement_ends_transaction_row to the expected value when -# BINLOG_FORMAT=ROW. The output to the result file will be the +# expected value when BINLOG_FORMAT==STATEMENT, and +# $statement_ends_transaction_row_mixed to the expected value when +# BINLOG_FORMAT=ROW or MIXED. The output to the result file will be the # same regardless of BINLOG_FORMAT. # # $error_code @@ -102,7 +102,7 @@ if ($gtid_violation) if ($rpl_debug) { - --echo gtid_violation='$gtid_violation' violation_result='$violation_result' error_code='$error_code' expectation='$expected_status' statement_ends_transaction='$statement_ends_transaction' statement_ends_transaction_row='$statement_ends_transaction_row' + --echo gtid_violation='$gtid_violation' violation_result='$violation_result' error_code='$error_code' expectation='$expected_status' statement_ends_transaction='$statement_ends_transaction' statement_ends_transaction_row_mixed='$statement_ends_transaction_row_mixed' --echo pre_statement='$pre_statement' --echo gtid_next='$gtid_next' --echo statement='$statement' @@ -226,13 +226,17 @@ if ($rpl_debug) } --let $expect_end_transaction= $statement_ends_transaction -if ($statement_ends_transaction_row != '') +if ($statement_ends_transaction_row_mixed != '') { if ($binlog_format == 'ROW') { - --let $expect_end_transaction= $statement_ends_transaction_row + --let $expect_end_transaction= $statement_ends_transaction_row_mixed } - --let $counter_expected_text= $statement_ends_transaction_row (stm) / $statement_ends_transaction (row) + if ($binlog_format == 'MIXED') + { + --let $expect_end_transaction= $statement_ends_transaction_row_mixed + } + --let $counter_expected_text= $statement_ends_transaction (stm) / $statement_ends_transaction_row_mixed (row) if ($gtid_next == 'AUTOMATIC') { --let $automatic_counter_expected_text= $counter_expected_text @@ -247,7 +251,7 @@ if ($expect_end_transaction) --let $automatic_counter_expected= 0 --let $anonymous_counter_expected= 0 } -if ($statement_ends_transaction_row == '') +if ($statement_ends_transaction_row_mixed == '') { --let $automatic_counter_expected_text= $automatic_counter_expected --let $anonymous_counter_expected_text= $anonymous_counter_expected @@ -276,5 +280,5 @@ SET GTID_NEXT = 'AUTOMATIC'; --source include/assert.inc #--let $statement_ends_transaction= 0 ---let $statement_ends_transaction_row= +--let $statement_ends_transaction_row_mixed= --let $pre_statement= diff --git a/mysql-test/extra/binlog_tests/enforce_gtid_consistency_tmp_violation.test b/mysql-test/extra/binlog_tests/enforce_gtid_consistency_tmp_violation.test index 52120242445..f5eed711b8a 100644 --- a/mysql-test/extra/binlog_tests/enforce_gtid_consistency_tmp_violation.test +++ b/mysql-test/extra/binlog_tests/enforce_gtid_consistency_tmp_violation.test @@ -11,7 +11,7 @@ # When the created table is myisam, it is considered a # non-transactional statement, and therefore logged before the # transaction ends, and thus anonymous ownership is released and the -# counters decreased. Except when binlog_format=row: in that case +# counters decreased. Except when binlog_format=row or mixed: in that case # CREATE TEMPORARY is not logged at all. Therefore, the transaction # context is left open, so it keeps anonymous ownership, and does not # modify counter values. @@ -25,7 +25,7 @@ DROP TEMPORARY TABLE IF EXISTS t1; --echo ---- CREATE TEMPORARY in trx (MyISAM, BEGIN) ---- --let $statement_ends_transaction= 1 ---let $statement_ends_transaction_row= 0 +--let $statement_ends_transaction_row_mixed= 0 --let $pre_statement= BEGIN --let $statement= CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM --source extra/binlog_tests/enforce_gtid_consistency_statement.inc @@ -41,7 +41,7 @@ DROP TEMPORARY TABLE IF EXISTS t1; --echo ---- CREATE TEMPORARY in trx (MyISAM, AUTOCOMMIT=0) ---- --let $statement_ends_transaction= 1 ---let $statement_ends_transaction_row= 0 +--let $statement_ends_transaction_row_mixed= 0 SET AUTOCOMMIT = 0; --let $statement= CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM --source extra/binlog_tests/enforce_gtid_consistency_statement.inc diff --git a/mysql-test/extra/binlog_tests/logical_timestamping.inc b/mysql-test/extra/binlog_tests/logical_timestamping.inc index a98a5a1009d..6a3bcd9ef42 100644 --- a/mysql-test/extra/binlog_tests/logical_timestamping.inc +++ b/mysql-test/extra/binlog_tests/logical_timestamping.inc @@ -191,8 +191,7 @@ DROP TABLE t1; # -# Testing DROP of multiple tables logging when a query produces few groups -# into binary log. +# Testing DROP of multiple tables logging # CREATE TABLE t1 (a int) ENGINE= innodb; @@ -201,16 +200,12 @@ RESET MASTER; CREATE TEMPORARY TABLE ttm1 (a INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tti1 (a INT) ENGINE=Innodb; -# The query is logged in four parts where only -# the first one is sequenced. -# Such logging is caused by just one cache is used for logging. - ---echo *** The query is logged in four parts. +--echo *** The query is logged in one part. DROP TABLE tm,t1,ttm1,tti1; ---let $logical_timestamps= 0 1;1 2;2 3;3 4;4 5;5 6 +--let $logical_timestamps= 0 1;1 2;2 3 --source include/assert_logical_timestamps.inc # diff --git a/mysql-test/suite/binlog/t/binlog_tmp_table.test b/mysql-test/extra/binlog_tests/tmp_table.test similarity index 98% rename from mysql-test/suite/binlog/t/binlog_tmp_table.test rename to mysql-test/extra/binlog_tests/tmp_table.test index 3cea366ff00..f65828c4cbd 100644 --- a/mysql-test/suite/binlog/t/binlog_tmp_table.test +++ b/mysql-test/extra/binlog_tests/tmp_table.test @@ -27,7 +27,6 @@ # BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used # source include/have_log_bin.inc; -source include/have_binlog_format_mixed_or_statement.inc; RESET MASTER; diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_drop_temp.test b/mysql-test/extra/rpl_tests/rpl_drop_temp.test similarity index 100% rename from mysql-test/suite/rpl_nogtid/t/rpl_drop_temp.test rename to mysql-test/extra/rpl_tests/rpl_drop_temp.test diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index d931fb44dd9..baec7377d34 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -394,7 +394,7 @@ while ($ddl_cases >= 1) { let $cmd= CREATE TEMPORARY TABLE tt_xx (a int); let $in_temporary= yes; - # In SBR and MIXED modes, the DDL statement is written to the binary log but + # In SBR mode, the DDL statement is written to the binary log but # does not commit the current transaction. # # 1: GTID @@ -412,11 +412,24 @@ while ($ddl_cases >= 1) # 4: ROW EVENT # 5: COMMIT # - if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'` ) + if (`select @@binlog_format = 'STATEMENT'` ) { let $commit_event_row_number= 5; } # + # In MIXED mode, the DDL statement is not written to the binary log and + # does not commit the current transaction. + # + # 1: GTID + # 2: BEGIN + # 3: INSERT + # 4: COMMIT + # + if (`select @@binlog_format = 'MIXED'` ) + { + let $commit_event_row_number= 4; + } + # # In NDB (RBR mode), the commit event is the sixth event # in the binary log: # @@ -461,15 +474,16 @@ while ($ddl_cases >= 1) # # 1: GTID # 2: BEGIN - # 3: TABLE MAP EVENT - # 4: ROW EVENT - # 5: COMMIT - # 6: GTID - # 7: DDL EVENT which triggered the previous commmit. + # 3: ROW EVENT + # 4: COMMIT + # 5: GTID # if (`select @@binlog_format = 'MIXED'`) { - let $commit_event_row_number= 5; + # Since this alter is done on a temp table in MIXED, it will not be + # binlogged at all, so explicitly commit. + let $in_temporary= yes; + let $commit_event_row_number= 4; } # # In NDB (RBR and MIXED modes), the commit event is the 7th event @@ -496,14 +510,15 @@ while ($ddl_cases >= 1) # # 1: GTID # 2: BEGIN - # 3: TABLE MAP EVENT - # 4: ROW EVENT - # 5: COMMIT - # 6: DDL EVENT which triggered the previous commmit. + # 3: ROW EVENT + # 4: COMMIT # if (`select @@binlog_format = 'MIXED'`) { - let $commit_event_row_number= 5; + # Since this alter is done on a temp table in MIXED, it will not be + # binlogged at all, so explicitly commit. + let $in_temporary= yes; + let $commit_event_row_number= 4; } # # In NDB (RBR and MIXED modes), the commit event is the sixth event @@ -551,7 +566,7 @@ while ($ddl_cases >= 1) { let $commit_event_row_number= 5; } - # In MIXED mode, the changes are logged as rows and we have what follows: + # In ROW mode, the changes are logged as rows and we have what follows: # # 1: GTID # 2: BEGIN @@ -560,10 +575,23 @@ while ($ddl_cases >= 1) # 5: DROP TEMPORARY table IF EXISTS # 6: COMMIT # - if (`select @@binlog_format = 'MIXED' || @@binlog_format = 'ROW'`) + if (`select @@binlog_format = 'ROW'`) { let $commit_event_row_number= 6; } + # In MIXED mode, the changes are logged as rows and we have what follows: + # + # 1: GTID + # 2: BEGIN + # 2: ROW EVENT + # 3: DROP TEMPORARY table IF EXISTS + # 4: COMMIT + # + if (`select @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 5; + } + # # In NDB (RBR and MIXED modes), the commit event is the sixth event # in the binary log: diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test index 5325bbf08ec..ea05ad0ac4d 100644 --- a/mysql-test/extra/rpl_tests/rpl_innodb.test +++ b/mysql-test/extra/rpl_tests/rpl_innodb.test @@ -108,7 +108,12 @@ connection slave; SHOW CREATE TABLE mysqltest1.tmp; --error ER_NO_SUCH_TABLE SHOW CREATE TABLE mysqltest1.tmp2; ---echo ######### t1 has two rows here: the transaction not rolled back since t1 uses MyISAM ######### +# Aa a result of the bugfix for 72475, t1 has one row here since the +# CREATE TEMPORARY TABLE tmp2 above is not binlogged and thus changes the +# transactional/non-transactional logic, causing the INSERT f1=2 to not be bilogged +# on ROLLBACK +--echo ######### for SBR, t1 has two rows here: the transaction not rolled back since t1 uses MyISAM ######### +--echo ######### for MBR, t1 has one row here: the transaction not rolled back since t1 uses MyISAM ######### SELECT COUNT(*) FROM mysqltest1.t1; FLUSH LOGS; diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/extra/rpl_tests/rpl_rewrt_db.test similarity index 98% rename from mysql-test/suite/rpl/t/rpl_rewrt_db.test rename to mysql-test/extra/rpl_tests/rpl_rewrt_db.test index 359a59aeceb..0d24a9ba8e2 100644 --- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test +++ b/mysql-test/extra/rpl_tests/rpl_rewrt_db.test @@ -1,6 +1,5 @@ + # TBF - difference in row level logging --- source include/have_binlog_format_mixed_or_statement.inc --- source include/master-slave.inc --disable_warnings drop database if exists mysqltest1; @@ -254,4 +253,3 @@ connection master; --source include/sync_slave_sql_with_master.inc # end of 5.0 tests ---source include/rpl_end.inc diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index fd0d502dc86..24633816e53 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -114,7 +114,6 @@ insert into t1 values (1); drop table tt1, t1; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) @@ -124,7 +123,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ FLUSH STATUS; # 'DROP TABLE IF EXISTS ' is binlogged diff --git a/mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result b/mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result deleted file mode 100644 index f886ccb134d..00000000000 --- a/mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result +++ /dev/null @@ -1,78 +0,0 @@ -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -MIXED -CREATE TABLE t1 (a VARCHAR(100)); -CREATE TEMPORARY TABLE t2 (a VARCHAR(100)); -# Test allow switching @@SESSION.binlog_format from MIXED to STATEMENT -# when there are open temp tables and we are logging in statement based format. -SET SESSION binlog_format = STATEMENT; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -STATEMENT -# Test allow switching @@SESSION.binlog_format from STATEMENT to -# STATEMENT when there are open temp tables. -SET SESSION binlog_format = STATEMENT; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -STATEMENT -INSERT INTO t1 VALUES ('statement based'); -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -STATEMENT -# Test allow switching @@SESSION.binlog_format from STATEMENT to -# MIXED when there are open temp tables. -SET SESSION binlog_format = MIXED; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -MIXED -# Test allow switching @@SESSION.binlog_format from MIXED to MIXED -# when there are open temp tables. -SET SESSION binlog_format = MIXED; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -MIXED -INSERT INTO t2 VALUES (UUID()); -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -MIXED -# Test forbit switching @@SESSION.binlog_format from MIXED to STATEMENT -# when there are open temp tables and we are logging in row based format. -SET SESSION binlog_format = STATEMENT; -ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -MIXED -SET SESSION binlog_format = ROW; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -ROW -INSERT INTO t1 VALUES ('row based'); -# Test allow switching @@SESSION.binlog_format from ROW to MIXED -# when there are open temp tables. -SET SESSION binlog_format = MIXED; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -MIXED -INSERT INTO t1 VALUES ('row based'); -# Test allow switching @@SESSION.binlog_format from MIXED to ROW -# when there are open temp tables. -SET SESSION binlog_format = ROW; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -ROW -# Test allow switching @@SESSION.binlog_format from ROW to ROW -# when there are open temp tables. -SET SESSION binlog_format = ROW; -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -ROW -INSERT INTO t1 VALUES ('row based'); -# Test forbit switching @@SESSION.binlog_format from ROW to STATEMENT -# when there are open temp tables. -SET SESSION binlog_format = STATEMENT; -ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables -SELECT @@SESSION.binlog_format; -@@SESSION.binlog_format -ROW -DROP TEMPORARY TABLE t2; -DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result new file mode 100644 index 00000000000..83dc33fdf16 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result @@ -0,0 +1,92 @@ +DROP DATABASE IF EXISTS `drop-temp+table-test`; +RESET MASTER; +CREATE DATABASE `drop-temp+table-test`; +USE `drop-temp+table-test`; +CREATE TEMPORARY TABLE shortn1 (a INT); +CREATE TEMPORARY TABLE `table:name` (a INT); +CREATE TEMPORARY TABLE shortn2 (a INT); +CREATE TEMPORARY TABLE tmp(c1 int); +CREATE TEMPORARY TABLE tmp1(c1 int); +CREATE TEMPORARY TABLE tmp2(c1 int); +CREATE TEMPORARY TABLE tmp3(c1 int); +CREATE TABLE t(c1 int); +DROP TEMPORARY TABLE IF EXISTS tmp; +DROP TEMPORARY TABLE IF EXISTS tmp; +DROP TEMPORARY TABLE IF EXISTS tmp, tmp1; +DROP TEMPORARY TABLE tmp3; +DROP TABLE IF EXISTS tmp2, t; +DROP TABLE IF EXISTS tmp2, t; +SELECT GET_LOCK("a",10); +GET_LOCK("a",10) +1 +USE test; +SELECT GET_LOCK("a",10); +GET_LOCK("a",10) +1 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test` +master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1`,`tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp3` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` +DROP DATABASE `drop-temp+table-test`; +RESET MASTER; +CREATE TABLE t1 ( i text ); +CREATE TEMPORARY TABLE ttmp1 ( i text ); +SET @@session.binlog_format=ROW; +INSERT INTO t1 VALUES ('1'); +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i text ) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` +RESET MASTER; +DROP TABLE t1; +# +# BUG#21638823: ASSERTION FAILED: +# THD->GET_TRANSACTION()->IS_EMPTY(TRANSACTION_CTX::STMT) || THD +# +# Test case first checks that it is possible to terminate a connection +# with a temporary table (which will implicitly remove the temporary +# table) while in XA_idle. Then checks that an explicit DROP TEMPORARY +# TABLE is rejected with ER_XAER_RMFAIL as required by the XA spec. +# +# Reset master to avoid clutter when dumping binlog +RESET MASTER; +# Create separate connection +# Create temporary table +CREATE TEMPORARY TABLE temp(i int); +INSERT INTO temp VALUES (0), (1), (2), (3); +# Start XA txn and leave it in XA_idle +XA START 'idle_at_disconnect'; +XA END 'idle_at_disconnect'; +# Terminate connection to verify that the temporary table can be +# removed at disconnect even in XA_idle, and that this does not +# cause problems for replication +# Dump binlog to show that, either the generated DROP comes after tx +# commit (stmt), or there is no trace of the XA txn and the temp +# table (row or mixed) +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp` +# +# Start XA txn and leave in XA_idle +XA START 'idle_when_drop_temp'; +XA END 'idle_when_drop_temp'; +# Verify that explicit DROP TEMPORARY TABLE is rejected in XA_idle +DROP TEMPORARY TABLE IF EXISTS t; +Got one of the listed errors +XA ROLLBACK 'idle_when_drop_temp'; +RESET MASTER; diff --git a/mysql-test/suite/binlog/r/binlog_tmp_table.result b/mysql-test/suite/binlog/r/binlog_mix_tmp_table.result similarity index 100% rename from mysql-test/suite/binlog/r/binlog_tmp_table.result rename to mysql-test/suite/binlog/r/binlog_mix_tmp_table.result diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index b1c9561e40a..83dc33fdf16 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -76,8 +76,8 @@ XA END 'idle_at_disconnect'; # removed at disconnect even in XA_idle, and that this does not # cause problems for replication # Dump binlog to show that, either the generated DROP comes after tx -# commit (stmt or mixed), or there is no trace of the XA txn and -# the temp table (row) +# commit (stmt), or there is no trace of the XA txn and the temp +# table (row or mixed) include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp` diff --git a/mysql-test/suite/binlog/r/binlog_row_tmp_table.result b/mysql-test/suite/binlog/r/binlog_row_tmp_table.result new file mode 100644 index 00000000000..2d557b7cfa0 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_row_tmp_table.result @@ -0,0 +1,44 @@ +RESET MASTER; +create table foo (a int); +flush logs; +create temporary table tmp1_foo like foo; +create temporary table tmp2_foo (a int); +insert into tmp1_foo values (1), (2), (3), (4); +replace into tmp2_foo values (1), (2), (3), (4); +update tmp1_foo set a=2*a-1; +update tmp2_foo set a=2*a; +delete from tmp1_foo where a < 5; +delete from tmp2_foo where a < 5; +insert into foo select * from tmp1_foo; +insert into foo select * from tmp2_foo; +truncate table tmp1_foo; +truncate table tmp2_foo; +flush logs; +select * from foo; +a +5 +7 +6 +8 +drop table foo; +create table foo (a int); +RESET MASTER; +select * from foo; +a +5 +7 +6 +8 +drop table foo; +RESET MASTER; +create database b51226; +use b51226; +create temporary table t1(i int); +use b51226; +create temporary table t1(i int); +create temporary table t1(i int); +ERROR 42S01: Table 't1' already exists +insert into t1 values(1); +DROP DATABASE b51226; +FLUSH LOGS; +RESET MASTER; diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 31edf75f896..41989e765df 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -84,8 +84,8 @@ XA END 'idle_at_disconnect'; # removed at disconnect even in XA_idle, and that this does not # cause problems for replication # Dump binlog to show that, either the generated DROP comes after tx -# commit (stmt or mixed), or there is no trace of the XA txn and -# the temp table (row) +# commit (stmt), or there is no trace of the XA txn and the temp +# table (row or mixed) include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp(i int) diff --git a/mysql-test/suite/binlog/r/binlog_stm_tmp_table.result b/mysql-test/suite/binlog/r/binlog_stm_tmp_table.result new file mode 100644 index 00000000000..2d557b7cfa0 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_stm_tmp_table.result @@ -0,0 +1,44 @@ +RESET MASTER; +create table foo (a int); +flush logs; +create temporary table tmp1_foo like foo; +create temporary table tmp2_foo (a int); +insert into tmp1_foo values (1), (2), (3), (4); +replace into tmp2_foo values (1), (2), (3), (4); +update tmp1_foo set a=2*a-1; +update tmp2_foo set a=2*a; +delete from tmp1_foo where a < 5; +delete from tmp2_foo where a < 5; +insert into foo select * from tmp1_foo; +insert into foo select * from tmp2_foo; +truncate table tmp1_foo; +truncate table tmp2_foo; +flush logs; +select * from foo; +a +5 +7 +6 +8 +drop table foo; +create table foo (a int); +RESET MASTER; +select * from foo; +a +5 +7 +6 +8 +drop table foo; +RESET MASTER; +create database b51226; +use b51226; +create temporary table t1(i int); +use b51226; +create temporary table t1(i int); +create temporary table t1(i int); +ERROR 42S01: Table 't1' already exists +insert into t1 values(1); +DROP DATABASE b51226; +FLUSH LOGS; +RESET MASTER; diff --git a/mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test b/mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test deleted file mode 100644 index 698e6105552..00000000000 --- a/mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test +++ /dev/null @@ -1,77 +0,0 @@ - -# -# Bug #45855 row events in binlog after switch from binlog_fmt=mix to stmt with open tmp tbl -# Bug #45856 can't switch from binlog_format=row to mix with open tmp tbl -# This test verfies if the program will generate ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR -# error and forbid switching @@SESSION.binlog_format from MIXED or ROW to -# STATEMENT when there are open temp tables and we are logging in row format. -# There is no error in any other case. -# - -source include/have_binlog_format_mixed.inc; - -SELECT @@SESSION.binlog_format; -CREATE TABLE t1 (a VARCHAR(100)); -CREATE TEMPORARY TABLE t2 (a VARCHAR(100)); - ---echo # Test allow switching @@SESSION.binlog_format from MIXED to STATEMENT ---echo # when there are open temp tables and we are logging in statement based format. -SET SESSION binlog_format = STATEMENT; -SELECT @@SESSION.binlog_format; - ---echo # Test allow switching @@SESSION.binlog_format from STATEMENT to ---echo # STATEMENT when there are open temp tables. -SET SESSION binlog_format = STATEMENT; -SELECT @@SESSION.binlog_format; - -INSERT INTO t1 VALUES ('statement based'); -SELECT @@SESSION.binlog_format; ---echo # Test allow switching @@SESSION.binlog_format from STATEMENT to ---echo # MIXED when there are open temp tables. -SET SESSION binlog_format = MIXED; -SELECT @@SESSION.binlog_format; - ---echo # Test allow switching @@SESSION.binlog_format from MIXED to MIXED ---echo # when there are open temp tables. -SET SESSION binlog_format = MIXED; -SELECT @@SESSION.binlog_format; - -INSERT INTO t2 VALUES (UUID()); -SELECT @@SESSION.binlog_format; - ---echo # Test forbit switching @@SESSION.binlog_format from MIXED to STATEMENT ---echo # when there are open temp tables and we are logging in row based format. ---ERROR ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR -SET SESSION binlog_format = STATEMENT; -SELECT @@SESSION.binlog_format; - -SET SESSION binlog_format = ROW; -SELECT @@SESSION.binlog_format; - -INSERT INTO t1 VALUES ('row based'); ---echo # Test allow switching @@SESSION.binlog_format from ROW to MIXED ---echo # when there are open temp tables. -SET SESSION binlog_format = MIXED; -SELECT @@SESSION.binlog_format; - -INSERT INTO t1 VALUES ('row based'); ---echo # Test allow switching @@SESSION.binlog_format from MIXED to ROW ---echo # when there are open temp tables. -SET SESSION binlog_format = ROW; -SELECT @@SESSION.binlog_format; - ---echo # Test allow switching @@SESSION.binlog_format from ROW to ROW ---echo # when there are open temp tables. -SET SESSION binlog_format = ROW; -SELECT @@SESSION.binlog_format; - -INSERT INTO t1 VALUES ('row based'); ---echo # Test forbit switching @@SESSION.binlog_format from ROW to STATEMENT ---echo # when there are open temp tables. ---ERROR ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR -SET SESSION binlog_format = STATEMENT; -SELECT @@SESSION.binlog_format; - -DROP TEMPORARY TABLE t2; -DROP TABLE t1; - diff --git a/mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test new file mode 100644 index 00000000000..51c6af99913 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test @@ -0,0 +1,4 @@ +# This is a wrapper for binlog.test so that the same test case can be used + +-- source include/have_binlog_format_mixed.inc +-- source extra/binlog_tests/drop_temp_table.test diff --git a/mysql-test/suite/binlog/t/binlog_mix_tmp_table.test b/mysql-test/suite/binlog/t/binlog_mix_tmp_table.test new file mode 100644 index 00000000000..a91fba12246 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_mix_tmp_table.test @@ -0,0 +1,2 @@ +source include/have_binlog_format_mixed.inc; +source extra/binlog_tests/tmp_table.test; diff --git a/mysql-test/suite/binlog/t/binlog_row_tmp_table.test b/mysql-test/suite/binlog/t/binlog_row_tmp_table.test new file mode 100644 index 00000000000..be726bbc748 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_row_tmp_table.test @@ -0,0 +1,2 @@ +source include/have_binlog_format_row.inc; +source extra/binlog_tests/tmp_table.test; diff --git a/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test index 6c49abaf1da..7ab0f5916c0 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test +++ b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test @@ -1,6 +1,5 @@ # This is a wrapper for binlog.test so that the same test case can be used -# For both statement and row based bin logs 9/19/2005 [jbm] --- source include/have_binlog_format_mixed_or_statement.inc +-- source include/have_binlog_format_statement.inc -- source extra/binlog_tests/drop_temp_table.test diff --git a/mysql-test/suite/binlog/t/binlog_stm_tmp_table.test b/mysql-test/suite/binlog/t/binlog_stm_tmp_table.test new file mode 100644 index 00000000000..69f6da32b4f --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_stm_tmp_table.test @@ -0,0 +1,2 @@ +source include/have_binlog_format_statement.inc; +source extra/binlog_tests/tmp_table.test; diff --git a/mysql-test/suite/binlog_gtid/r/binlog_mts_logical_clock_gtid.result b/mysql-test/suite/binlog_gtid/r/binlog_mts_logical_clock_gtid.result index a4a68fcadc8..60922af490a 100644 --- a/mysql-test/suite/binlog_gtid/r/binlog_mts_logical_clock_gtid.result +++ b/mysql-test/suite/binlog_gtid/r/binlog_mts_logical_clock_gtid.result @@ -70,6 +70,6 @@ CREATE TABLE tm (a int) ENGINE= MyISAM; RESET MASTER; CREATE TEMPORARY TABLE ttm1 (a INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tti1 (a INT) ENGINE=Innodb; -*** The query is logged in four parts. +*** The query is logged in one part. DROP TABLE tm,t1,ttm1,tti1; -include/include/assert_logical_timestamps.inc [0 1;1 2;2 3;3 4;4 5;5 6] +include/include/assert_logical_timestamps.inc [0 1;1 2;2 3] diff --git a/mysql-test/suite/binlog_nogtid/r/binlog_enforce_gtid_consistency_tmp_violation.result b/mysql-test/suite/binlog_nogtid/r/binlog_enforce_gtid_consistency_tmp_violation.result index a57c52dfe24..91712638680 100644 --- a/mysql-test/suite/binlog_nogtid/r/binlog_enforce_gtid_consistency_tmp_violation.result +++ b/mysql-test/suite/binlog_nogtid/r/binlog_enforce_gtid_consistency_tmp_violation.result @@ -37,7 +37,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -74,7 +74,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -184,7 +184,7 @@ include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -219,7 +219,7 @@ include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -476,7 +476,7 @@ include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -511,7 +511,7 @@ include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -621,7 +621,7 @@ include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -656,7 +656,7 @@ include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -913,7 +913,7 @@ include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -948,7 +948,7 @@ include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -1058,7 +1058,7 @@ include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -1093,7 +1093,7 @@ include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be [END] CREATE TEMPORARY TABLE t1 (a INT) ENGINE = MyISAM; include/assert.inc [No warning or error should be generated.] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -1208,7 +1208,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -1245,7 +1245,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -1505,7 +1505,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -1542,7 +1542,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -1654,7 +1654,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; include/assert.inc [Both counters should be 0] @@ -1691,7 +1691,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; include/assert.inc [Both counters should be 0] @@ -1950,7 +1950,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -1987,7 +1987,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -2099,7 +2099,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; include/assert.inc [Both counters should be 0] @@ -2136,7 +2136,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; include/assert.inc [Both counters should be 0] @@ -2395,7 +2395,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -2432,7 +2432,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -2544,7 +2544,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; include/assert.inc [Both counters should be 0] @@ -2581,7 +2581,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; include/assert.inc [Both counters should be 0] @@ -2695,7 +2695,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -2732,7 +2732,7 @@ ERROR HY000: Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be an Error, not a Warning.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; SET GTID_NEXT = 'AUTOMATIC'; @@ -2850,7 +2850,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -2893,7 +2893,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -3174,7 +3174,7 @@ Warning 1787 Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -3217,7 +3217,7 @@ Warning 1787 Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -3351,7 +3351,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -3394,7 +3394,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -3675,7 +3675,7 @@ Warning 1787 Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -3718,7 +3718,7 @@ Warning 1787 Statement violates GTID consistency: CREATE TEMPORARY TABLE and DRO include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] -include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0] ROLLBACK; Warnings: @@ -3852,7 +3852,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. @@ -3895,7 +3895,7 @@ include/assert.inc [One warning/error should be generated.] include/assert.inc [It should be a Warning, not an Error.] include/assert.inc [Text should be "violates GTID consistency"] include/assert.inc [ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT should be 0] -include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 0 (stm) / 1 (row)] +include/assert.inc [ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT should be 1 (stm) / 0 (row)] ROLLBACK; Warnings: Warning 1751 The creation of some temporary tables could not be rolled back. diff --git a/mysql-test/suite/binlog_nogtid/r/binlog_mts_logical_clock.result b/mysql-test/suite/binlog_nogtid/r/binlog_mts_logical_clock.result index 39776e51edc..34fc175062b 100644 --- a/mysql-test/suite/binlog_nogtid/r/binlog_mts_logical_clock.result +++ b/mysql-test/suite/binlog_nogtid/r/binlog_mts_logical_clock.result @@ -70,9 +70,9 @@ CREATE TABLE tm (a int) ENGINE= MyISAM; RESET MASTER; CREATE TEMPORARY TABLE ttm1 (a INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tti1 (a INT) ENGINE=Innodb; -*** The query is logged in four parts. +*** The query is logged in one part. DROP TABLE tm,t1,ttm1,tti1; -include/include/assert_logical_timestamps.inc [0 1;1 2;2 3;3 4;4 5;5 6] +include/include/assert_logical_timestamps.inc [0 1;1 2;2 3] CALL mtr.add_suppression("Some non-transactional changed tables couldn't be rolled back"); CREATE TABLE t1 (a int) ENGINE= innodb; CREATE TABLE tm (a int) ENGINE= MyISAM; diff --git a/mysql-test/suite/binlog_nogtid/r/binlog_stm_binlog.result b/mysql-test/suite/binlog_nogtid/r/binlog_stm_binlog.result index d543b4ec522..9d318f037c0 100644 --- a/mysql-test/suite/binlog_nogtid/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog_nogtid/r/binlog_stm_binlog.result @@ -343,9 +343,7 @@ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2, COERCIBILITY(s1) d3; DROP TEMPORARY TABLE tmp1; END -master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1 -SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%") -master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE `tmp1` /* generated by server */ +master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ DROP PROCEDURE p1; DROP TABLE t1; DROP DATABASE bug39182; @@ -412,8 +410,9 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 -master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) -master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; INSERT IGNORE INTO user SET host='localhost', user='@#@', authentication_string=password('Just a test') master-bin.000001 # Xid # # COMMIT /* XID */ diff --git a/mysql-test/suite/rpl/r/rpl_bug58546.result b/mysql-test/suite/rpl/r/rpl_bug58546.result new file mode 100644 index 00000000000..ab010196e4d --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_bug58546.result @@ -0,0 +1,53 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] + +# Bug#58546 test rpl_packet timeout failure sporadically on PB +# ---------------------------------------------------------------------- +# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was +# possible that IO thread stopped after replicating part of a transaction +# which SQL thread was executing. SQL thread would be hung if the +# transaction could not be rolled back safely. +# It caused some sporadic failures on PB2. +# +# This test verifies that when 'STOP SLAVE' is issued by a user, IO +# thread will continue to fetch the rest events of the transaction which +# is being executed by SQL thread and is not able to be rolled back safely. +CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; +CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1, 1); +include/sync_slave_sql_with_master.inc +include/stop_slave.inc +[connection master] +include/stop_dump_threads.inc +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; +[connection slave] +include/start_slave.inc +BEGIN; +UPDATE t1 SET c2 = 2 WHERE c1 = 1; +[connection master] +BEGIN; +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1); +UPDATE t1 SET c2 = 3 WHERE c1 = 1; +COMMIT; +[connection slave1] +STOP SLAVE; +[connection slave] +ROLLBACK; +[connection master] +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +SET DEBUG_SYNC= 'RESET'; +[connection slave] +include/wait_for_slave_to_stop.inc +[connection slave1] +[connection master] +SET GLOBAL debug= $debug_save; +include/stop_dump_threads.inc +[connection slave1] +include/start_slave.inc +[connection master] +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result b/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result index daced99598b..aeca1ece0e1 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result @@ -26,7 +26,7 @@ CREATE TEMPORARY TABLE t_ignore_wild(a INT); ALTER TABLE t_ignore_wild ADD COLUMN b INT; INSERT INTO t_ignore_wild VALUES (1, 2); DROP TEMPORARY TABLE t_ignore_wild; -include/gtid_step_assert.inc [count=8, only_count=0] +include/gtid_step_assert.inc [count=2, only_count=0] include/rpl_sync.inc ==== Case 1C: database filters on slave applier ==== include/gtid_step_reset.inc @@ -64,7 +64,7 @@ include/gtid_step_reset.inc CREATE TEMPORARY TABLE t2 (a INT); ALTER TABLE t2 ADD COLUMN b INT; INSERT INTO t2 VALUES (1, 2); -include/gtid_step_assert.inc [count=3, only_count=0] +include/gtid_step_assert.inc [count=0, only_count=0] include/rpl_sync.inc ---- Clean up ---- DROP TEMPORARY TABLE t2; diff --git a/mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result new file mode 100644 index 00000000000..12d1758d4db --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result @@ -0,0 +1,208 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +drop database if exists mysqltest1; +create database mysqltest1; +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +a +9 +include/sync_slave_sql_with_master.inc +show databases like 'mysqltest1'; +Database (mysqltest1) +mysqltest1 +select * from test.t1; +a +9 +drop table t1; +drop database mysqltest1; +include/sync_slave_sql_with_master.inc +drop database if exists rewrite; +create database rewrite; +use test; +create table t1 (a date, b date, c date not null, d date); +load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ','; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'c' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +include/sync_slave_sql_with_master.inc +select * from rewrite.t1; +a b c d +0000-00-00 NULL 0000-00-00 0000-00-00 +0000-00-00 0000-00-00 0000-00-00 0000-00-00 +2003-03-03 2003-03-03 2003-03-03 NULL +2003-03-03 2003-03-03 2003-03-03 NULL +truncate table t1; +load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'c' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 +include/sync_slave_sql_with_master.inc +select * from rewrite.t1; +a b c d +NULL NULL 0000-00-00 0000-00-00 +NULL 0000-00-00 0000-00-00 0000-00-00 +NULL 2003-03-03 2003-03-03 NULL +drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' ignore into table t1 fields terminated by ',' enclosed by ''''; +Warnings: +Warning 1261 Row 3 doesn't contain data for all columns +include/sync_slave_sql_with_master.inc +select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; +concat('|',a,'|') concat('|',b,'|') +|Field A| |Field B| +|Field 1| |Field 2' +Field 3,'Field 4| +|Field 5' ,'Field 6| NULL +|Field 6| | 'Field 7'| +drop table t1; +create table t1 (a int, b char(10)) CHARACTER SET latin1; +load data infile '../../std_data/loaddata3.dat' ignore into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +Warnings: +Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3 +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5 +Warning 1262 Row 5 was truncated; it contained more data than there were input columns +include/sync_slave_sql_with_master.inc +select * from rewrite.t1; +a b +1 row 1 +2 row 2 +0 1234567890 +3 row 3 +0 1234567890 +truncate table t1; +load data infile '../../std_data/loaddata4.dat' ignore into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +Warnings: +Warning 1366 Incorrect integer value: ' +' for column 'a' at row 4 +Warning 1261 Row 4 doesn't contain data for all columns +include/sync_slave_sql_with_master.inc +select * from rewrite.t1; +a b +1 row 1 +2 row 2 +3 row 3 +0 +set sql_log_bin= 0; +drop database rewrite; +set sql_log_bin= 1; +set sql_log_bin= 0; +drop table t1; +set sql_log_bin= 1; + +**** +**** Bug #46861 Auto-closing of temporary tables broken by replicate-rewrite-db +**** + +**** +**** Preparing the environment +**** +SET sql_log_bin= 0; +CREATE DATABASE database_master_temp_01; +CREATE DATABASE database_master_temp_02; +CREATE DATABASE database_master_temp_03; +SET sql_log_bin= 1; +SET sql_log_bin= 0; +CREATE DATABASE database_slave_temp_01; +CREATE DATABASE database_slave_temp_02; +CREATE DATABASE database_slave_temp_03; +SET sql_log_bin= 1; + +**** +**** Creating temporary tables on different databases with different connections +**** +**** con_temp_01 --> creates +**** t_01_01_temp on database_master_temp_01 +**** +**** con_temp_02 --> creates +**** t_01_01_temp on database_master_temp_01 +**** t_02_01_temp, t_02_02_temp on database_master_temp_02 +**** +**** con_temp_03 --> creates +**** t_01_01_temp on database_master_temp_01 +**** t_02_01_temp, t_02_02_temp on database_master_temp_02 +**** t_03_01_temp, t_03_02_temp, t_03_03_temp on database_master_temp_03 +**** + +con_temp_01 + +USE database_master_temp_01; +CREATE TEMPORARY TABLE t_01_01_temp(a int); +INSERT INTO t_01_01_temp VALUES(1); + +con_temp_02 + +USE database_master_temp_01; +CREATE TEMPORARY TABLE t_01_01_temp(a int); +INSERT INTO t_01_01_temp VALUES(1); +USE database_master_temp_02; +CREATE TEMPORARY TABLE t_02_01_temp(a int); +INSERT INTO t_02_01_temp VALUES(1); +CREATE TEMPORARY TABLE t_02_02_temp(a int); +INSERT INTO t_02_02_temp VALUES(1); + +con_temp_03 + +USE database_master_temp_01; +CREATE TEMPORARY TABLE t_01_01_temp(a int); +INSERT INTO t_01_01_temp VALUES(1); +USE database_master_temp_02; +CREATE TEMPORARY TABLE t_02_01_temp(a int); +INSERT INTO t_02_01_temp VALUES(1); +CREATE TEMPORARY TABLE t_02_02_temp(a int); +INSERT INTO t_02_02_temp VALUES(1); +USE database_master_temp_03; +CREATE TEMPORARY TABLE t_03_01_temp(a int); +INSERT INTO t_03_01_temp VALUES(1); +CREATE TEMPORARY TABLE t_03_02_temp(a int); +INSERT INTO t_03_02_temp VALUES(1); +CREATE TEMPORARY TABLE t_03_03_temp(a int); +INSERT INTO t_03_03_temp VALUES(1); + +**** Dropping the connections +**** To be sure that the DROP statements have been logged, we make +**** sure that the number of open temporary tables at slave becomes +**** zero. If not,the test will time out. + +include/sync_slave_sql_with_master.inc +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 +flush logs; + +**** Wait until number of open temporary tables at slave becomes zero + + +**** Check if every drop temporary table command is prepended with "use" + +include/assert.inc [The number of drop temporary table events in binlog should be 6] +**** +**** Cleaning up the test case +**** +SET sql_log_bin= 0; +DROP DATABASE database_master_temp_01; +DROP DATABASE database_master_temp_02; +DROP DATABASE database_master_temp_03; +SET sql_log_bin= 1; +SET sql_log_bin= 0; +DROP DATABASE database_slave_temp_01; +DROP DATABASE database_slave_temp_02; +DROP DATABASE database_slave_temp_03; +SET sql_log_bin= 1; +include/sync_slave_sql_with_master.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_mix_row_reset_slave.result similarity index 100% rename from mysql-test/suite/rpl/r/rpl_row_reset_slave.result rename to mysql-test/suite/rpl/r/rpl_mix_row_reset_slave.result diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_stm_rewrt_db.result similarity index 100% rename from mysql-test/suite/rpl/r/rpl_rewrt_db.result rename to mysql-test/suite/rpl/r/rpl_stm_rewrt_db.result diff --git a/mysql-test/suite/rpl/t/rpl_bug58546-master.opt b/mysql-test/suite/rpl/t/rpl_bug58546-master.opt new file mode 100644 index 00000000000..561902d0bd9 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug58546-master.opt @@ -0,0 +1 @@ +--binlog-direct-non-transactional-updates diff --git a/mysql-test/suite/rpl/t/rpl_bug58546.test b/mysql-test/suite/rpl/t/rpl_bug58546.test new file mode 100644 index 00000000000..1e5b57f6c43 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug58546.test @@ -0,0 +1,92 @@ +source include/have_debug.inc; +source include/have_debug_sync.inc; +source include/have_binlog_format_mixed_or_statement.inc; +source include/master-slave.inc; + +--echo +--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB +--echo # ---------------------------------------------------------------------- +--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was +--echo # possible that IO thread stopped after replicating part of a transaction +--echo # which SQL thread was executing. SQL thread would be hung if the +--echo # transaction could not be rolled back safely. +--echo # It caused some sporadic failures on PB2. +--echo # +--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO +--echo # thread will continue to fetch the rest events of the transaction which +--echo # is being executed by SQL thread and is not able to be rolled back safely. + +CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; +CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1, 1); + +--source include/sync_slave_sql_with_master.inc +--source include/stop_slave.inc + +--source include/rpl_connection_master.inc +# make sure there are no zombie threads +--source include/stop_dump_threads.inc + +let $debug_save= `SELECT @@GLOBAL.debug`; +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; + +--source include/rpl_connection_slave.inc +--source include/start_slave.inc + +BEGIN; +UPDATE t1 SET c2 = 2 WHERE c1 = 1; + +--source include/rpl_connection_master.inc +BEGIN; +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1); +UPDATE t1 SET c2 = 3 WHERE c1 = 1; +COMMIT; + +# wait for the dump thread to reach the sync point +--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKe '%debug sync point%' and command='Binlog Dump' +--source include/wait_condition.inc + +--source include/rpl_connection_slave1.inc +let $show_statement= SHOW PROCESSLIST; +let $field= Info; +let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1'; +source include/wait_show_condition.inc; + +send STOP SLAVE; + +--source include/rpl_connection_slave.inc +ROLLBACK; + +--source include/rpl_connection_master.inc +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +# wait for the dump thread to come out of the +# waiting phase before resetting the signals +--let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump' +--source include/wait_condition.inc +SET DEBUG_SYNC= 'RESET'; + +--source include/rpl_connection_slave.inc +source include/wait_for_slave_to_stop.inc; + +--source include/rpl_connection_slave1.inc +reap; + +# Slave has stopped, thence lets make sure that +# we kill the zombie dump threads. Also, make +# sure that we disable the DBUG_EXECUTE_IF +# that would set the dump thread to wait +--source include/rpl_connection_master.inc +SET GLOBAL debug= $debug_save; +# make sure that there are no zombie threads +--source include/stop_dump_threads.inc + +--source include/rpl_connection_slave1.inc +# now the dump thread on the master will start +# from a clena slate, i.e. without the +# DBUG_EXECUTE_IF set +source include/start_slave.inc; + +--source include/rpl_connection_master.inc +DROP TABLE t1, t2; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_change_master_open_temp_tables.test b/mysql-test/suite/rpl/t/rpl_change_master_open_temp_tables.test index d4ab53a6ef9..de4c585c3b7 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master_open_temp_tables.test +++ b/mysql-test/suite/rpl/t/rpl_change_master_open_temp_tables.test @@ -20,7 +20,7 @@ # --source include/master-slave.inc ---source include/have_binlog_format_mixed.inc +--source include/have_binlog_format_statement.inc --echo --echo # create a temporary table, replicate at slave for all the tests below. diff --git a/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test b/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test index 11c5d87ab77..c5746c9bbde 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test @@ -92,8 +92,8 @@ ALTER TABLE t_ignore_wild ADD COLUMN b INT; INSERT INTO t_ignore_wild VALUES (1, 2); DROP TEMPORARY TABLE t_ignore_wild; -# Verify that 8 GTIDs were generated. ---let $gtid_step_count= 8 +# Verify that 2 GTIDs were generated. +--let $gtid_step_count= 2 --source include/gtid_step_assert.inc # Verify that the GTIDs make it to every slave. @@ -182,8 +182,8 @@ CREATE TEMPORARY TABLE t2 (a INT); ALTER TABLE t2 ADD COLUMN b INT; INSERT INTO t2 VALUES (1, 2); -# assert exactly 3 GTIDs were generated ---let $gtid_step_count= 3 +# assert exactly 0 GTIDs were generated +--let $gtid_step_count= 0 --source include/gtid_step_assert.inc # Verify that the GTID gets replicated everywhere. diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt similarity index 100% rename from mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt rename to mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt diff --git a/mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test new file mode 100644 index 00000000000..7853f21ee52 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test @@ -0,0 +1,7 @@ +# TBF - difference in row level logging +-- source include/have_binlog_format_mixed.inc +-- source include/master-slave.inc + +-- source extra/rpl_tests/rpl_rewrt_db.test + +-- source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mix_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_mix_row_reset_slave.test new file mode 100644 index 00000000000..b6909c73069 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_row_reset_slave.test @@ -0,0 +1,6 @@ +# TBF - difference in row level logging +# Temp tables are not replicated in rbr or mixed, but it is still good to hit rbr with everthing +-- source include/not_group_replication_plugin.inc +-- source include/have_binlog_format_mixed_or_row.inc +-- source extra/rpl_tests/rpl_reset_slave.test + diff --git a/mysql-test/suite/rpl/t/rpl_multi_source_open_temp_tables_warning.test b/mysql-test/suite/rpl/t/rpl_multi_source_open_temp_tables_warning.test index ed7561eca88..953720a7487 100644 --- a/mysql-test/suite/rpl/t/rpl_multi_source_open_temp_tables_warning.test +++ b/mysql-test/suite/rpl/t/rpl_multi_source_open_temp_tables_warning.test @@ -22,7 +22,7 @@ # USING MULTI-SOURCE ---source include/have_binlog_format_mixed.inc +--source include/have_binlog_format_statement.inc --let $rpl_multi_source= 1 --let $rpl_topology= 1->2, 3->2, 4->2 diff --git a/mysql-test/suite/rpl/t/rpl_open_temp_tables_warning.test b/mysql-test/suite/rpl/t/rpl_open_temp_tables_warning.test index eb4f146ef02..804b4fa4562 100644 --- a/mysql-test/suite/rpl/t/rpl_open_temp_tables_warning.test +++ b/mysql-test/suite/rpl/t/rpl_open_temp_tables_warning.test @@ -20,7 +20,7 @@ ---source include/have_binlog_format_mixed.inc +--source include/have_binlog_format_statement.inc --source include/master-slave.inc # Create temporary table. diff --git a/mysql-test/suite/rpl/t/rpl_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test deleted file mode 100644 index 25b4a718913..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_reset_slave.test +++ /dev/null @@ -1,6 +0,0 @@ -# TBF - difference in row level logging -# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing --- source include/not_group_replication_plugin.inc --- source include/have_binlog_format_row.inc --- source extra/rpl_tests/rpl_reset_slave.test - diff --git a/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test index 6a99d4e1613..282033bf6d1 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test @@ -1,5 +1,5 @@ # TBF - difference in row level logging --- source include/have_binlog_format_mixed_or_statement.inc +-- source include/have_binlog_format_statement.inc -- source extra/rpl_tests/rpl_reset_slave.test # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_stm_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_rewrt_db-slave.opt new file mode 100644 index 00000000000..290b92e0a3e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_rewrt_db-slave.opt @@ -0,0 +1 @@ +"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test" "--replicate-rewrite-db=database_master_temp_01->database_slave_temp_01" "--replicate-rewrite-db=database_master_temp_02->database_slave_temp_02" "--replicate-rewrite-db=database_master_temp_03->database_slave_temp_03" diff --git a/mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test new file mode 100644 index 00000000000..0e6ce5ea7a9 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test @@ -0,0 +1,7 @@ +# TBF - difference in row level logging +-- source include/have_binlog_format_statement.inc +-- source include/master-slave.inc + +-- source extra/rpl_tests/rpl_rewrt_db.test + +-- source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test index ee05cb943d0..72c930bf6e0 100644 --- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test +++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test @@ -20,8 +20,9 @@ # Requires statement-based logging since temporary tables are not -# logged in row-based logging --- source include/have_binlog_format_mixed_or_statement.inc +# logged in row-based logging. Same now goes for mixed, valid for statement +# only replication as a result of 72475 +-- source include/have_binlog_format_statement.inc source include/master-slave.inc; diff --git a/mysql-test/suite/rpl_gtid/t/rpl_gtids_table.test b/mysql-test/suite/rpl_gtid/t/rpl_gtids_table.test index 151c9797828..91447813913 100644 --- a/mysql-test/suite/rpl_gtid/t/rpl_gtids_table.test +++ b/mysql-test/suite/rpl_gtid/t/rpl_gtids_table.test @@ -73,10 +73,10 @@ SELECT * FROM mysql.gtid_executed; --echo # CREATE TEMPORARY TABLE tmp1 (c1 INT) Engine=MyISAM; CREATE TABLE t3 (a INT); -if (`SELECT @@BINLOG_FORMAT = 'ROW'`) +if (`SELECT @@BINLOG_FORMAT = 'ROW' || @@BINLOG_FORMAT = 'MIXED'`) { # We did not generate gtid for above 'CREATE TEMPORARY TABLE' statement - # in row format, but we did in statement format. So let the 'INSERT' + # in row or mixed format, but we did in statement format. So let the 'INSERT' # statement generate the missed gtid in row format. --disable_query_log INSERT INTO t3 VALUES(1); diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_mix_drop_temp.result b/mysql-test/suite/rpl_nogtid/r/rpl_mix_drop_temp.result new file mode 100644 index 00000000000..968940c9dbd --- /dev/null +++ b/mysql-test/suite/rpl_nogtid/r/rpl_mix_drop_temp.result @@ -0,0 +1,44 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +create database if not exists mysqltest; +use mysqltest; +create temporary table mysqltest.t1 (n int)ENGINE=MyISAM; +create temporary table mysqltest.t2 (n int)ENGINE=MyISAM; +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 +drop database mysqltest; +DROP TEMPORARY TABLE IF EXISTS tmp1; +Warnings: +Note 1051 Unknown table 'test.tmp1' +CREATE TEMPORARY TABLE t1 ( a int ); +DROP TEMPORARY TABLE t1, t2; +ERROR 42S02: Unknown table 'test.t2' +DROP TEMPORARY TABLE tmp2; +ERROR 42S02: Unknown table 'test.tmp2' +DROP TEMPORARY TABLE t1; +stop slave; +**** On Master **** +CREATE TEMPORARY TABLE tmp3 (a int); +DROP TEMPORARY TABLE tmp3; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +include/rpl_reset.inc +CREATE TABLE t1 ( i INT ); +SHOW STATUS LIKE 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 +CREATE TEMPORARY TABLE ttmp1 ( i INT ); +SET SESSION binlog_format=ROW; +SHOW STATUS LIKE 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i INT ) +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_mix_innodb.result b/mysql-test/suite/rpl_nogtid/r/rpl_mix_innodb.result new file mode 100644 index 00000000000..416658c12e5 --- /dev/null +++ b/mysql-test/suite/rpl_nogtid/r/rpl_mix_innodb.result @@ -0,0 +1,138 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +CREATE TABLE t4 ( +id INT(5) unsigned NOT NULL auto_increment, +name varchar(15) NOT NULL default '', +number varchar(35) NOT NULL default 'default', +PRIMARY KEY (id), +UNIQUE KEY unique_rec (name,number) +) ENGINE=InnoDB; +LOAD DATA +INFILE '../../std_data/loaddata_pair.dat' +REPLACE INTO TABLE t4 +(name,number); +SELECT * FROM t4; +id name number +1 XXX 12345 +2 XXY 12345 +SELECT * FROM t4; +id name number +1 XXX 12345 +2 XXY 12345 +LOAD DATA +INFILE '../../std_data/loaddata_pair.dat' +REPLACE INTO TABLE t4 +(name,number); +SELECT * FROM t4; +id name number +4 XXX 12345 +5 XXY 12345 +SELECT * FROM t4; +id name number +4 XXX 12345 +5 XXY 12345 +FLUSH LOGS; +FLUSH LOGS; +DROP DATABASE IF EXISTS mysqltest1; +CREATE DATABASE mysqltest1; +CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT); +CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB"; +SET AUTOCOMMIT = 0; +-------- switch to slave -------- +ALTER TABLE mysqltest1.t1 ENGINE = MyISAM; +SHOW CREATE TABLE mysqltest1.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 +-------- switch to master -------- +INSERT INTO mysqltest1.t1 SET f1= 1; +DROP TEMPORARY TABLE mysqltest1.tmp; +ROLLBACK; +Warnings: +Warning # Some temporary tables were dropped, but these operations could not be rolled back. +SHOW CREATE TABLE mysqltest1.tmp; +ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist +######### Must return no rows here ######### +SELECT COUNT(*) FROM mysqltest1.t1; +COUNT(*) +0 +INSERT INTO mysqltest1.t1 SET f1= 2; +CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT); +ROLLBACK; +Warnings: +Warning # The creation of some temporary tables could not be rolled back. +SHOW CREATE TABLE mysqltest1.tmp2; +Table Create Table +tmp2 CREATE TEMPORARY TABLE `tmp2` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 +######### Must return no rows here ######### +SELECT COUNT(*) FROM mysqltest1.t1; +COUNT(*) +0 +-------- switch to slave -------- +SHOW CREATE TABLE mysqltest1.tmp; +ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist +SHOW CREATE TABLE mysqltest1.tmp2; +ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist +######### for SBR, t1 has two rows here: the transaction not rolled back since t1 uses MyISAM ######### +######### for MBR, t1 has one row here: the transaction not rolled back since t1 uses MyISAM ######### +SELECT COUNT(*) FROM mysqltest1.t1; +COUNT(*) +1 +FLUSH LOGS; +-------- switch to master -------- +FLUSH LOGS; +DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2; +DROP DATABASE mysqltest1; +End of 5.1 tests +# +# Bug#39675 rename tables on innodb tables with pending +# transactions causes slave data issue. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +CREATE TABLE t1 ( +id INT PRIMARY KEY auto_increment, +b INT DEFAULT NULL +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id INT PRIMARY KEY auto_increment, +b INT DEFAULT NULL +) ENGINE=InnoDB; +INSERT INTO t1 (b) VALUES (1),(2),(3); +BEGIN; +INSERT INTO t1(b) VALUES (4); +-------- switch to master1 -------- +RENAME TABLE t1 TO t3, t2 TO t1;; +-------- switch to master -------- +COMMIT; +-------- switch to master1 -------- +-------- switch to master -------- +SELECT * FROM t1; +id b +SELECT * FROM t3; +id b +1 1 +2 2 +3 3 +4 4 +-------- switch to slave -------- +SELECT * FROM t1; +id b +SELECT * FROM t3; +id b +1 1 +2 2 +3 3 +4 4 +-------- switch to master -------- +DROP TABLE t1; +DROP TABLE t3; +End of 6.0 tests +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl_nogtid/r/rpl_mixed_drop_create_temp_table.result index 34d845c8df0..b9c3b579076 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_mixed_drop_create_temp_table.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_mixed_drop_create_temp_table.result @@ -66,7 +66,7 @@ DROP TEMPORARY TABLE tt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-N-Temp'; @@ -74,7 +74,7 @@ DROP TEMPORARY TABLE nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-Xe-Temp'; @@ -133,8 +133,8 @@ DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-TT-Temp'; @@ -142,7 +142,7 @@ DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-NN-Temp'; @@ -150,7 +150,7 @@ DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -167,7 +167,7 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -186,8 +186,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -200,7 +200,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) @@ -218,13 +218,13 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) @@ -468,11 +468,11 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -487,18 +487,18 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -512,7 +512,7 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -530,7 +530,7 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -543,7 +543,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) @@ -560,7 +560,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -582,7 +582,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -607,7 +607,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -629,7 +629,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -658,7 +658,7 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -680,8 +680,8 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -696,7 +696,7 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -714,13 +714,13 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -957,11 +957,11 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -979,18 +979,18 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1006,7 +1006,7 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1027,7 +1027,7 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1042,7 +1042,7 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1059,7 +1059,7 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -1081,7 +1081,7 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -1106,7 +1106,7 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -1128,7 +1128,7 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) @@ -1245,8 +1245,8 @@ DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-TN-Temp'; @@ -1254,8 +1254,8 @@ DROP TABLE tt_tmp_2, nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -1425,8 +1425,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-TN-Temp'; @@ -1439,8 +1439,8 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- ######################################################################### @@ -1458,10 +1458,9 @@ DROP TEMPORARY TABLE nt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp'; @@ -1472,10 +1471,9 @@ DROP TEMPORARY TABLE tt_tmp_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e- @@ -1494,16 +1492,13 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) @@ -1521,10 +1516,9 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1544,10 +1538,9 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (5), (5) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1564,10 +1557,9 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1587,10 +1579,9 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (6), (6) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1613,16 +1604,13 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1640,10 +1628,9 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1667,10 +1654,9 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (7), (7) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1690,10 +1676,9 @@ Warning # Some temporary tables were dropped, but these operations could not be include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1717,10 +1702,9 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (8), (8) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1745,13 +1729,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1 -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1769,9 +1748,6 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -1788,8 +1764,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1804,8 +1779,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1822,12 +1796,10 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_error_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (9), (9) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp Ne C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1844,8 +1816,7 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1862,12 +1833,10 @@ COMMIT; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_error_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (10), (10) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1889,8 +1858,7 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) @@ -1911,8 +1879,7 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1929,8 +1896,7 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1947,8 +1913,7 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1967,12 +1932,10 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_error_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (11), (11) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp Ne R << -e-e-e-e-e-e-e-e-e-e-e- @@ -1991,8 +1954,7 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e- @@ -2011,12 +1973,10 @@ Warning # Some non-transactional changed tables couldn't be rolled back include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_error_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (12), (12) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl_nogtid/r/rpl_mixed_implicit_commit_binlog.result index 717b97c9387..152044dfe1b 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_mixed_implicit_commit_binlog.result @@ -483,7 +483,6 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- @@ -496,8 +495,7 @@ include/assert.inc [There should be a COMMIT event at the specified position (te include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (10) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- @@ -510,8 +508,7 @@ include/assert.inc [There should be a COMMIT event at the specified position (te include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (9) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- @@ -524,8 +521,7 @@ include/assert.inc [There should be a COMMIT event at the specified position (te include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8) master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl_nogtid/r/rpl_mixed_mixing_engines.result index 670c79edf6b..26d00ccdf0c 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_mixed_mixing_engines.result @@ -12691,19 +12691,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -12751,25 +12741,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # SAVEPOINT `S_0` -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK TO `S_0` -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # SAVEPOINT `S_0` -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK TO `S_0` -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -12807,21 +12781,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -12864,11 +12826,6 @@ Warnings: Warning # Some non-transactional changed tables couldn't be rolled back Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -12876,11 +12833,6 @@ master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -12914,19 +12866,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -12969,11 +12911,6 @@ Warnings: Warning # Some non-transactional changed tables couldn't be rolled back Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -12981,11 +12918,6 @@ master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl_nogtid/r/rpl_non_direct_mixed_mixing_engines.result index e1e8753311a..f9373acb804 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_non_direct_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_non_direct_mixed_mixing_engines.result @@ -13063,19 +13063,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -13123,25 +13113,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # SAVEPOINT `S_0` -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK TO `S_0` -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # SAVEPOINT `S_0` -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # ROLLBACK TO `S_0` -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -13179,21 +13153,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -13236,11 +13198,6 @@ Warnings: Warning # Some non-transactional changed tables couldn't be rolled back Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -13248,11 +13205,6 @@ master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -13286,19 +13238,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] @@ -13341,11 +13283,6 @@ Warnings: Warning # Some non-transactional changed tables couldn't be rolled back Warning # The creation of some temporary tables could not be rolled back. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -13353,11 +13290,6 @@ master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Gtid # # SET @@SESSION.GTID_NEXT= Gtid_set -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5) -master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- rpl_mixing_engines.inc [commands=drop-CT] diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_drop_temp.result b/mysql-test/suite/rpl_nogtid/r/rpl_stm_drop_temp.result similarity index 100% rename from mysql-test/suite/rpl_nogtid/r/rpl_drop_temp.result rename to mysql-test/suite/rpl_nogtid/r/rpl_stm_drop_temp.result diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_stm_innodb.result b/mysql-test/suite/rpl_nogtid/r/rpl_stm_innodb.result index 7a0f150b435..997838f6e4a 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_stm_innodb.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_stm_innodb.result @@ -79,7 +79,8 @@ SHOW CREATE TABLE mysqltest1.tmp; ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist SHOW CREATE TABLE mysqltest1.tmp2; ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist -######### t1 has two rows here: the transaction not rolled back since t1 uses MyISAM ######### +######### for SBR, t1 has two rows here: the transaction not rolled back since t1 uses MyISAM ######### +######### for MBR, t1 has one row here: the transaction not rolled back since t1 uses MyISAM ######### SELECT COUNT(*) FROM mysqltest1.t1; COUNT(*) 2 diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_stop_slave.result b/mysql-test/suite/rpl_nogtid/r/rpl_stop_slave.result index 0db4a0d1282..82535346a31 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_stop_slave.result @@ -83,51 +83,4 @@ call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received w call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); [connection master] DROP TABLE t1, t2; - -# Bug#58546 test rpl_packet timeout failure sporadically on PB -# ---------------------------------------------------------------------- -# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was -# possible that IO thread stopped after replicating part of a transaction -# which SQL thread was executing. SQL thread would be hung if the -# transaction could not be rolled back safely. -# It caused some sporadic failures on PB2. -# -# This test verifies that when 'STOP SLAVE' is issued by a user, IO -# thread will continue to fetch the rest events of the transaction which -# is being executed by SQL thread and is not able to be rolled back safely. -CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; -CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; -INSERT INTO t1 VALUES(1, 1); -include/sync_slave_sql_with_master.inc -include/stop_slave.inc -[connection master] -include/stop_dump_threads.inc -SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; -[connection slave] -include/start_slave.inc -BEGIN; -UPDATE t1 SET c2 = 2 WHERE c1 = 1; -[connection master] -BEGIN; -INSERT INTO t1 VALUES(2, 2); -INSERT INTO t2 VALUES(1); -UPDATE t1 SET c2 = 3 WHERE c1 = 1; -COMMIT; -[connection slave1] -STOP SLAVE; -[connection slave] -ROLLBACK; -[connection master] -SET DEBUG_SYNC= 'now SIGNAL signal.continue'; -SET DEBUG_SYNC= 'RESET'; -[connection slave] -include/wait_for_slave_to_stop.inc -[connection slave1] -[connection master] -SET GLOBAL debug= '$debug_save'; -include/stop_dump_threads.inc -[connection slave1] -include/start_slave.inc -[connection master] -DROP TABLE t1, t2; include/rpl_end.inc diff --git a/mysql-test/suite/rpl_nogtid/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl_nogtid/r/rpl_temp_table_mix_row.result index 7b52aca7d69..52f30044023 100644 --- a/mysql-test/suite/rpl_nogtid/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl_nogtid/r/rpl_temp_table_mix_row.result @@ -13,7 +13,7 @@ include/sync_slave_sql_with_master.inc ==== Verify results on slave ==== SHOW STATUS LIKE "Slave_open_temp_tables"; Variable_name Value -Slave_open_temp_tables 1 +Slave_open_temp_tables 0 [on master] [on master1] [on slave] @@ -42,7 +42,7 @@ ALTER TABLE t1_tmp ADD COLUMN c INT; include/sync_slave_sql_with_master.inc SHOW STATUS LIKE 'Slave_open_temp_tables'; Variable_name Value -Slave_open_temp_tables 1 +Slave_open_temp_tables 0 DROP TABLE t1_tmp, t2; INSERT INTO t1 VALUES (1); DROP TEMPORARY TABLE t2_tmp; @@ -60,13 +60,10 @@ slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) slave-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES () -slave-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int) -slave-bin.000001 # Query # # use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1_tmp` /* generated by server */ slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) slave-bin.000001 # Xid # # COMMIT /* XID */ slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */ slave-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_create_tmp_table_if_not_exists.test b/mysql-test/suite/rpl_nogtid/t/rpl_create_tmp_table_if_not_exists.test index 0190f3f6820..8af30a7ff0b 100644 --- a/mysql-test/suite/rpl_nogtid/t/rpl_create_tmp_table_if_not_exists.test +++ b/mysql-test/suite/rpl_nogtid/t/rpl_create_tmp_table_if_not_exists.test @@ -24,8 +24,9 @@ --source include/not_group_replication_plugin.inc #CREATE TEMPORARY TABLE statements are not binlogged in row mode, +#nor in mixed mode #So it must be test by itself. -source include/have_binlog_format_mixed_or_statement.inc; +source include/have_binlog_format_statement.inc; source include/master-slave.inc; disable_warnings; diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_drop_temp-slave.opt b/mysql-test/suite/rpl_nogtid/t/rpl_mix_drop_temp-slave.opt similarity index 100% rename from mysql-test/suite/rpl_nogtid/t/rpl_drop_temp-slave.opt rename to mysql-test/suite/rpl_nogtid/t/rpl_mix_drop_temp-slave.opt diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_mix_drop_temp.test b/mysql-test/suite/rpl_nogtid/t/rpl_mix_drop_temp.test new file mode 100644 index 00000000000..12e134f5b47 --- /dev/null +++ b/mysql-test/suite/rpl_nogtid/t/rpl_mix_drop_temp.test @@ -0,0 +1,3 @@ +--source include/have_binlog_format_mixed.inc + +source extra/rpl_tests/rpl_drop_temp.test; diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_mix_innodb.test b/mysql-test/suite/rpl_nogtid/t/rpl_mix_innodb.test new file mode 100644 index 00000000000..0845c8ed619 --- /dev/null +++ b/mysql-test/suite/rpl_nogtid/t/rpl_mix_innodb.test @@ -0,0 +1,10 @@ +# File for specialities regarding replication from or to InnoDB +# tables. + +--source include/not_group_replication_plugin.inc +source include/have_binlog_format_mixed.inc; +# gtids disabled because it tests DROP TEMPORARY inside a transaction +source include/master-slave.inc; + +source extra/rpl_tests/rpl_innodb.test; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_stm_drop_temp-slave.opt b/mysql-test/suite/rpl_nogtid/t/rpl_stm_drop_temp-slave.opt new file mode 100644 index 00000000000..8aa11512a71 --- /dev/null +++ b/mysql-test/suite/rpl_nogtid/t/rpl_stm_drop_temp-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=mysqltest.t2 diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_stm_drop_temp.test b/mysql-test/suite/rpl_nogtid/t/rpl_stm_drop_temp.test new file mode 100644 index 00000000000..d097d2060ea --- /dev/null +++ b/mysql-test/suite/rpl_nogtid/t/rpl_stm_drop_temp.test @@ -0,0 +1,3 @@ +--source include/have_binlog_format_statement.inc + +source extra/rpl_tests/rpl_drop_temp.test; diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_stm_innodb.test b/mysql-test/suite/rpl_nogtid/t/rpl_stm_innodb.test index db12b5f4421..b5d4781cab0 100644 --- a/mysql-test/suite/rpl_nogtid/t/rpl_stm_innodb.test +++ b/mysql-test/suite/rpl_nogtid/t/rpl_stm_innodb.test @@ -2,7 +2,7 @@ # tables. --source include/not_group_replication_plugin.inc -source include/have_binlog_format_mixed_or_statement.inc; +source include/have_binlog_format_statement.inc; # gtids disabled because it tests DROP TEMPORARY inside a transaction source include/master-slave.inc; diff --git a/mysql-test/suite/rpl_nogtid/t/rpl_stop_slave.test b/mysql-test/suite/rpl_nogtid/t/rpl_stop_slave.test index 25dc27dc43f..0470ee06af4 100644 --- a/mysql-test/suite/rpl_nogtid/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl_nogtid/t/rpl_stop_slave.test @@ -6,7 +6,9 @@ source include/master-slave.inc; source include/have_myisam.inc; source include/have_debug.inc; source include/have_debug_sync.inc; -source include/have_binlog_format_mixed_or_statement.inc; +# 72475 renders this case irrelevant for mixed mode as temp tables are no +# longer replicated to the slave. +source include/have_binlog_format_statement.inc; --echo --echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends @@ -59,91 +61,8 @@ connection master; --source include/rpl_connection_master.inc DROP TABLE t1, t2; ---echo ---echo # Bug#58546 test rpl_packet timeout failure sporadically on PB ---echo # ---------------------------------------------------------------------- ---echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was ---echo # possible that IO thread stopped after replicating part of a transaction ---echo # which SQL thread was executing. SQL thread would be hung if the ---echo # transaction could not be rolled back safely. ---echo # It caused some sporadic failures on PB2. ---echo # ---echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO ---echo # thread will continue to fetch the rest events of the transaction which ---echo # is being executed by SQL thread and is not able to be rolled back safely. - -CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; -CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; -INSERT INTO t1 VALUES(1, 1); - ---source include/sync_slave_sql_with_master.inc ---source include/stop_slave.inc - ---source include/rpl_connection_master.inc -# make sure that there are no zombie threads ---source include/stop_dump_threads.inc - -let $debug_save= `SELECT @@GLOBAL.debug`; -SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; - ---source include/rpl_connection_slave.inc ---source include/start_slave.inc - -BEGIN; -UPDATE t1 SET c2 = 2 WHERE c1 = 1; - ---source include/rpl_connection_master.inc -BEGIN; -INSERT INTO t1 VALUES(2, 2); -INSERT INTO t2 VALUES(1); -UPDATE t1 SET c2 = 3 WHERE c1 = 1; -COMMIT; - -# wait for the dump thread reach the sync point ---let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump' ---source include/wait_condition.inc - ---source include/rpl_connection_slave1.inc -let $show_statement= SHOW PROCESSLIST; -let $field= Info; -let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1'; -source include/wait_show_condition.inc; +# Bug#58546 test rpl_packet timeout failure sporadically on PB +# Moved into its own test rpl.rpl_bug58546.test to allow it to continue +# to test both MBR and SBR -send STOP SLAVE; - ---source include/rpl_connection_slave.inc -ROLLBACK; - ---source include/rpl_connection_master.inc - -SET DEBUG_SYNC= 'now SIGNAL signal.continue'; -# wait for the dump thread to come out of the -# waiting phase before resetting the signals ---let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump' ---source include/wait_condition.inc -SET DEBUG_SYNC= 'RESET'; - ---source include/rpl_connection_slave.inc -source include/wait_for_slave_to_stop.inc; - ---source include/rpl_connection_slave1.inc -reap; - -# Slave has stopped, thence lets make sure that -# we kill the zombie dump threads. Also, make -# sure that we disable the DBUG_EXECUTE_IF -# that would set the dump thread to wait ---source include/rpl_connection_master.inc -SET GLOBAL debug= '$debug_save'; -# make sure that there are no zombie threads ---source include/stop_dump_threads.inc - ---source include/rpl_connection_slave1.inc -# now the dump thread on the master will start -# from a clean slate, i.e. without the -# DBUG_EXECUTE_IF set -source include/start_slave.inc; - ---source include/rpl_connection_master.inc -DROP TABLE t1, t2; --source include/rpl_end.inc diff --git a/sql/binlog.cc b/sql/binlog.cc index ebd50ca33b4..8c40e24f016 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -110,6 +110,7 @@ #include "thr_lock.h" #include "transaction_info.h" #include "xa.h" +#include "sql_base.h" class Item; @@ -10274,6 +10275,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) */ bool multi_access_engine= FALSE; /* + 72475 : Track if statement creates or drops a temporary table + and log in ROW if it does. + */ + bool create_drop_temp_table= false; + /* Identifies if a table is changed. */ bool is_write= FALSE; @@ -10364,7 +10370,24 @@ int THD::decide_logging_format(TABLE_LIST *tables) for (TABLE_LIST *table= tables; table; table= table->next_global) { if (table->is_placeholder()) + { + /* + bug 72475 : Detect if this is a CREATE TEMPORARY or DROP of a + temporary table. This will be used later in determining whether to + log in ROW or STMT if MIXED replication is being used. + */ + if (!create_drop_temp_table && + !table->table && + ((lex->sql_command == SQLCOM_CREATE_TABLE && + (lex->create_info->options & HA_LEX_CREATE_TMP_TABLE)) || + ((lex->sql_command == SQLCOM_DROP_TABLE || + lex->sql_command == SQLCOM_TRUNCATE) && + find_temporary_table(this, table)))) + { + create_drop_temp_table= true; + } continue; + } handler::Table_flags const flags= table->table->file->ha_table_flags(); @@ -10484,7 +10507,8 @@ int THD::decide_logging_format(TABLE_LIST *tables) if (lex->sql_command != SQLCOM_CREATE_TABLE || (lex->sql_command == SQLCOM_CREATE_TABLE && - (lex->create_info->options & HA_LEX_CREATE_TMP_TABLE))) + ((lex->create_info->options & HA_LEX_CREATE_TMP_TABLE) || + (table->lock_descriptor().type < TL_WRITE_ALLOW_WRITE)))) { if (table->table->s->tmp_table) lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TEMP_TRANS_TABLE : @@ -10520,7 +10544,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) int error= 0; int unsafe_flags; - bool multi_stmt_trans= in_multi_stmt_transaction_mode(); + // With transactional data dictionary, CREATE TABLE runs as one statement + // in a multi-statement transaction internally. Revert this for the + // purposes of determining mixed statement safety. + const auto multi_stmt_trans= lex->sql_command != SQLCOM_CREATE_TABLE + && in_multi_stmt_transaction_mode(); bool trans_table= trans_has_updated_trans_table(this); bool binlog_direct= variables.binlog_direct_non_trans_update; @@ -10633,7 +10661,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) else { if (lex->is_stmt_unsafe() || lex->is_stmt_row_injection() - || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0) + || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0 + || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0 + || lex->stmt_accessed_table(LEX::STMT_READS_TEMP_TRANS_TABLE) + || lex->stmt_accessed_table(LEX::STMT_READS_TEMP_NON_TRANS_TABLE) + || create_drop_temp_table) { #ifndef DBUG_OFF int flags= lex->get_stmt_unsafe_flags(); diff --git a/sql/sql_class.h b/sql/sql_class.h index 7bd0b685d6d..b604fc6c550 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3080,30 +3080,15 @@ public: inline void reset_current_stmt_binlog_format_row() { DBUG_ENTER("reset_current_stmt_binlog_format_row"); - /* - If there are temporary tables, don't reset back to - statement-based. Indeed it could be that: - CREATE TEMPORARY TABLE t SELECT UUID(); # row-based - # and row-based does not store updates to temp tables - # in the binlog. - INSERT INTO u SELECT * FROM t; # stmt-based - and then the INSERT will fail as data inserted into t was not logged. - So we continue with row-based until the temp table is dropped. - If we are in a stored function or trigger, we mustn't reset in the - middle of its execution (as the binary logging way of a stored function - or trigger is decided when it starts executing, depending for example on - the caller (for a stored function: if caller is SELECT or - INSERT/UPDATE/DELETE...). - */ DBUG_PRINT("debug", - ("temporary_tables: %d, in_sub_stmt: %d, system_thread: %s", - temporary_tables != NULL, in_sub_stmt != 0, + ("in_sub_stmt: %d, system_thread: %s", + in_sub_stmt != 0, show_system_thread(system_thread))); if (in_sub_stmt == 0) { if (variables.binlog_format == BINLOG_FORMAT_ROW) set_current_stmt_binlog_format_row(); - else if (temporary_tables == NULL) + else clear_current_stmt_binlog_format_row(); } DBUG_VOID_RETURN; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8ced5d71916..e8b67b9eee8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2587,6 +2587,15 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists, DBUG_RETURN(true); } + /* + bug 72475 : DROP tables need to have their logging format determined if + in MIXED mode and dropping a TEMP table. + */ + if (thd->decide_logging_format(tables)) + { + DBUG_RETURN(true); + } + /* Disable drop of enabled log tables, must be done before name locking */ for (table= tables; table; table= table->next_local) { @@ -7701,7 +7710,9 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, To check the existence of table, lock of type "S" is obtained on the table and then it is upgraded to "X" if table does not exists. */ - if (open_tables(thd, &thd->lex->query_tables, ¬_used, 0)) + + if (open_tables(thd, &thd->lex->query_tables, ¬_used, 0) || + thd->decide_logging_format(thd->lex->query_tables)) { result= true; goto end; @@ -8106,8 +8117,12 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, that we can safely perform table creation. Thus by holding both these locks we ensure that our statement is properly isolated from all concurrent operations which matter. + + bug 72475 : CREATE LIKE needs to have the logging format determined if in + MIXED mode and creating LIKE a TEMP table. */ - if (open_tables(thd, &thd->lex->query_tables, ¬_used, 0)) + if (open_tables(thd, &thd->lex->query_tables, ¬_used, 0) || + thd->decide_logging_format(thd->lex->query_tables)) DBUG_RETURN(true); src_table->table->use_all_columns(); diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index c7dafe4a29b..ffd4e8a722c 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -502,6 +502,12 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref) if (is_temporary) { TABLE *tmp_table= table_ref->table; + /* + bug 72475 : THD::decide_logging_format has not yet been called and may + not be called at all depending on the engine, so call it here. + */ + if (thd->decide_logging_format(table_ref) != 0) + DBUG_RETURN(true); /* In RBR, the statement is not binlogged if the table is temporary. */ binlog_stmt= !thd->is_current_stmt_binlog_format_row();