commit 0e3256ebb6236ce15c0a776a6947c923f000b6c4 Author: George O. Lorch III Date: Sat Oct 25 12:38:48 2014 -0700 Fix bug 72475 (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 1436e14..5760197 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -20,6 +20,7 @@ CREATE TEMPORARY TABLE shortn2 (a INT); # In RBR, 'DROP TEMPORARY TABLE ...' statement should never be binlogged no # matter if the tables exist or not. In contrast, both in SBR and MBR, the # statement should be always binlogged no matter if the tables exist or not. +# In MBR though, it will always be binlogged with IF EXISTS. ############################################################################## CREATE TEMPORARY TABLE tmp(c1 int); CREATE TEMPORARY TABLE tmp1(c1 int); diff --git a/mysql-test/extra/binlog_tests/tmp_table.test b/mysql-test/extra/binlog_tests/tmp_table.test new file mode 100644 index 0000000..ee488b8 --- /dev/null +++ b/mysql-test/extra/binlog_tests/tmp_table.test @@ -0,0 +1,164 @@ + +# ==== Purpose ==== +# +# Test if statements used temporary tables are binlogged correctly +# +# ==== Method ==== +# +# Use two connections, use temporary tables on both of them, and by +# switching connections between statements, the test can check if the +# statements are logged with the correct thread id. +# +# The statements current tested include: +# CREATE TEMPORARY TABLE +# CREATE TEMPORARY TABLE LIKE +# INSERT +# REPLACE +# UPDATE +# INSERT SELECT +# TRUNCATE +# +# Note: When adding new query statements, please add them between the +# two 'flush logs'. And aslo please make sure the connection is +# switched between each statement. +# +# ==== Related bugs ==== +# +# BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used +# +source include/have_log_bin.inc; + +RESET MASTER; + +--disable_query_log +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +--enable_query_log + +connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); + +create table foo (a int); + +flush logs; + +connection master; +create temporary table tmp1_foo like foo; +connection master1; +create temporary table tmp2_foo (a int); + +connection master; +insert into tmp1_foo values (1), (2), (3), (4); +connection master1; +replace into tmp2_foo values (1), (2), (3), (4); + +connection master; +update tmp1_foo set a=2*a-1; +connection master1; +update tmp2_foo set a=2*a; + +connection master; +delete from tmp1_foo where a < 5; +connection master1; +delete from tmp2_foo where a < 5; + +--disable_warnings +connection master; +insert into foo select * from tmp1_foo; +connection master1; +insert into foo select * from tmp2_foo; +--enable_warnings + +connection master; +truncate table tmp1_foo; +connection master1; +truncate table tmp2_foo; + +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); + +flush logs; + +connection default; +select * from foo; + +# prepare for the replay +drop table foo; +create table foo (a int); + +# replay from binary log +let $MYSQLD_DATADIR= `select @@datadir`; +copy_file $MYSQLD_DATADIR/$binlog_file $MYSQLD_DATADIR/master-bin.saved35583; +# Reset GTIDs +RESET MASTER; +exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved35583 | $MYSQL; +select * from foo; + +# clean up +drop table foo; + +################################################################# +# BUG#51226 +################################################################# + +RESET MASTER; + +-- let $dbname=b51226 + +connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); + +# +# action: on con1 create the database and the tmp table +# +-- connection con1 +-- eval create database $dbname +-- eval use $dbname +create temporary table t1(i int); + +# +# action: on con1 create the tmp table +# +-- connection con2 +-- eval use $dbname +create temporary table t1(i int); + +# action: at this point, the last event binlogged contains the +# pseudo_thread_id from con2. So now we switch to con1, issue +# a statement that fails and close the connection (which logs +# implicitely a DROP TEMPORARY TABLE). +# +# Before the patch this would not log con1's pseudo_thread_id +# because the failing statement would reset THD context +# (unsetting the thread_specific_used flag, and consequently, +# causing the DROP event to be logged without pseudo_thread_id +# in its header). + +-- connection con1 +-- error 1050 +create temporary table t1(i int); +-- disconnect con1 + +-- connection default +-- let $wait_binlog_event= DROP +-- source include/wait_for_binlog_event.inc + +# action: insert in the t1. This would cause the the test to fail, +# because when replaying the binlog the previous implicit drop +# temp table would have been executed under the wrong +# pseudo_thread_id, dropping the tmp table on con2. +-- connection con2 +insert into t1 values(1); +-- disconnect con2 + +-- connection default +-- let $wait_binlog_event= DROP +-- source include/wait_for_binlog_event.inc + +-- eval DROP DATABASE $dbname +FLUSH LOGS; +-- let $MYSQLD_DATADIR= `select @@datadir` +copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.saved51226; +# Reset GTIDs +RESET MASTER; +# assertion: assert that when replaying the binary log will succeed, +# instead of failing with "Table 'XXX.YYY' doesn't exist" +-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved51226 | $MYSQL diff --git a/mysql-test/extra/rpl_tests/rpl_drop_temp.test b/mysql-test/extra/rpl_tests/rpl_drop_temp.test new file mode 100644 index 0000000..9dcd5a1 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_drop_temp.test @@ -0,0 +1,94 @@ +############################################## +# Change Author: JBM +# Change Date: 2006-02-07 +# Change: Added ENGINE=MyISAM +# Purpose: According to TU in 16552 This is how +# to work around NDB's issue with temp tables +############################################## + +--disable_warnings +create database if not exists mysqltest; +--enable_warnings + +connect (con_temp,127.0.0.1,root,,test,$MASTER_MYPORT,); + +connection con_temp; +use mysqltest; +create temporary table mysqltest.t1 (n int)ENGINE=MyISAM; +create temporary table mysqltest.t2 (n int)ENGINE=MyISAM; + +disconnect con_temp; +--source include/wait_until_disconnected.inc + +connection master; +-- let $wait_binlog_event= DROP +-- source include/wait_for_binlog_event.inc +sync_slave_with_master; + +connection slave; +show status like 'Slave_open_temp_tables'; +# Cleanup +connection master; +drop database mysqltest; +sync_slave_with_master; + +# +# Bug#49137 +# This test verifies if DROP MULTI TEMPORARY TABLE +# will cause different errors on master and slave, +# when one or more of these tables do not exist. +# + +connection master; +DROP TEMPORARY TABLE IF EXISTS tmp1; +CREATE TEMPORARY TABLE t1 ( a int ); +--error 1051 +DROP TEMPORARY TABLE t1, t2; +--error 1051 +DROP TEMPORARY TABLE tmp2; +sync_slave_with_master; + +connection slave; +stop slave; +wait_for_slave_to_stop; + +--echo **** On Master **** +connection master; +CREATE TEMPORARY TABLE tmp3 (a int); +DROP TEMPORARY TABLE tmp3; + +connection slave; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; + +connection master; +sync_slave_with_master; + + +# +# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW +# + +--source include/rpl_reset.inc +--connection master + +CREATE TABLE t1 ( i INT ); +--sync_slave_with_master +SHOW STATUS LIKE 'Slave_open_temp_tables'; + +--connect(con1,localhost,root,,) +CREATE TEMPORARY TABLE ttmp1 ( i INT ); +SET SESSION binlog_format=ROW; +--disconnect con1 + +-- connection master +--let $wait_binlog_event= DROP +--source include/wait_for_binlog_event.inc +--sync_slave_with_master +SHOW STATUS LIKE 'Slave_open_temp_tables'; + +--connection master +--source include/show_binlog_events.inc +DROP TABLE t1; + +# End of 4.1 tests 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 ed814f7..9285ca7 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -367,7 +367,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: BEGIN @@ -383,10 +383,21 @@ while ($ddl_cases >= 1) # 3: ROW EVENT # 4: COMMIT # - if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'` ) + # In MIXED mode, the DDL statement is not written to the binary log and + # does not commit the current transaction. + # + # 1: BEGIN + # 2: INSERT + # 3: COMMIT + # + if (`select @@binlog_format = 'STATEMENT'` ) { let $commit_event_row_number= 4; } + if (`select @@binlog_format = 'MIXED'` ) + { + let $commit_event_row_number= 3; + } # # In NDB (RBR mode), the commit event is the sixth event # in the binary log: @@ -428,14 +439,15 @@ while ($ddl_cases >= 1) # In MIXED mode, the changes are logged as rows and we have what follows: # # 1: BEGIN - # 2: TABLE MAP EVENT - # 3: ROW EVENT - # 4: COMMIT - # 5: DDL EVENT which triggered the previous commmit. + # 2: ROW EVENT + # 3: COMMIT # if (`select @@binlog_format = 'MIXED'`) { - let $commit_event_row_number= 4; + # 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= 3; } # # In NDB (RBR and MIXED modes), the commit event is the sixth event @@ -460,14 +472,15 @@ while ($ddl_cases >= 1) # In MIXED mode, the changes are logged as rows and we have what follows: # # 1: BEGIN - # 2: TABLE MAP EVENT - # 3: ROW EVENT - # 4: COMMIT - # 5: DDL EVENT which triggered the previous commmit. + # 2: ROW EVENT + # 3: COMMIT # if (`select @@binlog_format = 'MIXED'`) { - let $commit_event_row_number= 4; + # 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= 3; } # # In NDB (RBR and MIXED modes), the commit event is the sixth event @@ -512,7 +525,7 @@ while ($ddl_cases >= 1) { let $commit_event_row_number= 4; } - # 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: BEGIN # 2: TABLE MAP EVENT @@ -520,10 +533,22 @@ while ($ddl_cases >= 1) # 4: DROP TEMPORARY table IF EXISTS # 5: COMMIT # - if (`select @@binlog_format = 'MIXED' || @@binlog_format = 'ROW'`) + if (`select @@binlog_format = 'ROW'`) { let $commit_event_row_number= 5; } + # In MIXED mode, the changes are logged as rows and we have what follows: + # + # 1: BEGIN + # 2: ROW EVENT + # 3: DROP TEMPORARY table IF EXISTS + # 4: COMMIT + # + if (`select @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 4; + } + # # 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 5325bbf..ea05ad0 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/extra/rpl_tests/rpl_rewrt_db.test b/mysql-test/extra/rpl_tests/rpl_rewrt_db.test new file mode 100644 index 0000000..a7bee39 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_rewrt_db.test @@ -0,0 +1,255 @@ + +# TBF - difference in row level logging + +--disable_warnings +drop database if exists mysqltest1; +--enable_warnings +create database mysqltest1; + +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +--source include/sync_slave_sql_with_master.inc +show databases like 'mysqltest1'; # should be empty +select * from test.t1; +# cleanup +connection master; +drop table t1; +drop database mysqltest1; +--source include/sync_slave_sql_with_master.inc + +# +# BUG#6353: +# Option --replicate-rewrite-db should work together with LOAD DATA INFILE +# + +connection slave; +--disable_warnings +drop database if exists rewrite; +--enable_warnings +create database rewrite; + +connection master; +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 ','; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +--source include/sync_slave_sql_with_master.inc + +connection slave; +select * from rewrite.t1; + +connection master; +truncate table t1; +load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +--source include/sync_slave_sql_with_master.inc + +connection slave; +select * from rewrite.t1; + +connection master; +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 ''''; +--source include/sync_slave_sql_with_master.inc + +connection slave; +select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; + +connection master; +drop table t1; +create table t1 (a int, b char(10)); +load data infile '../../std_data/loaddata3.dat' ignore into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +--source include/sync_slave_sql_with_master.inc + +connection slave; +select * from rewrite.t1; + +connection master; +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; +--source include/sync_slave_sql_with_master.inc + +connection slave; +# The empty line last comes from the end line field in the file +select * from rewrite.t1; + +set sql_log_bin= 0; +drop database rewrite; +set sql_log_bin= 1; + +connection master; +set sql_log_bin= 0; +drop table t1; +set sql_log_bin= 1; + +# End of 4.1 tests + +--echo +--echo **** +--echo **** Bug #46861 Auto-closing of temporary tables broken by replicate-rewrite-db +--echo **** +--echo + +--echo **** +--echo **** Preparing the environment +--echo **** +connection master; + +connect (con_temp_03,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (con_temp_02,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (con_temp_01,127.0.0.1,root,,test,$MASTER_MYPORT,); + +connection master; +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; + +connection slave; +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; + +--echo +--echo **** +--echo **** Creating temporary tables on different databases with different connections +--echo **** +--echo **** con_temp_01 --> creates +--echo **** t_01_01_temp on database_master_temp_01 +--echo **** +--echo **** con_temp_02 --> creates +--echo **** t_01_01_temp on database_master_temp_01 +--echo **** t_02_01_temp, t_02_02_temp on database_master_temp_02 +--echo **** +--echo **** con_temp_03 --> creates +--echo **** t_01_01_temp on database_master_temp_01 +--echo **** t_02_01_temp, t_02_02_temp on database_master_temp_02 +--echo **** t_03_01_temp, t_03_02_temp, t_03_03_temp on database_master_temp_03 +--echo **** + +--echo +--echo con_temp_01 +--echo +connection 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); + +--echo +--echo con_temp_02 +--echo +connection 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); + +--echo +--echo con_temp_03 +--echo +connection 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); + +--echo +--echo **** Dropping the connections +--echo **** To be sure that the DROP statements have been logged, we make +--echo **** sure that the number of open temporary tables at slave becomes +--echo **** zero. If not,the test will time out. +--echo +connection master; +--source include/sync_slave_sql_with_master.inc +connection slave; +show status like 'Slave_open_temp_tables'; + +connection master; +flush logs; + +connection con_temp_01; +disconnect con_temp_01; +--source include/wait_until_disconnected.inc + +connection con_temp_02; +disconnect con_temp_02; +--source include/wait_until_disconnected.inc + +connection con_temp_03; +disconnect con_temp_03; +--source include/wait_until_disconnected.inc + +--echo +--echo **** Wait until number of open temporary tables at slave becomes zero +--echo +connection slave; +--let $status_var= Slave_open_temp_tables +--let $status_var_value= 0 +# The below include file accepts time in units of tenths of seconds. +# Hence 3 minutes = 1800. +--let $status_timeout= 1800 +--source include/wait_for_status_var.inc + +--echo +--echo **** Check if every drop temporary table command is prepended with "use" +--echo +connection master; +--let $current_binlog_file= query_get_value(SHOW MASTER STATUS,File,1) +--let $count_drop= 0 +--let $event_number= 1 +--let $binlog_event= query_get_value(SHOW BINLOG EVENTS IN '$current_binlog_file', Info, $event_number) +while($binlog_event != No such row) +{ + if(`SELECT INSTR("$binlog_event", "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS") AND INSTR("$binlog_event", "use") <> 0`) + { + --inc $count_drop + } + --inc $event_number + --let $binlog_event=query_get_value(SHOW BINLOG EVENTS IN '$current_binlog_file', Info, $event_number) +} + +--let $assert_cond= $count_drop= 6 +--let $assert_text= The number of drop temporary table events in binlog should be 6 +--source include/assert.inc + +--echo **** +--echo **** Cleaning up the test case +--echo **** +connection master; +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; + +connection slave; +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; + +connection master; +--source include/sync_slave_sql_with_master.inc + +# end of 5.0 tests diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index f315aaa..a763e8b 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -111,7 +111,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) @@ -120,7 +119,7 @@ master-bin.000001 # Query # # drop database if exists mysqltest1 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 TEMPORARY TABLE `tt1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; 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 f886ccb..0000000 --- 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 0000000..50e2fd1 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result @@ -0,0 +1,56 @@ +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 # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1`,`drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp3` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* 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 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; diff --git a/mysql-test/suite/binlog/r/binlog_mix_tmp_table.result b/mysql-test/suite/binlog/r/binlog_mix_tmp_table.result new file mode 100644 index 0000000..2d557b7 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mix_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_row_tmp_table.result b/mysql-test/suite/binlog/r/binlog_row_tmp_table.result new file mode 100644 index 0000000..2d557b7 --- /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_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index aab668c..819ffd8 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/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 # # DROP TEMPORARY TABLE IF EXISTS `bug39182`.`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 +) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; INSERT IGNORE INTO user SET host='localhost', user='@#@', password=password('Just a test') master-bin.000001 # Query # # COMMIT 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 0000000..2d557b7 --- /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/r/binlog_tmp_table.result b/mysql-test/suite/binlog/r/binlog_tmp_table.result deleted file mode 100644 index 2d557b7..0000000 --- a/mysql-test/suite/binlog/r/binlog_tmp_table.result +++ /dev/null @@ -1,44 +0,0 @@ -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 698e610..0000000 --- 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 0000000..51c6af9 --- /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 0000000..a91fba1 --- /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 0000000..be726bb --- /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 6c49aba..7ab0f59 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 0000000..69f6da3 --- /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/t/binlog_tmp_table.test b/mysql-test/suite/binlog/t/binlog_tmp_table.test deleted file mode 100644 index 67aa1a1..0000000 --- a/mysql-test/suite/binlog/t/binlog_tmp_table.test +++ /dev/null @@ -1,165 +0,0 @@ - -# ==== Purpose ==== -# -# Test if statements used temporary tables are binlogged correctly -# -# ==== Method ==== -# -# Use two connections, use temporary tables on both of them, and by -# switching connections between statements, the test can check if the -# statements are logged with the correct thread id. -# -# The statements current tested include: -# CREATE TEMPORARY TABLE -# CREATE TEMPORARY TABLE LIKE -# INSERT -# REPLACE -# UPDATE -# INSERT SELECT -# TRUNCATE -# -# Note: When adding new query statements, please add them between the -# two 'flush logs'. And aslo please make sure the connection is -# switched between each statement. -# -# ==== Related bugs ==== -# -# 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; - ---disable_query_log -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); -connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); - -create table foo (a int); - -flush logs; - -connection master; -create temporary table tmp1_foo like foo; -connection master1; -create temporary table tmp2_foo (a int); - -connection master; -insert into tmp1_foo values (1), (2), (3), (4); -connection master1; -replace into tmp2_foo values (1), (2), (3), (4); - -connection master; -update tmp1_foo set a=2*a-1; -connection master1; -update tmp2_foo set a=2*a; - -connection master; -delete from tmp1_foo where a < 5; -connection master1; -delete from tmp2_foo where a < 5; - ---disable_warnings -connection master; -insert into foo select * from tmp1_foo; -connection master1; -insert into foo select * from tmp2_foo; ---enable_warnings - -connection master; -truncate table tmp1_foo; -connection master1; -truncate table tmp2_foo; - -let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); - -flush logs; - -connection default; -select * from foo; - -# prepare for the replay -drop table foo; -create table foo (a int); - -# replay from binary log -let $MYSQLD_DATADIR= `select @@datadir`; -copy_file $MYSQLD_DATADIR/$binlog_file $MYSQLD_DATADIR/master-bin.saved35583; -# Reset GTIDs -RESET MASTER; -exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved35583 | $MYSQL; -select * from foo; - -# clean up -drop table foo; - -################################################################# -# BUG#51226 -################################################################# - -RESET MASTER; - --- let $dbname=b51226 - -connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); -connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); - -# -# action: on con1 create the database and the tmp table -# --- connection con1 --- eval create database $dbname --- eval use $dbname -create temporary table t1(i int); - -# -# action: on con1 create the tmp table -# --- connection con2 --- eval use $dbname -create temporary table t1(i int); - -# action: at this point, the last event binlogged contains the -# pseudo_thread_id from con2. So now we switch to con1, issue -# a statement that fails and close the connection (which logs -# implicitely a DROP TEMPORARY TABLE). -# -# Before the patch this would not log con1's pseudo_thread_id -# because the failing statement would reset THD context -# (unsetting the thread_specific_used flag, and consequently, -# causing the DROP event to be logged without pseudo_thread_id -# in its header). - --- connection con1 --- error 1050 -create temporary table t1(i int); --- disconnect con1 - --- connection default --- let $wait_binlog_event= DROP --- source include/wait_for_binlog_event.inc - -# action: insert in the t1. This would cause the the test to fail, -# because when replaying the binlog the previous implicit drop -# temp table would have been executed under the wrong -# pseudo_thread_id, dropping the tmp table on con2. --- connection con2 -insert into t1 values(1); --- disconnect con2 - --- connection default --- let $wait_binlog_event= DROP --- source include/wait_for_binlog_event.inc - --- eval DROP DATABASE $dbname -FLUSH LOGS; --- let $MYSQLD_DATADIR= `select @@datadir` -copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.saved51226; -# Reset GTIDs -RESET MASTER; -# assertion: assert that when replaying the binary log will succeed, -# instead of failing with "Table 'XXX.YYY' doesn't exist" --- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved51226 | $MYSQL 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 0000000..5f3276b --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_bug58546.result @@ -0,0 +1,47 @@ +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); +[connection master] +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; +[connection slave] +include/restart_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] +include/start_slave.inc +[connection master] +DROP TABLE t1, t2; +SET GLOBAL debug= $debug_save; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result deleted file mode 100644 index aaca3d9..0000000 --- a/mysql-test/suite/rpl/r/rpl_drop_temp.result +++ /dev/null @@ -1,44 +0,0 @@ -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' -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`; CREATE TEMPORARY TABLE ttmp1 ( 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/r/rpl_gtid_empty_transaction.result b/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result index dad16f7..1c23f55 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_drop_temp.result b/mysql-test/suite/rpl/r/rpl_mix_drop_temp.result new file mode 100644 index 0000000..83768cc --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mix_drop_temp.result @@ -0,0 +1,43 @@ +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' +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/r/rpl_mix_innodb.result b/mysql-test/suite/rpl/r/rpl_mix_innodb.result new file mode 100644 index 0000000..1edf66a --- /dev/null +++ b/mysql-test/suite/rpl/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=latin1 +-------- 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=latin1 +######### 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/r/rpl_mix_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result new file mode 100644 index 0000000..81e2939 --- /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)); +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_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result index 528acd5..6b503c6 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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'; @@ -100,7 +100,7 @@ ERROR 42S02: Unknown table 'test.tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-If-TXe-Temp'; @@ -119,7 +119,7 @@ ERROR 42S02: Unknown table 'test.tt_1' -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'Drop-Temp-If-NXe-Temp'; @@ -137,8 +137,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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'; @@ -146,7 +146,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`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'; @@ -154,7 +154,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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- @@ -171,7 +171,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -190,8 +190,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -204,7 +204,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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) @@ -222,13 +222,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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) @@ -320,7 +320,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -341,8 +341,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -396,7 +396,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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) @@ -416,13 +416,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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) @@ -484,11 +484,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -503,18 +503,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -528,7 +528,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`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- @@ -546,7 +546,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`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- @@ -559,7 +559,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -576,7 +576,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -598,7 +598,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -623,7 +623,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -645,7 +645,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -674,7 +674,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -696,8 +696,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -712,7 +712,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -730,13 +730,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -827,7 +827,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -851,8 +851,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -913,7 +913,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -933,13 +933,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- @@ -999,11 +999,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1021,18 +1021,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1048,7 +1048,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`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- @@ -1069,7 +1069,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`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- @@ -1084,7 +1084,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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- @@ -1101,7 +1101,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -1123,7 +1123,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -1148,7 +1148,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -1170,7 +1170,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) @@ -1287,8 +1287,8 @@ DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; -b-b-b-b-b-b-b-b-b-b-b- >> Drop-N-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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `nt_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- @@ -1297,8 +1297,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1466,8 +1466,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `nt_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- @@ -1481,8 +1481,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- ######################################################################### @@ -1500,10 +1500,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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'; @@ -1514,10 +1513,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1536,16 +1534,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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) @@ -1563,10 +1558,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1586,10 +1580,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1606,10 +1599,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1629,10 +1621,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1655,16 +1646,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1682,10 +1670,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1709,10 +1696,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1732,10 +1718,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1759,10 +1744,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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- @@ -1787,13 +1771,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- @@ -1811,9 +1790,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 */ @@ -1830,8 +1806,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- @@ -1846,8 +1821,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- @@ -1864,12 +1838,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- @@ -1886,8 +1858,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- @@ -1904,12 +1875,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- @@ -1931,8 +1900,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) @@ -1953,8 +1921,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- @@ -1971,8 +1938,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- @@ -1989,8 +1955,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- @@ -2009,12 +1974,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- @@ -2033,8 +1996,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- @@ -2053,12 +2015,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/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index bf4789c..641f8f4 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -450,7 +450,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- @@ -462,8 +461,7 @@ ALTER TABLE tt_xx ADD COLUMN (b int); 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- @@ -475,8 +473,7 @@ ALTER TABLE tt_xx RENAME new_tt_xx; 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- @@ -488,8 +485,7 @@ DROP TEMPORARY TABLE IF EXISTS new_tt_xx; 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`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/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index cef2b2e..3c4a38b 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -12403,19 +12403,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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(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] @@ -12463,25 +12453,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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(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] @@ -12519,21 +12493,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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(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] @@ -12576,11 +12538,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. 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`; 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- include/show_binlog_events.inc @@ -12588,10 +12545,6 @@ Log_name Pos Event_type Server_id End_log_pos Info 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 # 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] @@ -12625,19 +12578,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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`; 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] @@ -12680,11 +12623,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. 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`; 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- include/show_binlog_events.inc @@ -12692,10 +12630,6 @@ Log_name Pos Event_type Server_id End_log_pos Info 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 # 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/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result index cd79be2..81816a3 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result @@ -12775,19 +12775,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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(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] @@ -12835,25 +12825,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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(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] @@ -12891,21 +12865,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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(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] @@ -12948,11 +12910,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. 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`; 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- include/show_binlog_events.inc @@ -12960,10 +12917,6 @@ Log_name Pos Event_type Server_id End_log_pos Info 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 # 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] @@ -12997,19 +12950,9 @@ ROLLBACK; Warnings: Warning # The creation of some temporary tables could not 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 # 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- 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`; 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] @@ -13052,11 +12995,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. 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`; 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- include/show_binlog_events.inc @@ -13064,10 +13002,6 @@ Log_name Pos Event_type Server_id End_log_pos Info 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 # 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/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result deleted file mode 100644 index 7fe4722..0000000 --- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result +++ /dev/null @@ -1,208 +0,0 @@ -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)); -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 10 -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_stm_drop_temp.result b/mysql-test/suite/rpl/r/rpl_stm_drop_temp.result new file mode 100644 index 0000000..aaca3d9 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_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' +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`; CREATE TEMPORARY TABLE ttmp1 ( 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/r/rpl_stm_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result index 6c3a53e..d0b2ea4 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_innodb.result +++ b/mysql-test/suite/rpl/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/r/rpl_stm_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_stm_rewrt_db.result new file mode 100644 index 0000000..7fe4722 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_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)); +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 10 +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_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index 0db4a0d..8253534 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/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/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index 7275601..63e627d 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl/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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */ slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2_tmp` /* generated by server */ slave-bin.000001 # Query # # BEGIN 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 0000000..f5c0019 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug58546.test @@ -0,0 +1,69 @@ +source include/master-slave.inc; +source include/have_innodb.inc; +source include/have_debug.inc; +source include/have_debug_sync.inc; +source include/have_binlog_format_mixed_or_statement.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); + +sync_slave_with_master; + +--source include/rpl_connection_master.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/restart_slave_sql.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; + +--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'; +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; +source include/start_slave.inc; + +--source include/rpl_connection_master.inc +DROP TABLE t1, t2; +SET GLOBAL debug= $debug_save; +--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 93c838c..1e67516 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_create_tmp_table_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test index 6de20b0..61451f6 100644 --- a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test +++ b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test @@ -24,8 +24,9 @@ source include/master-slave.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/not_gtid_enabled.inc; disable_warnings; diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt b/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt deleted file mode 100644 index 2f9244c..0000000 --- a/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt +++ /dev/null @@ -1,2 +0,0 @@ ---replicate-ignore-table=mysqltest.t2 - diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test deleted file mode 100644 index 1e2c9dd..0000000 --- a/mysql-test/suite/rpl/t/rpl_drop_temp.test +++ /dev/null @@ -1,99 +0,0 @@ -############################################## -# Change Author: JBM -# Change Date: 2006-02-07 -# Change: Added ENGINE=MyISAM -# Purpose: According to TU in 16552 This is how -# to work around NDB's issue with temp tables -############################################## ---source include/not_gtid_enabled.inc -source include/master-slave.inc; -source include/have_myisam.inc; -source include/have_binlog_format_mixed_or_statement.inc; - ---disable_warnings -create database if not exists mysqltest; ---enable_warnings - -connect (con_temp,127.0.0.1,root,,test,$MASTER_MYPORT,); - -connection con_temp; -use mysqltest; -create temporary table mysqltest.t1 (n int)ENGINE=MyISAM; -create temporary table mysqltest.t2 (n int)ENGINE=MyISAM; - -disconnect con_temp; ---source include/wait_until_disconnected.inc - -connection master; --- let $wait_binlog_event= DROP --- source include/wait_for_binlog_event.inc -sync_slave_with_master; - -connection slave; -show status like 'Slave_open_temp_tables'; -# Cleanup -connection master; -drop database mysqltest; -sync_slave_with_master; - -# -# Bug#49137 -# This test verifies if DROP MULTI TEMPORARY TABLE -# will cause different errors on master and slave, -# when one or more of these tables do not exist. -# - -connection master; -DROP TEMPORARY TABLE IF EXISTS tmp1; -CREATE TEMPORARY TABLE t1 ( a int ); ---error 1051 -DROP TEMPORARY TABLE t1, t2; ---error 1051 -DROP TEMPORARY TABLE tmp2; -sync_slave_with_master; - -connection slave; -stop slave; -wait_for_slave_to_stop; - ---echo **** On Master **** -connection master; -CREATE TEMPORARY TABLE tmp3 (a int); -DROP TEMPORARY TABLE tmp3; - -connection slave; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; - -connection master; -sync_slave_with_master; - - -# -# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW -# - ---source include/rpl_reset.inc ---connection master - -CREATE TABLE t1 ( i INT ); ---sync_slave_with_master -SHOW STATUS LIKE 'Slave_open_temp_tables'; - ---connect(con1,localhost,root,,) -CREATE TEMPORARY TABLE ttmp1 ( i INT ); -SET SESSION binlog_format=ROW; ---disconnect con1 - --- connection master ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc ---sync_slave_with_master -SHOW STATUS LIKE 'Slave_open_temp_tables'; - ---connection master ---source include/show_binlog_events.inc -DROP TABLE t1; - -# End of 4.1 tests ---source include/rpl_end.inc 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 7663e0b..bc11cd3 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test @@ -91,8 +91,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. @@ -181,8 +181,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_mix_drop_temp-slave.opt b/mysql-test/suite/rpl/t/rpl_mix_drop_temp-slave.opt new file mode 100644 index 0000000..8aa1151 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_drop_temp-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=mysqltest.t2 diff --git a/mysql-test/suite/rpl/t/rpl_mix_drop_temp.test b/mysql-test/suite/rpl/t/rpl_mix_drop_temp.test new file mode 100644 index 0000000..bb5c67f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_drop_temp.test @@ -0,0 +1,8 @@ +source include/not_gtid_enabled.inc; +source include/master-slave.inc; +source include/have_myisam.inc; +source include/have_binlog_format_mixed.inc; + +source extra/rpl_tests/rpl_drop_temp.test; + +source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_mix_innodb.test b/mysql-test/suite/rpl/t/rpl_mix_innodb.test new file mode 100644 index 0000000..4cc3f6b --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_innodb.test @@ -0,0 +1,11 @@ +# File for specialities regarding replication from or to InnoDB +# tables. + +source include/master-slave.inc; +source include/have_innodb.inc; +source include/have_binlog_format_mixed.inc; +# gtids disabled because it tests DROP TEMPORARY inside a transaction +source include/not_gtid_enabled.inc; + +source extra/rpl_tests/rpl_innodb.test; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt new file mode 100644 index 0000000..290b92e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_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_mix_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test new file mode 100644 index 0000000..7853f21 --- /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_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt deleted file mode 100644 index 290b92e..0000000 --- a/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt +++ /dev/null @@ -1 +0,0 @@ -"--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_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test deleted file mode 100644 index 1fb26a8..0000000 --- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test +++ /dev/null @@ -1,257 +0,0 @@ -# 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; ---enable_warnings -create database mysqltest1; - -use mysqltest1; -create table t1 (a int); -insert into t1 values(9); -select * from mysqltest1.t1; ---source include/sync_slave_sql_with_master.inc -show databases like 'mysqltest1'; # should be empty -select * from test.t1; -# cleanup -connection master; -drop table t1; -drop database mysqltest1; ---source include/sync_slave_sql_with_master.inc - -# -# BUG#6353: -# Option --replicate-rewrite-db should work together with LOAD DATA INFILE -# - -connection slave; ---disable_warnings -drop database if exists rewrite; ---enable_warnings -create database rewrite; - -connection master; -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 ','; -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; ---source include/sync_slave_sql_with_master.inc - -connection slave; -select * from rewrite.t1; - -connection master; -truncate table t1; -load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); ---source include/sync_slave_sql_with_master.inc - -connection slave; -select * from rewrite.t1; - -connection master; -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 ''''; ---source include/sync_slave_sql_with_master.inc - -connection slave; -select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; - -connection master; -drop table t1; -create table t1 (a int, b char(10)); -load data infile '../../std_data/loaddata3.dat' ignore into table t1 fields terminated by '' enclosed by '' ignore 1 lines; ---source include/sync_slave_sql_with_master.inc - -connection slave; -select * from rewrite.t1; - -connection master; -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; ---source include/sync_slave_sql_with_master.inc - -connection slave; -# The empty line last comes from the end line field in the file -select * from rewrite.t1; - -set sql_log_bin= 0; -drop database rewrite; -set sql_log_bin= 1; - -connection master; -set sql_log_bin= 0; -drop table t1; -set sql_log_bin= 1; - -# End of 4.1 tests - ---echo ---echo **** ---echo **** Bug #46861 Auto-closing of temporary tables broken by replicate-rewrite-db ---echo **** ---echo - ---echo **** ---echo **** Preparing the environment ---echo **** -connection master; - -connect (con_temp_03,127.0.0.1,root,,test,$MASTER_MYPORT,); -connect (con_temp_02,127.0.0.1,root,,test,$MASTER_MYPORT,); -connect (con_temp_01,127.0.0.1,root,,test,$MASTER_MYPORT,); - -connection master; -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; - -connection slave; -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; - ---echo ---echo **** ---echo **** Creating temporary tables on different databases with different connections ---echo **** ---echo **** con_temp_01 --> creates ---echo **** t_01_01_temp on database_master_temp_01 ---echo **** ---echo **** con_temp_02 --> creates ---echo **** t_01_01_temp on database_master_temp_01 ---echo **** t_02_01_temp, t_02_02_temp on database_master_temp_02 ---echo **** ---echo **** con_temp_03 --> creates ---echo **** t_01_01_temp on database_master_temp_01 ---echo **** t_02_01_temp, t_02_02_temp on database_master_temp_02 ---echo **** t_03_01_temp, t_03_02_temp, t_03_03_temp on database_master_temp_03 ---echo **** - ---echo ---echo con_temp_01 ---echo -connection 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); - ---echo ---echo con_temp_02 ---echo -connection 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); - ---echo ---echo con_temp_03 ---echo -connection 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); - ---echo ---echo **** Dropping the connections ---echo **** To be sure that the DROP statements have been logged, we make ---echo **** sure that the number of open temporary tables at slave becomes ---echo **** zero. If not,the test will time out. ---echo -connection master; ---source include/sync_slave_sql_with_master.inc -connection slave; -show status like 'Slave_open_temp_tables'; - -connection master; -flush logs; - -connection con_temp_01; -disconnect con_temp_01; ---source include/wait_until_disconnected.inc - -connection con_temp_02; -disconnect con_temp_02; ---source include/wait_until_disconnected.inc - -connection con_temp_03; -disconnect con_temp_03; ---source include/wait_until_disconnected.inc - ---echo ---echo **** Wait until number of open temporary tables at slave becomes zero ---echo -connection slave; ---let $status_var= Slave_open_temp_tables ---let $status_var_value= 0 -# The below include file accepts time in units of tenths of seconds. -# Hence 3 minutes = 1800. ---let $status_timeout= 1800 ---source include/wait_for_status_var.inc - ---echo ---echo **** Check if every drop temporary table command is prepended with "use" ---echo -connection master; ---let $current_binlog_file= query_get_value(SHOW MASTER STATUS,File,1) ---let $count_drop= 0 ---let $event_number= 1 ---let $binlog_event= query_get_value(SHOW BINLOG EVENTS IN '$current_binlog_file', Info, $event_number) -while($binlog_event != No such row) -{ - if(`SELECT INSTR("$binlog_event", "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS") AND INSTR("$binlog_event", "use") <> 0`) - { - --inc $count_drop - } - --inc $event_number - --let $binlog_event=query_get_value(SHOW BINLOG EVENTS IN '$current_binlog_file', Info, $event_number) -} - ---let $assert_cond= $count_drop= 6 ---let $assert_text= The number of drop temporary table events in binlog should be 6 ---source include/assert.inc - ---echo **** ---echo **** Cleaning up the test case ---echo **** -connection master; -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; - -connection slave; -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; - -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/rpl/t/rpl_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test index a970c16..30574fe 100644 --- a/mysql-test/suite/rpl/t/rpl_row_reset_slave.test +++ b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test @@ -1,5 +1,5 @@ # 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/have_binlog_format_row.inc +# Temp tables are not replicated in rbr or mixed, but it is still good to hit rbr with everthing +-- 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_stm_drop_temp-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_drop_temp-slave.opt new file mode 100644 index 0000000..8aa1151 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_drop_temp-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=mysqltest.t2 diff --git a/mysql-test/suite/rpl/t/rpl_stm_drop_temp.test b/mysql-test/suite/rpl/t/rpl_stm_drop_temp.test new file mode 100644 index 0000000..6f0cf1c --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_drop_temp.test @@ -0,0 +1,8 @@ +source include/not_gtid_enabled.inc; +source include/master-slave.inc; +source include/have_myisam.inc; +source include/have_binlog_format_statement.inc; + +source extra/rpl_tests/rpl_drop_temp.test; + +source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_stm_innodb.test b/mysql-test/suite/rpl/t/rpl_stm_innodb.test index 13a3c1c..4c442cf 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_innodb.test +++ b/mysql-test/suite/rpl/t/rpl_stm_innodb.test @@ -3,7 +3,7 @@ source include/master-slave.inc; source include/have_innodb.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/not_gtid_enabled.inc; 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 6a99d4e..282033b 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 0000000..290b92e --- /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 0000000..0e6ce5e --- /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_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index baa4800..7f75a9b 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -6,7 +6,10 @@ source include/have_innodb.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; source include/not_gtid_enabled.inc; --echo @@ -60,91 +63,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/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test index ee05cb9..72c930b 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/sql/binlog.cc b/sql/binlog.cc index 95dc1a8..c9ba99f 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -36,6 +36,7 @@ #include "mysqld_thd_manager.h" // Global_THD_manager #include #include +#include "sql_base.h" #ifdef HAVE_REPLICATION #include "rpl_slave_commit_order_manager.h" @@ -8439,6 +8440,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) */ my_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. */ my_bool is_write= FALSE; @@ -8504,7 +8510,24 @@ int THD::decide_logging_format(TABLE_LIST *tables) for (TABLE_LIST *table= tables; table; table= table->next_global) { if (table->placeholder()) - continue; + { + /* + 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(); @@ -8593,17 +8616,12 @@ int THD::decide_logging_format(TABLE_LIST *tables) flags_access_some_set |= flags; - if (lex->sql_command != SQLCOM_CREATE_TABLE || - (lex->sql_command == SQLCOM_CREATE_TABLE && - (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))) - { - if (table->table->s->tmp_table) - lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TEMP_TRANS_TABLE : - LEX::STMT_READS_TEMP_NON_TRANS_TABLE); - else - lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TRANS_TABLE : - LEX::STMT_READS_NON_TRANS_TABLE); - } + if (table->table->s->tmp_table) + lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TEMP_TRANS_TABLE : + LEX::STMT_READS_TEMP_NON_TRANS_TABLE); + else + lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TRANS_TABLE : + LEX::STMT_READS_NON_TRANS_TABLE); if (prev_access_table && prev_access_table->file->ht != table->table->file->ht) @@ -8743,7 +8761,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) { /* log in row format! */ set_current_stmt_binlog_format_row_if_mixed(); diff --git a/sql/sql_class.h b/sql/sql_class.h index 6c0ba18..3887415 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3288,30 +3288,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: %s, in_sub_stmt: %s, system_thread: %s", - YESNO(temporary_tables), YESNO(in_sub_stmt), + ("in_sub_stmt: %s, system_thread: %s", + YESNO(in_sub_stmt), 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 1b802a4..a9f32d4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2063,6 +2063,15 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, DBUG_ENTER("mysql_rm_table"); + /* + 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) { @@ -5070,7 +5079,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; @@ -5326,8 +5337,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)) goto err; src_table->table->use_all_columns(); diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 4fe20d6..93ed53e 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -427,6 +427,12 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref) if (is_temporary_table(table_ref)) { 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();