diff options
author | Luis Soares <luis.soares@sun.com> | 2010-06-29 11:54:58 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-06-29 11:54:58 +0100 |
commit | bf261cdb6f270a086c8ca9d4ae41b90421de8983 (patch) | |
tree | 8a9b77ea326a2b2b084e2e1e89252fcc9b0ac561 /mysql-test/extra | |
parent | 759aabe371736f8a1df6e10183d23218c8c88867 (diff) | |
download | mariadb-git-bf261cdb6f270a086c8ca9d4ae41b90421de8983.tar.gz |
BUG#54842: DROP TEMPORARY TABLE not binlogged after manual
switching binlog format to ROW
BUG 52616 fixed the case which the user would switch from STMT to
ROW binlog format, but the server would silently ignore it. After
that fix thd->is_current_stmt_binlog_format_row() reports correct
value at logging time and events are logged in ROW (as expected)
instead of STMT as they were previously and wrongly logged.
However, the fix was only partially complete, because on
disconnect, at THD cleanup, the implicit logging of temporary
tables is conditionally performed. If the binlog_format==ROW and
thd->is_current_stmt_binlog_format_row() is true then DROPs are
not logged. Given that the user can switch from STMT to ROW, this
is wrong because the server cannot tell, just by relying on the
ROW binlog format, that the tables have been dropped before. This
is effectively similar to the MIXED scenario when a switch from
STMT to ROW is triggered.
We fix this by removing this condition from
close_temporary_tables.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r-- | mysql-test/extra/binlog_tests/drop_temp_table.test | 30 |
1 files changed, 30 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 |