diff options
author | Luis Soares <luis.soares@sun.com> | 2010-07-07 23:27:52 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-07-07 23:27:52 +0100 |
commit | b84b607e879e619bc08482dd7ab528e246767090 (patch) | |
tree | d7e679d840575087d121657968f47a468fe8848d /mysql-test | |
parent | 00e86d01a72c539b915e07f4b7b8fe218433fd60 (diff) | |
parent | e0ece40b6415876a4e230a733958b9fc0be1f9f7 (diff) | |
download | mariadb-git-b84b607e879e619bc08482dd7ab528e246767090.tar.gz |
BUG 54842: automerged bzr bundle in mysql-trunk-bugfixing.
Diffstat (limited to 'mysql-test')
6 files changed, 118 insertions, 0 deletions
diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 63833c10c14..c852ee4c8a0 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -69,4 +69,34 @@ let $VERSION=`SELECT VERSION()`; source include/show_binlog_events.inc; DROP DATABASE `drop-temp+table-test`; + +# +# Bug #54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW +# +# Sanity test. Checking that implicit DROP event is logged. +# +# After BUG#52616, the switch to ROW mode becomes effective even +# if there are open temporary tables. As such the implicit drop +# for temporary tables on session closing must be logged. +# + +RESET MASTER; + +CREATE TABLE t1 ( i text ); + +--connect(con1,localhost,root,,) +CREATE TEMPORARY TABLE ttmp1 ( i text ); +SET @@session.binlog_format=ROW; +INSERT INTO t1 VALUES ('1'); +SELECT @@session.binlog_format; +--disconnect con1 + +-- connection default +--let $wait_binlog_event= DROP +--source include/wait_for_binlog_event.inc +-- source include/show_binlog_events.inc +RESET MASTER; + +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index a43ed03b774..24e779eee8e 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -33,4 +33,23 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE I master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t +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 +show binlog events from <binlog_start>; +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_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 86da7468892..699c824844f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -297,6 +297,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t0) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti` do release_lock("lock1"); drop table t0,t2; set autocommit=0; diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 19ddcf49080..79f09b2d1ee 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -42,3 +42,22 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS t master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t 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 +show binlog events from <binlog_start>; +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 # # use `test`; CREATE TEMPORARY TABLE ttmp1 ( 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/rpl/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result index 03fbaa2256f..726b8f2fe54 100644 --- a/mysql-test/suite/rpl/r/rpl_drop_temp.result +++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result @@ -26,3 +26,24 @@ CREATE TEMPORARY TABLE tmp3 (a int); DROP TEMPORARY TABLE tmp3; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +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 +show binlog events from <binlog_start>; +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; diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test index f2a4dd70da6..7bc55c53447 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_temp.test +++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test @@ -66,4 +66,32 @@ START SLAVE; connection master; sync_slave_with_master; + +# +# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW +# + +-- connection master +-- source include/master-slave-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 |