Merge lp:~gl-az/percona-server/ST-41544-5.5 into lp:percona-server/5.5

Proposed by George Ormond Lorch III on 2014-06-26
Status: Merged
Approved by: Laurynas Biveinis on 2014-10-23
Approved revision: 699
Merged at revision: 713
Proposed branch: lp:~gl-az/percona-server/ST-41544-5.5
Merge into: lp:percona-server/5.5
Diff against target: 2662 lines (+779/-833)
43 files modified
mysql-test/extra/binlog_tests/drop_temp_table.test (+1/-0)
mysql-test/extra/binlog_tests/tmp_table.test (+0/-1)
mysql-test/extra/rpl_tests/rpl_drop_temp.test (+0/-4)
mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test (+40/-15)
mysql-test/extra/rpl_tests/rpl_rewrt_db.test (+1/-3)
mysql-test/suite/binlog/r/binlog_database.result (+1/-2)
mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result (+0/-78)
mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result (+57/-0)
mysql-test/suite/binlog/r/binlog_mix_tmp_table.result (+42/-0)
mysql-test/suite/binlog/r/binlog_row_tmp_table.result (+42/-0)
mysql-test/suite/binlog/r/binlog_stm_binlog.result (+8/-8)
mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test (+0/-76)
mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test (+4/-0)
mysql-test/suite/binlog/t/binlog_mix_tmp_table.test (+2/-0)
mysql-test/suite/binlog/t/binlog_row_tmp_table.test (+2/-0)
mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test (+1/-2)
mysql-test/suite/binlog/t/binlog_stm_tmp_table.test (+2/-0)
mysql-test/suite/rpl/r/rpl_bug58546.result (+44/-0)
mysql-test/suite/rpl/r/rpl_mix_drop_temp.result (+40/-0)
mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result (+218/-0)
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result (+94/-118)
mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result (+3/-7)
mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result (+0/-12)
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result (+0/-12)
mysql-test/suite/rpl/r/rpl_stop_slave.result (+0/-46)
mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result (+0/-111)
mysql-test/suite/rpl/t/rpl_bug58546.test (+69/-0)
mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test (+2/-1)
mysql-test/suite/rpl/t/rpl_mix_drop_temp-slave.opt (+2/-0)
mysql-test/suite/rpl/t/rpl_mix_drop_temp.test (+6/-0)
mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt (+1/-0)
mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test (+7/-0)
mysql-test/suite/rpl/t/rpl_row_reset_slave.test (+2/-2)
mysql-test/suite/rpl/t/rpl_stm_drop_temp.test (+6/-0)
mysql-test/suite/rpl/t/rpl_stm_reset_slave.test (+1/-1)
mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test (+7/-0)
mysql-test/suite/rpl/t/rpl_stop_slave.test (+8/-88)
mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test (+0/-210)
mysql-test/suite/rpl/t/rpl_trunc_temp.test (+3/-2)
sql/sql_class.cc (+38/-15)
sql/sql_class.h (+3/-18)
sql/sql_table.cc (+14/-1)
sql/sql_truncate.cc (+8/-0)
To merge this branch: bzr merge lp:~gl-az/percona-server/ST-41544-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) 2014-06-26 Approve on 2014-10-23
Review via email: mp+224689@code.launchpad.net

Description of the change

bug 1313901 : When a session creates a temporary table and that table is used
within queries, the binlog format of the session is unconditionally switched to
ROW for the remainder of the session or until all temporary tables have been
dropped.

This is a result of an old fix for upstream 20499.

The consequence this has on the slave is that, the slave is single threaded and
executes all queries from a single session. If the slave is also binlogging, the
slave will unconditionally binlog every statement it receives in ROW format
until all temp tables are dropped. This means statements get logged in different
format on the master and the slave and can introduce huge slave lag.

Through discussion with our varous experts, we decided to undo the original
20499 fix and change the fundamental way MIXED replication works with regard to
temp tables. The new MIXED replication behavior can be summed up 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.

The code changes to make this happen are very minor but have a huge impact.
Many test cases in the rpl and binlog suite need to be changes and some
eliminated entirely as they test for functionality that no longer exists.

During the testing of this feature, each and every mtr test failure was closely
scruitinized to ensure that the failure was a legitimate and expected change
in behavior. This caused a lot of back-and-forth debugging and fixing to ensure
that the resulting server behavior and mtr test cases were 100% as described in
the new behavior above.

To post a comment you must log in.

    - For setting creating_temp_table to TRUE, add
      !create_drop_temp_table as the first condition to the if
      statement.

    - the header comment in the tests that include
      extra/rpl_tests/rpl_drop_temp.test and was moved there and should be
      removed from the tests themselves.

    - extra/binlog_tests/drop_temp_table.test the header comment for
      bug #46572 is now outdated for MBR.

    - Is this bit really correct? (and the rest of binlog_stm_binlog)
      We shouldn't be affecting SBR replication of temp tables, should
      we?

--- mysql-test/suite/binlog/r/binlog_stm_binlog.result 2011-02-23 11:54:58 +0000
+++ mysql-test/suite/binlog/r/binlog_stm_binlog.result 2014-06-19 20:16:48 +0000
@@ -635,9 +635,7 @@
 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;

    - Would it be a good idea to record RBR/MBR version(s) of
      binlog_tmp_table.test?

    - rpl_row_reset_slave and rpl_mix_reset_slave result files are
      identical. Let's join the testcases?

    - rpl_stop_slave tests more than temp table replication. Possible
      to restore it for MBR?

review: Needs Fixing
George Ormond Lorch III (gl-az) wrote :
Download full text (3.5 KiB)

OK, it's been a bit since I updated this so I wanted to give a quick status update on it...

> - For setting creating_temp_table to TRUE, add
> !create_drop_temp_table as the first condition to the if
> statement.

You have a typo here, at first I couldn't figure out what you were suggesting but I finally saw it. Since that 'if' statement is executed within the loop iterating all tables in the query, and the 'if' statement does find_temporary_table on each table, it can be a bit of a performance ding if there are a lot of temp tables. This is a nice little precheck to see if we need to do all of the different tests and find if we have already determined that the query is doing a CREATE TEMP or a DROP on a TEMP.

>
> - the header comment in the tests that include
> extra/rpl_tests/rpl_drop_temp.test and was moved there and should be
> removed from the tests themselves.
>
> - extra/binlog_tests/drop_temp_table.test the header comment for
> bug #46572 is now outdated for MBR.

Yeah, good eye, got these easily fixed.

>
> - Is this bit really correct? (and the rest of binlog_stm_binlog)
> We shouldn't be affecting SBR replication of temp tables, should
> we?
>
> --- mysql-test/suite/binlog/r/binlog_stm_binlog.result 2011-02-23 11:54:58
> +0000
> +++ mysql-test/suite/binlog/r/binlog_stm_binlog.result 2014-06-19 20:16:48
> +0000
> @@ -635,9 +635,7 @@
> 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;

Still looking into this one but IIRC from the earlier work on this we are setting the statement as ROW but that then doesn't block it from the binlog, it transforms it into a DROP TABLE IF EXISTS instead. Since this test is for STMT only, I don't quite know why this has changed. It may be a valid side effect of the changes to avoid a lot more coding around the issue or it may be a bug in the fix. Need to investigate this deeper to figure out what the right answer is.

>
> - Would it be a good idea to record RBR/MBR version(s) of
> binlog_tmp_table.test?

Why yes it would, a very good idea, and in fact, it found a bug. TRUNCATE TABLE on a temp table is still getting binlogged as STMT in mixed mode...working on a somewhat simple fix here.

>
> - rpl_row_reset_slave and rpl_mix_reset_slave result files are
> identical. Let's join the testcases?

Sure, done, changed existing rpl_row_reset_slave.test to do both row and mixed, reverted file adds and changes to rpl_stm_reset_slave.test, then removed mixed from the stm test.

>
> - rpl_stop_slave tests more than temp table replication. Possible
> to restore it for MBR?
...

Read more...

> > - rpl_stop_slave tests more than temp table replication. Possible
> > to restore it for MBR?
>
> Not easily, the test is really designed for STMT only as it does diff_tables
> between the master and slave, mostly on temp tables. Since this change makes
> temp tables operate more like ROW when doing MIXED it means we would almost
> have to rewrite a new stop_slave test for MBR that just skipped anything
> related to temp tables in order to test the non-temp bits. If you think we
> should go that far then yeah, I can do that.

Are you referring to "bug 56118" part of rpl_stop_slave? There is "bug 58546" part too, which does not seem to be related to temp tables. Maybe split the testcase then?

George Ormond Lorch III (gl-az) wrote :

On 10/12/2014 01:49 AM, Laurynas Biveinis wrote:
>>> - rpl_stop_slave tests more than temp table replication. Possible
>>> to restore it for MBR?
>> Not easily, the test is really designed for STMT only as it does diff_tables
>> between the master and slave, mostly on temp tables. Since this change makes
>> temp tables operate more like ROW when doing MIXED it means we would almost
>> have to rewrite a new stop_slave test for MBR that just skipped anything
>> related to temp tables in order to test the non-temp bits. If you think we
>> should go that far then yeah, I can do that.
> Are you referring to "bug 56118" part of rpl_stop_slave? There is "bug 58546" part too, which does not seem to be related to temp tables. Maybe split the testcase then?
Yes, the 56118 is now pretty specific to SBR and temp tables. I will
split 58546 out to a unique test case that does both SBR and MBR.

--
George O. Lorch III
Software Engineer, Percona
+1-888-401-3401 x542 US/Arizona (GMT -7)
skype: george.ormond.lorch.iii

George Ormond Lorch III (gl-az) wrote :

On 07/05/2014 05:45 AM, Laurynas Biveinis wrote:
> - Is this bit really correct? (and the rest of binlog_stm_binlog)
> We shouldn't be affecting SBR replication of temp tables, should
> we?
>
> --- mysql-test/suite/binlog/r/binlog_stm_binlog.result 2011-02-23 11:54:58 +0000
> +++ mysql-test/suite/binlog/r/binlog_stm_binlog.result 2014-06-19 20:16:48 +0000
> @@ -635,9 +635,7 @@
> 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;
>
OK, yes, this is correct. I didn't catch it before but the issue is that
the test case name implies SBR, but in fact it is specifically testing
MBR instead, thus these result changes are correct. I suppose that could
be a bug in itself that the test is binlog_stm_binlog.test. I think it
would probably be a good idea to add/record a binlog_mix_binlog.test and
fix the _stm_ to actualy test SBR.

--
George O. Lorch III
Software Engineer, Percona
+1-888-401-3401 x542 US/Arizona (GMT -7)
skype: george.ormond.lorch.iii

George Ormond Lorch III (gl-az) wrote :

OK, so I think I have everything addressed and a new push to the branch.

Here is a new jenkins run: http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/1059/

There are a few test failures, most of which are pre-existing. Two in particular that show up in replication are:
rpl.rpl_filter_tables_not_exist 'stmt' - Only happened on one slave. This does not _appear_ to be a pre-existing issue and I can not reproduce it locally. I reviewed the test case and there doesn't look like there is any place where this test would interact with my changes, but if you could please take a close look at it.
rpl.rpl_row_until 'row' - This is a pre-existing issue and I can sporadically reproduce it locally on revno 670 (before this fix).

    - Please rebase on the current 5.5 to 5.6 GCA. It will include at
      least one more upstream merge, which always touches replication
      and its testsuite. Perhaps that will resolve the rpl_stop_slave
      conflicts too.

    - suite/rpl/t/rpl_drop_temp.test should be bzr mv'ed to
      extra/rpl_tests/rpl_drop_temp.test and
      suite/rpl/t/rpl_stm_drop_temp.test should bzr add'ed. This will
      give a smaller diff, and the upstream merges will cause
      conflicts or automerge at the right place.

    - Likewise for rpl_rewrt_db.

    - In rpl_mixed_drop_create_temp_table, diff lines 1792+ ("B N
      N-Temp T-SELECT-N-Temp N-Temp C"), it seems that binlog is
      missing the row events for INSERT INTO nt_xx_1 SELECT * FROM
      tt_tmp_xx_1;

    - Add a comment to the end of rpl_stop_slave "bug 58546 part was
      moved to ... " to help with future merges.

    - There is a couple of diff comments.

review: Needs Fixing
George Ormond Lorch III (gl-az) wrote :

> - Please rebase on the current 5.5 to 5.6 GCA. It will include at
> least one more upstream merge, which always touches replication
> and its testsuite. Perhaps that will resolve the rpl_stop_slave
> conflicts too.

Sorry about that, I did rebase what seem like not too long ago but must have just missed the 5.5.39-36.0 merge.

I am beginning to have a concern over the long term maintenance of this fix. This is the 3rd or 4th time I have rebased and each time I have had to fixup mtr tests to work correctly with this fix :-\

George Ormond Lorch III (gl-az) wrote :

> - In rpl_mixed_drop_create_temp_table, diff lines 1792+ ("B N
> N-Temp T-SELECT-N-Temp N-Temp C"), it seems that binlog is
> missing the row events for INSERT INTO nt_xx_1 SELECT * FROM
> tt_tmp_xx_1;

Are you sure about this, that you are looking at the same test correctly? Diff line 1792+ isn't:
'B N N-Temp T-SELECT-N-Temp N-Temp C'
it is:
'B N N-Temp N-SELECT-T-Temp N-Temp C'

This test and the results seem fine...Here is the portion of the result file for 'B N N-Temp T-SELECT-N-Temp N-Temp C':

SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp C';
BEGIN;
INSERT INTO nt_xx_1() VALUES (1);
INSERT INTO nt_tmp_xx_1() VALUES (1);
INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1;
INSERT INTO nt_tmp_xx_1() VALUES (1);
COMMIT;
-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # 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 # 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 */
-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e-

The only things that should be binlogged here is the 'INSERT INTO nt_xx_1' as STMT, then the 'INSERT INTO tt_xx_1 SELECT' as ROW and that seems to be happening correctly right?

Maybe you are looking at the following case 'B N N-Temp N-SELECT-T-Temp N-Temp C', this is file as well, here is the snippet from the result file:

SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp C';
BEGIN;
INSERT INTO nt_xx_1() VALUES (1);
INSERT INTO nt_tmp_xx_1() VALUES (1);
INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1;
INSERT INTO nt_tmp_xx_1() VALUES (1);
COMMIT;
-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
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-

At first this looked wrong, like it was missing row events for the third insert 'INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1;', which it is, because there are no rows in tt_tmp_xx_1 at this point in the test, it seems that it is an empty temp table that never gets anything inserted the entire test. So this case seems right to me as well.

George Ormond Lorch III (gl-az) wrote :

Addressed issues noted except for the 'missing row' as mentioned in previous comment. New jenkins run: http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/1062/

    - This now looks good, thanks for explaining the
      rpl_mixed_drop_create_temp_table bits. But there are a couple of
      bzr bits that need addressing. As for the patch maintenance, it
      looks like the hard part is already behind us, at least until
      upstream fixes the same.

    - Please recommit with --file option instead of -m ;)

    - The old rpl_drop_temp.result should be bzr mv'ed to
      rpl_stm_drop_temp.result? Likewise rpl_rewrt_db.result to
      rpl_stm_rewrt_db.result? While at that, the small -slave.opt
      files too? All this would help with bzr merges.

review: Needs Fixing
George Ormond Lorch III (gl-az) wrote :

> - Please recommit with --file option instead of -m ;)
/facepalm

>
> - The old rpl_drop_temp.result should be bzr mv'ed to
> rpl_stm_drop_temp.result? Likewise rpl_rewrt_db.result to
> rpl_stm_rewrt_db.result? While at that, the small -slave.opt
> files too? All this would help with bzr merges.

Done, I wasn't sure which way was going to be best, mv or add, had a 50/50 shot at guessing :)

And another jenkins run for good measure:

http://jenkins.percona.com/job/percona-server-5.5-param/1063/

Looks good. Will be merged once the 5.6 MP is ready.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mysql-test/extra/binlog_tests/drop_temp_table.test'
2--- mysql-test/extra/binlog_tests/drop_temp_table.test 2010-06-29 10:54:58 +0000
3+++ mysql-test/extra/binlog_tests/drop_temp_table.test 2014-10-22 21:45:42 +0000
4@@ -20,6 +20,7 @@
5 # In RBR, 'DROP TEMPORARY TABLE ...' statement should never be binlogged no
6 # matter if the tables exist or not. In contrast, both in SBR and MBR, the
7 # statement should be always binlogged no matter if the tables exist or not.
8+# In MBR though, it will always be binlogged with IF EXISTS.
9 ##############################################################################
10 CREATE TEMPORARY TABLE tmp(c1 int);
11 CREATE TEMPORARY TABLE tmp1(c1 int);
12
13=== renamed file 'mysql-test/suite/binlog/t/binlog_tmp_table.test' => 'mysql-test/extra/binlog_tests/tmp_table.test'
14--- mysql-test/suite/binlog/t/binlog_tmp_table.test 2010-04-28 12:47:49 +0000
15+++ mysql-test/extra/binlog_tests/tmp_table.test 2014-10-22 21:45:42 +0000
16@@ -26,7 +26,6 @@
17 # BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used
18 #
19 source include/have_log_bin.inc;
20-source include/have_binlog_format_mixed_or_statement.inc;
21
22 RESET MASTER;
23
24
25=== renamed file 'mysql-test/suite/rpl/t/rpl_drop_temp.test' => 'mysql-test/extra/rpl_tests/rpl_drop_temp.test'
26--- mysql-test/suite/rpl/t/rpl_drop_temp.test 2010-12-19 17:15:12 +0000
27+++ mysql-test/extra/rpl_tests/rpl_drop_temp.test 2014-10-22 21:45:42 +0000
28@@ -5,9 +5,6 @@
29 # Purpose: According to TU in 16552 This is how
30 # to work around NDB's issue with temp tables
31 ##############################################
32-source include/master-slave.inc;
33-source include/have_binlog_format_mixed_or_statement.inc;
34-
35 --disable_warnings
36 create database if not exists mysqltest;
37 --enable_warnings
38@@ -94,4 +91,3 @@
39 DROP TABLE t1;
40
41 # End of 4.1 tests
42---source include/rpl_end.inc
43
44=== modified file 'mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test'
45--- mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test 2010-12-19 17:15:12 +0000
46+++ mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test 2014-10-22 21:45:42 +0000
47@@ -357,7 +357,7 @@
48 {
49 let $cmd= CREATE TEMPORARY TABLE tt_xx (a int);
50 let $in_temporary= yes;
51- # In SBR and MIXED modes, the DDL statement is written to the binary log but
52+ # In SBR mode, the DDL statement is written to the binary log but
53 # does not commit the current transaction.
54 #
55 # 1: BEGIN
56@@ -373,10 +373,21 @@
57 # 3: ROW EVENT
58 # 4: COMMIT
59 #
60- if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'` )
61+ # In MIXED mode, the DDL statement is not written to the binary log and
62+ # does not commit the current transaction.
63+ #
64+ # 1: BEGIN
65+ # 2: INSERT
66+ # 3: COMMIT
67+ #
68+ if (`select @@binlog_format = 'STATEMENT'` )
69 {
70 let $commit_event_row_number= 4;
71 }
72+ if (`select @@binlog_format = 'MIXED'` )
73+ {
74+ let $commit_event_row_number= 3;
75+ }
76 #
77 # In NDB (RBR mode), the commit event is the sixth event
78 # in the binary log:
79@@ -418,14 +429,15 @@
80 # In MIXED mode, the changes are logged as rows and we have what follows:
81 #
82 # 1: BEGIN
83- # 2: TABLE MAP EVENT
84- # 3: ROW EVENT
85- # 4: COMMIT
86- # 5: DDL EVENT which triggered the previous commmit.
87+ # 2: ROW EVENT
88+ # 3: COMMIT
89 #
90 if (`select @@binlog_format = 'MIXED'`)
91 {
92- let $commit_event_row_number= 4;
93+ # Since this alter is done on a temp table in MIXED, it will not be
94+ # binlogged at all, so explicitly commit.
95+ let $in_temporary= yes;
96+ let $commit_event_row_number= 3;
97 }
98 #
99 # In NDB (RBR and MIXED modes), the commit event is the sixth event
100@@ -450,14 +462,15 @@
101 # In MIXED mode, the changes are logged as rows and we have what follows:
102 #
103 # 1: BEGIN
104- # 2: TABLE MAP EVENT
105- # 3: ROW EVENT
106- # 4: COMMIT
107- # 5: DDL EVENT which triggered the previous commmit.
108+ # 2: ROW EVENT
109+ # 3: COMMIT
110 #
111 if (`select @@binlog_format = 'MIXED'`)
112- {
113- let $commit_event_row_number= 4;
114+ {
115+ # Since this alter is done on a temp table in MIXED, it will not be
116+ # binlogged at all, so explicitly commit.
117+ let $in_temporary= yes;
118+ let $commit_event_row_number= 3;
119 }
120 #
121 # In NDB (RBR and MIXED modes), the commit event is the sixth event
122@@ -502,7 +515,7 @@
123 {
124 let $commit_event_row_number= 4;
125 }
126- # In MIXED mode, the changes are logged as rows and we have what follows:
127+ # In ROW mode, the changes are logged as rows and we have what follows:
128 #
129 # 1: BEGIN
130 # 2: TABLE MAP EVENT
131@@ -510,10 +523,22 @@
132 # 4: DROP TEMPORARY table IF EXISTS
133 # 5: COMMIT
134 #
135- if (`select @@binlog_format = 'MIXED' || @@binlog_format = 'ROW'`)
136+ if (`select @@binlog_format = 'ROW'`)
137 {
138 let $commit_event_row_number= 5;
139 }
140+ # In MIXED mode, the changes are logged as rows and we have what follows:
141+ #
142+ # 1: BEGIN
143+ # 2: ROW EVENT
144+ # 3: DROP TEMPORARY table IF EXISTS
145+ # 4: COMMIT
146+ #
147+ if (`select @@binlog_format = 'MIXED'`)
148+ {
149+ let $commit_event_row_number= 4;
150+ }
151+
152 #
153 # In NDB (RBR and MIXED modes), the commit event is the sixth event
154 # in the binary log:
155
156=== renamed file 'mysql-test/suite/rpl/t/rpl_rewrt_db.test' => 'mysql-test/extra/rpl_tests/rpl_rewrt_db.test'
157--- mysql-test/suite/rpl/t/rpl_rewrt_db.test 2010-12-19 17:07:28 +0000
158+++ mysql-test/extra/rpl_tests/rpl_rewrt_db.test 2014-10-22 21:45:42 +0000
159@@ -1,6 +1,5 @@
160+
161 # TBF - difference in row level logging
162--- source include/have_binlog_format_mixed_or_statement.inc
163--- source include/master-slave.inc
164
165 --disable_warnings
166 drop database if exists mysqltest1;
167@@ -237,4 +236,3 @@
168 sync_slave_with_master;
169
170 # end of 5.0 tests
171---source include/rpl_end.inc
172
173=== modified file 'mysql-test/suite/binlog/r/binlog_database.result'
174--- mysql-test/suite/binlog/r/binlog_database.result 2013-10-22 13:33:14 +0000
175+++ mysql-test/suite/binlog/r/binlog_database.result 2014-10-22 21:45:42 +0000
176@@ -90,7 +90,6 @@
177 drop table tt1, t1;
178 show binlog events from <binlog_start>;
179 Log_name Pos Event_type Server_id End_log_pos Info
180-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
181 master-bin.000001 # Query # # use `test`; create table t1 (a int)
182 master-bin.000001 # Query # # BEGIN
183 master-bin.000001 # Query # # use `test`; insert into t1 values (1)
184@@ -99,7 +98,7 @@
185 master-bin.000001 # Query # # BEGIN
186 master-bin.000001 # Query # # use `test`; insert into t1 values (1)
187 master-bin.000001 # Query # # COMMIT
188-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */
189+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */
190 master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
191 FLUSH STATUS;
192 #
193
194=== removed file 'mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result'
195--- mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result 2010-01-26 09:41:15 +0000
196+++ mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result 1970-01-01 00:00:00 +0000
197@@ -1,78 +0,0 @@
198-SELECT @@SESSION.binlog_format;
199-@@SESSION.binlog_format
200-MIXED
201-CREATE TABLE t1 (a VARCHAR(100));
202-CREATE TEMPORARY TABLE t2 (a VARCHAR(100));
203-# Test allow switching @@SESSION.binlog_format from MIXED to STATEMENT
204-# when there are open temp tables and we are logging in statement based format.
205-SET SESSION binlog_format = STATEMENT;
206-SELECT @@SESSION.binlog_format;
207-@@SESSION.binlog_format
208-STATEMENT
209-# Test allow switching @@SESSION.binlog_format from STATEMENT to
210-# STATEMENT when there are open temp tables.
211-SET SESSION binlog_format = STATEMENT;
212-SELECT @@SESSION.binlog_format;
213-@@SESSION.binlog_format
214-STATEMENT
215-INSERT INTO t1 VALUES ('statement based');
216-SELECT @@SESSION.binlog_format;
217-@@SESSION.binlog_format
218-STATEMENT
219-# Test allow switching @@SESSION.binlog_format from STATEMENT to
220-# MIXED when there are open temp tables.
221-SET SESSION binlog_format = MIXED;
222-SELECT @@SESSION.binlog_format;
223-@@SESSION.binlog_format
224-MIXED
225-# Test allow switching @@SESSION.binlog_format from MIXED to MIXED
226-# when there are open temp tables.
227-SET SESSION binlog_format = MIXED;
228-SELECT @@SESSION.binlog_format;
229-@@SESSION.binlog_format
230-MIXED
231-INSERT INTO t2 VALUES (UUID());
232-SELECT @@SESSION.binlog_format;
233-@@SESSION.binlog_format
234-MIXED
235-# Test forbit switching @@SESSION.binlog_format from MIXED to STATEMENT
236-# when there are open temp tables and we are logging in row based format.
237-SET SESSION binlog_format = STATEMENT;
238-ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
239-SELECT @@SESSION.binlog_format;
240-@@SESSION.binlog_format
241-MIXED
242-SET SESSION binlog_format = ROW;
243-SELECT @@SESSION.binlog_format;
244-@@SESSION.binlog_format
245-ROW
246-INSERT INTO t1 VALUES ('row based');
247-# Test allow switching @@SESSION.binlog_format from ROW to MIXED
248-# when there are open temp tables.
249-SET SESSION binlog_format = MIXED;
250-SELECT @@SESSION.binlog_format;
251-@@SESSION.binlog_format
252-MIXED
253-INSERT INTO t1 VALUES ('row based');
254-# Test allow switching @@SESSION.binlog_format from MIXED to ROW
255-# when there are open temp tables.
256-SET SESSION binlog_format = ROW;
257-SELECT @@SESSION.binlog_format;
258-@@SESSION.binlog_format
259-ROW
260-# Test allow switching @@SESSION.binlog_format from ROW to ROW
261-# when there are open temp tables.
262-SET SESSION binlog_format = ROW;
263-SELECT @@SESSION.binlog_format;
264-@@SESSION.binlog_format
265-ROW
266-INSERT INTO t1 VALUES ('row based');
267-# Test forbit switching @@SESSION.binlog_format from ROW to STATEMENT
268-# when there are open temp tables.
269-SET SESSION binlog_format = STATEMENT;
270-ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
271-SELECT @@SESSION.binlog_format;
272-@@SESSION.binlog_format
273-ROW
274-DROP TEMPORARY TABLE t2;
275-DROP TABLE t1;
276
277=== added file 'mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result'
278--- mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result 1970-01-01 00:00:00 +0000
279+++ mysql-test/suite/binlog/r/binlog_mix_drop_tmp_tbl.result 2014-10-22 21:45:42 +0000
280@@ -0,0 +1,57 @@
281+DROP DATABASE IF EXISTS `drop-temp+table-test`;
282+RESET MASTER;
283+CREATE DATABASE `drop-temp+table-test`;
284+USE `drop-temp+table-test`;
285+CREATE TEMPORARY TABLE shortn1 (a INT);
286+CREATE TEMPORARY TABLE `table:name` (a INT);
287+CREATE TEMPORARY TABLE shortn2 (a INT);
288+CREATE TEMPORARY TABLE tmp(c1 int);
289+CREATE TEMPORARY TABLE tmp1(c1 int);
290+CREATE TEMPORARY TABLE tmp2(c1 int);
291+CREATE TEMPORARY TABLE tmp3(c1 int);
292+CREATE TABLE t(c1 int);
293+DROP TEMPORARY TABLE IF EXISTS tmp;
294+DROP TEMPORARY TABLE IF EXISTS tmp;
295+DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
296+DROP TEMPORARY TABLE tmp3;
297+DROP TABLE IF EXISTS tmp2, t;
298+DROP TABLE IF EXISTS tmp2, t;
299+SELECT GET_LOCK("a",10);
300+GET_LOCK("a",10)
301+1
302+USE test;
303+SELECT GET_LOCK("a",10);
304+GET_LOCK("a",10)
305+1
306+show binlog events from <binlog_start>;
307+Log_name Pos Event_type Server_id End_log_pos Info
308+master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test`
309+master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
310+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
311+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
312+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1` /* generated by server */
313+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */
314+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp3` /* generated by server */
315+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */
316+master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
317+master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */
318+master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
319+DROP DATABASE `drop-temp+table-test`;
320+RESET MASTER;
321+CREATE TABLE t1 ( i text );
322+CREATE TEMPORARY TABLE ttmp1 ( i text );
323+SET @@session.binlog_format=ROW;
324+INSERT INTO t1 VALUES ('1');
325+SELECT @@session.binlog_format;
326+@@session.binlog_format
327+ROW
328+show binlog events from <binlog_start>;
329+Log_name Pos Event_type Server_id End_log_pos Info
330+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i text )
331+master-bin.000001 # Query # # BEGIN
332+master-bin.000001 # Table_map # # table_id: # (test.t1)
333+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
334+master-bin.000001 # Query # # COMMIT
335+master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
336+RESET MASTER;
337+DROP TABLE t1;
338
339=== added file 'mysql-test/suite/binlog/r/binlog_mix_tmp_table.result'
340--- mysql-test/suite/binlog/r/binlog_mix_tmp_table.result 1970-01-01 00:00:00 +0000
341+++ mysql-test/suite/binlog/r/binlog_mix_tmp_table.result 2014-10-22 21:45:42 +0000
342@@ -0,0 +1,42 @@
343+RESET MASTER;
344+create table foo (a int);
345+flush logs;
346+create temporary table tmp1_foo like foo;
347+create temporary table tmp2_foo (a int);
348+insert into tmp1_foo values (1), (2), (3), (4);
349+replace into tmp2_foo values (1), (2), (3), (4);
350+update tmp1_foo set a=2*a-1;
351+update tmp2_foo set a=2*a;
352+delete from tmp1_foo where a < 5;
353+delete from tmp2_foo where a < 5;
354+insert into foo select * from tmp1_foo;
355+insert into foo select * from tmp2_foo;
356+truncate table tmp1_foo;
357+truncate table tmp2_foo;
358+flush logs;
359+select * from foo;
360+a
361+5
362+7
363+6
364+8
365+drop table foo;
366+create table foo (a int);
367+select * from foo;
368+a
369+5
370+7
371+6
372+8
373+drop table foo;
374+RESET MASTER;
375+create database b51226;
376+use b51226;
377+create temporary table t1(i int);
378+use b51226;
379+create temporary table t1(i int);
380+create temporary table t1(i int);
381+ERROR 42S01: Table 't1' already exists
382+insert into t1 values(1);
383+DROP DATABASE b51226;
384+FLUSH LOGS;
385
386=== added file 'mysql-test/suite/binlog/r/binlog_row_tmp_table.result'
387--- mysql-test/suite/binlog/r/binlog_row_tmp_table.result 1970-01-01 00:00:00 +0000
388+++ mysql-test/suite/binlog/r/binlog_row_tmp_table.result 2014-10-22 21:45:42 +0000
389@@ -0,0 +1,42 @@
390+RESET MASTER;
391+create table foo (a int);
392+flush logs;
393+create temporary table tmp1_foo like foo;
394+create temporary table tmp2_foo (a int);
395+insert into tmp1_foo values (1), (2), (3), (4);
396+replace into tmp2_foo values (1), (2), (3), (4);
397+update tmp1_foo set a=2*a-1;
398+update tmp2_foo set a=2*a;
399+delete from tmp1_foo where a < 5;
400+delete from tmp2_foo where a < 5;
401+insert into foo select * from tmp1_foo;
402+insert into foo select * from tmp2_foo;
403+truncate table tmp1_foo;
404+truncate table tmp2_foo;
405+flush logs;
406+select * from foo;
407+a
408+5
409+7
410+6
411+8
412+drop table foo;
413+create table foo (a int);
414+select * from foo;
415+a
416+5
417+7
418+6
419+8
420+drop table foo;
421+RESET MASTER;
422+create database b51226;
423+use b51226;
424+create temporary table t1(i int);
425+use b51226;
426+create temporary table t1(i int);
427+create temporary table t1(i int);
428+ERROR 42S01: Table 't1' already exists
429+insert into t1 values(1);
430+DROP DATABASE b51226;
431+FLUSH LOGS;
432
433=== modified file 'mysql-test/suite/binlog/r/binlog_stm_binlog.result'
434--- mysql-test/suite/binlog/r/binlog_stm_binlog.result 2011-02-23 11:54:58 +0000
435+++ mysql-test/suite/binlog/r/binlog_stm_binlog.result 2014-10-22 21:45:42 +0000
436@@ -635,9 +635,7 @@
437 COERCIBILITY(s1) d3;
438 DROP TEMPORARY TABLE tmp1;
439 END
440-master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1
441-SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%")
442-master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE `tmp1` /* generated by server */
443+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `bug39182`.`tmp1` /* generated by server */
444 DROP PROCEDURE p1;
445 DROP TABLE t1;
446 DROP DATABASE bug39182;
447@@ -704,8 +702,9 @@
448 master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
449 master-bin.000001 # Query # # use `test`; create table t1 (a int)
450 master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
451-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
452-master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
453+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
454+ `a` int(11) DEFAULT NULL
455+)
456 master-bin.000001 # Query # # BEGIN
457 master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
458 master-bin.000001 # Query # # COMMIT
459@@ -731,8 +730,9 @@
460 master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
461 master-bin.000001 # Query # # use `test`; create table t1 (a int)
462 master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
463-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
464-master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
465+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
466+ `a` int(11) DEFAULT NULL
467+)
468 master-bin.000001 # Query # # BEGIN
469 master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
470 master-bin.000001 # Query # # COMMIT
471@@ -742,7 +742,7 @@
472 master-bin.000001 # Query # # BEGIN
473 master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
474 master-bin.000001 # Query # # COMMIT
475-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */
476+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */
477 master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
478 master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
479 master-bin.000001 # Query # # BEGIN
480
481=== renamed file 'mysql-test/suite/binlog/r/binlog_tmp_table.result' => 'mysql-test/suite/binlog/r/binlog_stm_tmp_table.result'
482=== removed file 'mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test'
483--- mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test 2010-01-26 09:41:15 +0000
484+++ mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test 1970-01-01 00:00:00 +0000
485@@ -1,76 +0,0 @@
486-#
487-# Bug #45855 row events in binlog after switch from binlog_fmt=mix to stmt with open tmp tbl
488-# Bug #45856 can't switch from binlog_format=row to mix with open tmp tbl
489-# This test verfies if the program will generate ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
490-# error and forbid switching @@SESSION.binlog_format from MIXED or ROW to
491-# STATEMENT when there are open temp tables and we are logging in row format.
492-# There is no error in any other case.
493-#
494-
495-source include/have_binlog_format_mixed.inc;
496-
497-SELECT @@SESSION.binlog_format;
498-CREATE TABLE t1 (a VARCHAR(100));
499-CREATE TEMPORARY TABLE t2 (a VARCHAR(100));
500-
501---echo # Test allow switching @@SESSION.binlog_format from MIXED to STATEMENT
502---echo # when there are open temp tables and we are logging in statement based format.
503-SET SESSION binlog_format = STATEMENT;
504-SELECT @@SESSION.binlog_format;
505-
506---echo # Test allow switching @@SESSION.binlog_format from STATEMENT to
507---echo # STATEMENT when there are open temp tables.
508-SET SESSION binlog_format = STATEMENT;
509-SELECT @@SESSION.binlog_format;
510-
511-INSERT INTO t1 VALUES ('statement based');
512-SELECT @@SESSION.binlog_format;
513---echo # Test allow switching @@SESSION.binlog_format from STATEMENT to
514---echo # MIXED when there are open temp tables.
515-SET SESSION binlog_format = MIXED;
516-SELECT @@SESSION.binlog_format;
517-
518---echo # Test allow switching @@SESSION.binlog_format from MIXED to MIXED
519---echo # when there are open temp tables.
520-SET SESSION binlog_format = MIXED;
521-SELECT @@SESSION.binlog_format;
522-
523-INSERT INTO t2 VALUES (UUID());
524-SELECT @@SESSION.binlog_format;
525-
526---echo # Test forbit switching @@SESSION.binlog_format from MIXED to STATEMENT
527---echo # when there are open temp tables and we are logging in row based format.
528---ERROR ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
529-SET SESSION binlog_format = STATEMENT;
530-SELECT @@SESSION.binlog_format;
531-
532-SET SESSION binlog_format = ROW;
533-SELECT @@SESSION.binlog_format;
534-
535-INSERT INTO t1 VALUES ('row based');
536---echo # Test allow switching @@SESSION.binlog_format from ROW to MIXED
537---echo # when there are open temp tables.
538-SET SESSION binlog_format = MIXED;
539-SELECT @@SESSION.binlog_format;
540-
541-INSERT INTO t1 VALUES ('row based');
542---echo # Test allow switching @@SESSION.binlog_format from MIXED to ROW
543---echo # when there are open temp tables.
544-SET SESSION binlog_format = ROW;
545-SELECT @@SESSION.binlog_format;
546-
547---echo # Test allow switching @@SESSION.binlog_format from ROW to ROW
548---echo # when there are open temp tables.
549-SET SESSION binlog_format = ROW;
550-SELECT @@SESSION.binlog_format;
551-
552-INSERT INTO t1 VALUES ('row based');
553---echo # Test forbit switching @@SESSION.binlog_format from ROW to STATEMENT
554---echo # when there are open temp tables.
555---ERROR ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
556-SET SESSION binlog_format = STATEMENT;
557-SELECT @@SESSION.binlog_format;
558-
559-DROP TEMPORARY TABLE t2;
560-DROP TABLE t1;
561-
562
563=== added file 'mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test'
564--- mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test 1970-01-01 00:00:00 +0000
565+++ mysql-test/suite/binlog/t/binlog_mix_drop_tmp_tbl.test 2014-10-22 21:45:42 +0000
566@@ -0,0 +1,4 @@
567+# This is a wrapper for binlog.test so that the same test case can be used
568+
569+-- source include/have_binlog_format_mixed.inc
570+-- source extra/binlog_tests/drop_temp_table.test
571
572=== added file 'mysql-test/suite/binlog/t/binlog_mix_tmp_table.test'
573--- mysql-test/suite/binlog/t/binlog_mix_tmp_table.test 1970-01-01 00:00:00 +0000
574+++ mysql-test/suite/binlog/t/binlog_mix_tmp_table.test 2014-10-22 21:45:42 +0000
575@@ -0,0 +1,2 @@
576+source include/have_binlog_format_mixed.inc;
577+source extra/binlog_tests/tmp_table.test;
578
579=== added file 'mysql-test/suite/binlog/t/binlog_row_tmp_table.test'
580--- mysql-test/suite/binlog/t/binlog_row_tmp_table.test 1970-01-01 00:00:00 +0000
581+++ mysql-test/suite/binlog/t/binlog_row_tmp_table.test 2014-10-22 21:45:42 +0000
582@@ -0,0 +1,2 @@
583+source include/have_binlog_format_row.inc;
584+source extra/binlog_tests/tmp_table.test;
585
586=== modified file 'mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test'
587--- mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test 2007-06-27 12:28:02 +0000
588+++ mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test 2014-10-22 21:45:42 +0000
589@@ -1,5 +1,4 @@
590 # This is a wrapper for binlog.test so that the same test case can be used
591-# For both statement and row based bin logs 9/19/2005 [jbm]
592
593--- source include/have_binlog_format_mixed_or_statement.inc
594+-- source include/have_binlog_format_statement.inc
595 -- source extra/binlog_tests/drop_temp_table.test
596
597=== added file 'mysql-test/suite/binlog/t/binlog_stm_tmp_table.test'
598--- mysql-test/suite/binlog/t/binlog_stm_tmp_table.test 1970-01-01 00:00:00 +0000
599+++ mysql-test/suite/binlog/t/binlog_stm_tmp_table.test 2014-10-22 21:45:42 +0000
600@@ -0,0 +1,2 @@
601+source include/have_binlog_format_statement.inc;
602+source extra/binlog_tests/tmp_table.test;
603
604=== added file 'mysql-test/suite/rpl/r/rpl_bug58546.result'
605--- mysql-test/suite/rpl/r/rpl_bug58546.result 1970-01-01 00:00:00 +0000
606+++ mysql-test/suite/rpl/r/rpl_bug58546.result 2014-10-22 21:45:42 +0000
607@@ -0,0 +1,44 @@
608+include/master-slave.inc
609+[connection master]
610+
611+# Bug#58546 test rpl_packet timeout failure sporadically on PB
612+# ----------------------------------------------------------------------
613+# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
614+# possible that IO thread stopped after replicating part of a transaction
615+# which SQL thread was executing. SQL thread would be hung if the
616+# transaction could not be rolled back safely.
617+# It caused some sporadic failures on PB2.
618+#
619+# This test verifies that when 'STOP SLAVE' is issued by a user, IO
620+# thread will continue to fetch the rest events of the transaction which
621+# is being executed by SQL thread and is not able to be rolled back safely.
622+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
623+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
624+INSERT INTO t1 VALUES(1, 1);
625+[connection master]
626+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
627+[connection slave]
628+include/restart_slave.inc
629+BEGIN;
630+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
631+[connection master]
632+BEGIN;
633+INSERT INTO t1 VALUES(2, 2);
634+INSERT INTO t2 VALUES(1);
635+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
636+COMMIT;
637+[connection slave1]
638+STOP SLAVE;
639+[connection slave]
640+ROLLBACK;
641+[connection master]
642+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
643+SET DEBUG_SYNC= 'RESET';
644+[connection slave]
645+include/wait_for_slave_to_stop.inc
646+[connection slave1]
647+include/start_slave.inc
648+[connection master]
649+DROP TABLE t1, t2;
650+SET GLOBAL debug= $debug_save;
651+include/rpl_end.inc
652
653=== added file 'mysql-test/suite/rpl/r/rpl_mix_drop_temp.result'
654--- mysql-test/suite/rpl/r/rpl_mix_drop_temp.result 1970-01-01 00:00:00 +0000
655+++ mysql-test/suite/rpl/r/rpl_mix_drop_temp.result 2014-10-22 21:45:42 +0000
656@@ -0,0 +1,40 @@
657+include/master-slave.inc
658+[connection master]
659+create database if not exists mysqltest;
660+use mysqltest;
661+create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
662+create temporary table mysqltest.t2 (n int)ENGINE=MyISAM;
663+show status like 'Slave_open_temp_tables';
664+Variable_name Value
665+Slave_open_temp_tables 0
666+drop database mysqltest;
667+DROP TEMPORARY TABLE IF EXISTS tmp1;
668+Warnings:
669+Note 1051 Unknown table 'tmp1'
670+CREATE TEMPORARY TABLE t1 ( a int );
671+DROP TEMPORARY TABLE t1, t2;
672+ERROR 42S02: Unknown table 't2'
673+DROP TEMPORARY TABLE tmp2;
674+ERROR 42S02: Unknown table 'tmp2'
675+stop slave;
676+**** On Master ****
677+CREATE TEMPORARY TABLE tmp3 (a int);
678+DROP TEMPORARY TABLE tmp3;
679+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
680+START SLAVE;
681+include/rpl_reset.inc
682+CREATE TABLE t1 ( i INT );
683+SHOW STATUS LIKE 'Slave_open_temp_tables';
684+Variable_name Value
685+Slave_open_temp_tables 0
686+CREATE TEMPORARY TABLE ttmp1 ( i INT );
687+SET SESSION binlog_format=ROW;
688+SHOW STATUS LIKE 'Slave_open_temp_tables';
689+Variable_name Value
690+Slave_open_temp_tables 0
691+show binlog events from <binlog_start>;
692+Log_name Pos Event_type Server_id End_log_pos Info
693+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i INT )
694+master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
695+DROP TABLE t1;
696+include/rpl_end.inc
697
698=== added file 'mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result'
699--- mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result 1970-01-01 00:00:00 +0000
700+++ mysql-test/suite/rpl/r/rpl_mix_rewrt_db.result 2014-10-22 21:45:42 +0000
701@@ -0,0 +1,218 @@
702+include/master-slave.inc
703+[connection master]
704+drop database if exists mysqltest1;
705+create database mysqltest1;
706+use mysqltest1;
707+create table t1 (a int);
708+insert into t1 values(9);
709+select * from mysqltest1.t1;
710+a
711+9
712+show databases like 'mysqltest1';
713+Database (mysqltest1)
714+mysqltest1
715+select * from test.t1;
716+a
717+9
718+drop table t1;
719+drop database mysqltest1;
720+drop database if exists rewrite;
721+create database rewrite;
722+use test;
723+create table t1 (a date, b date, c date not null, d date);
724+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
725+Warnings:
726+Warning 1265 Data truncated for column 'a' at row 1
727+Warning 1265 Data truncated for column 'c' at row 1
728+Warning 1265 Data truncated for column 'd' at row 1
729+Warning 1265 Data truncated for column 'a' at row 2
730+Warning 1265 Data truncated for column 'b' at row 2
731+Warning 1265 Data truncated for column 'd' at row 2
732+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
733+select * from rewrite.t1;
734+a b c d
735+0000-00-00 NULL 0000-00-00 0000-00-00
736+0000-00-00 0000-00-00 0000-00-00 0000-00-00
737+2003-03-03 2003-03-03 2003-03-03 NULL
738+2003-03-03 2003-03-03 2003-03-03 NULL
739+truncate table t1;
740+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
741+Warnings:
742+Warning 1265 Data truncated for column 'c' at row 1
743+Warning 1265 Data truncated for column 'd' at row 1
744+Warning 1265 Data truncated for column 'b' at row 2
745+Warning 1265 Data truncated for column 'd' at row 2
746+select * from rewrite.t1;
747+a b c d
748+NULL NULL 0000-00-00 0000-00-00
749+NULL 0000-00-00 0000-00-00 0000-00-00
750+NULL 2003-03-03 2003-03-03 NULL
751+drop table t1;
752+create table t1 (a text, b text);
753+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
754+Warnings:
755+Warning 1261 Row 3 doesn't contain data for all columns
756+select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
757+concat('|',a,'|') concat('|',b,'|')
758+|Field A| |Field B|
759+|Field 1| |Field 2'
760+Field 3,'Field 4|
761+|Field 5' ,'Field 6| NULL
762+|Field 6| | 'Field 7'|
763+drop table t1;
764+create table t1 (a int, b char(10));
765+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
766+Warnings:
767+Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
768+Warning 1262 Row 3 was truncated; it contained more data than there were input columns
769+Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5
770+Warning 1262 Row 5 was truncated; it contained more data than there were input columns
771+select * from rewrite.t1;
772+a b
773+1 row 1
774+2 row 2
775+0 1234567890
776+3 row 3
777+0 1234567890
778+truncate table t1;
779+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
780+Warnings:
781+Warning 1366 Incorrect integer value: '
782+' for column 'a' at row 4
783+Warning 1261 Row 4 doesn't contain data for all columns
784+select * from rewrite.t1;
785+a b
786+1 row 1
787+2 row 2
788+3 row 3
789+0
790+set sql_log_bin= 0;
791+drop database rewrite;
792+set sql_log_bin= 1;
793+set sql_log_bin= 0;
794+drop table t1;
795+set sql_log_bin= 1;
796+
797+****
798+**** Bug #46861 Auto-closing of temporary tables broken by replicate-rewrite-db
799+****
800+
801+****
802+**** Preparing the environment
803+****
804+SET sql_log_bin= 0;
805+CREATE DATABASE database_master_temp_01;
806+CREATE DATABASE database_master_temp_02;
807+CREATE DATABASE database_master_temp_03;
808+SET sql_log_bin= 1;
809+SET sql_log_bin= 0;
810+CREATE DATABASE database_slave_temp_01;
811+CREATE DATABASE database_slave_temp_02;
812+CREATE DATABASE database_slave_temp_03;
813+SET sql_log_bin= 1;
814+
815+****
816+**** Creating temporary tables on different databases with different connections
817+****
818+**** con_temp_01 --> creates
819+**** t_01_01_temp on database_master_temp_01
820+****
821+**** con_temp_02 --> creates
822+**** t_01_01_temp on database_master_temp_01
823+**** t_02_01_temp, t_02_02_temp on database_master_temp_02
824+****
825+**** con_temp_02 --> creates
826+**** t_01_01_temp on database_master_temp_01
827+**** t_02_01_temp, t_02_02_temp on database_master_temp_02
828+**** t_03_01_temp, t_03_02_temp, t_03_03_temp on database_master_temp_03
829+****
830+
831+con_temp_01
832+
833+USE database_master_temp_01;
834+CREATE TEMPORARY TABLE t_01_01_temp(a int);
835+INSERT INTO t_01_01_temp VALUES(1);
836+
837+con_temp_02
838+
839+USE database_master_temp_01;
840+CREATE TEMPORARY TABLE t_01_01_temp(a int);
841+INSERT INTO t_01_01_temp VALUES(1);
842+USE database_master_temp_02;
843+CREATE TEMPORARY TABLE t_02_01_temp(a int);
844+INSERT INTO t_02_01_temp VALUES(1);
845+CREATE TEMPORARY TABLE t_02_02_temp(a int);
846+INSERT INTO t_02_02_temp VALUES(1);
847+
848+con_temp_03
849+
850+USE database_master_temp_01;
851+CREATE TEMPORARY TABLE t_01_01_temp(a int);
852+INSERT INTO t_01_01_temp VALUES(1);
853+USE database_master_temp_02;
854+CREATE TEMPORARY TABLE t_02_01_temp(a int);
855+INSERT INTO t_02_01_temp VALUES(1);
856+CREATE TEMPORARY TABLE t_02_02_temp(a int);
857+INSERT INTO t_02_02_temp VALUES(1);
858+USE database_master_temp_03;
859+CREATE TEMPORARY TABLE t_03_01_temp(a int);
860+INSERT INTO t_03_01_temp VALUES(1);
861+CREATE TEMPORARY TABLE t_03_02_temp(a int);
862+INSERT INTO t_03_02_temp VALUES(1);
863+CREATE TEMPORARY TABLE t_03_03_temp(a int);
864+INSERT INTO t_03_03_temp VALUES(1);
865+
866+**** Dropping the connections
867+**** We want to SHOW BINLOG EVENTS, to know what was logged. But there is no
868+**** guarantee that logging of the terminated con1 has been done yet.a To be
869+**** sure that logging has been done, we use a user lock.
870+
871+show status like 'Slave_open_temp_tables';
872+Variable_name Value
873+Slave_open_temp_tables 0
874+select get_lock("con_01",10);
875+get_lock("con_01",10)
876+1
877+select get_lock("con_01",10);
878+get_lock("con_01",10)
879+1
880+select get_lock("con_02",10);
881+get_lock("con_02",10)
882+1
883+select get_lock("con_02",10);
884+get_lock("con_02",10)
885+1
886+select get_lock("con_03",10);
887+get_lock("con_03",10)
888+1
889+select get_lock("con_03",10);
890+get_lock("con_03",10)
891+1
892+
893+**** Checking the binary log and temporary tables
894+
895+show status like 'Slave_open_temp_tables';
896+Variable_name Value
897+Slave_open_temp_tables 0
898+show binlog events from <binlog_start>;
899+Log_name Pos Event_type Server_id End_log_pos Info
900+master-bin.000001 # Query # # use `database_master_temp_01`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t_01_01_temp`
901+master-bin.000001 # Query # # use `database_master_temp_02`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t_02_02_temp`,`t_02_01_temp`
902+master-bin.000001 # Query # # use `database_master_temp_01`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t_01_01_temp`
903+master-bin.000001 # Query # # use `database_master_temp_03`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t_03_03_temp`,`t_03_02_temp`,`t_03_01_temp`
904+master-bin.000001 # Query # # use `database_master_temp_02`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t_02_02_temp`,`t_02_01_temp`
905+master-bin.000001 # Query # # use `database_master_temp_01`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t_01_01_temp`
906+****
907+**** Cleaning up the test case
908+****
909+SET sql_log_bin= 0;
910+DROP DATABASE database_master_temp_01;
911+DROP DATABASE database_master_temp_02;
912+DROP DATABASE database_master_temp_03;
913+SET sql_log_bin= 1;
914+SET sql_log_bin= 0;
915+DROP DATABASE database_slave_temp_01;
916+DROP DATABASE database_slave_temp_02;
917+DROP DATABASE database_slave_temp_03;
918+SET sql_log_bin= 1;
919+include/rpl_end.inc
920
921=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result'
922--- mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result 2013-09-26 19:54:16 +0000
923+++ mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result 2014-10-22 21:45:42 +0000
924@@ -53,14 +53,14 @@
925 DROP TEMPORARY TABLE tt_tmp_2;
926 -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
927 Log_name Pos Event_type Server_id End_log_pos Info
928-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
929+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
930 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
931
932 SET @commands= 'Drop-Temp-N-Temp';
933 DROP TEMPORARY TABLE nt_tmp_2;
934 -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-
935 Log_name Pos Event_type Server_id End_log_pos Info
936-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
937+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
938 -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-
939
940 SET @commands= 'Drop-Temp-Xe-Temp';
941@@ -84,7 +84,7 @@
942 ERROR 42S02: Unknown table 'tt_1'
943 -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-
944 Log_name Pos Event_type Server_id End_log_pos Info
945-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
946+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
947 -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-
948
949 SET @commands= 'Drop-Temp-If-TXe-Temp';
950@@ -101,7 +101,7 @@
951 ERROR 42S02: Unknown table 'tt_1'
952 -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-
953 Log_name Pos Event_type Server_id End_log_pos Info
954-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
955+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
956 -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-
957
958 SET @commands= 'Drop-Temp-If-NXe-Temp';
959@@ -118,22 +118,22 @@
960 DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
961 -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-
962 Log_name Pos Event_type Server_id End_log_pos Info
963-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
964-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
965+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
966+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
967 -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-
968
969 SET @commands= 'Drop-Temp-TT-Temp';
970 DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
971 -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-
972 Log_name Pos Event_type Server_id End_log_pos Info
973-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
974+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
975 -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-
976
977 SET @commands= 'Drop-Temp-NN-Temp';
978 DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2;
979 -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-
980 Log_name Pos Event_type Server_id End_log_pos Info
981-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */
982+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
983 -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-
984
985
986@@ -149,7 +149,7 @@
987 Log_name Pos Event_type Server_id End_log_pos Info
988 master-bin.000001 # Query # # BEGIN
989 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
990-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
991+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
992 master-bin.000001 # Xid # # COMMIT /* XID */
993 -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-
994
995@@ -167,8 +167,8 @@
996 master-bin.000001 # Query # # COMMIT
997 master-bin.000001 # Query # # BEGIN
998 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
999-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1000-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1001+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1002+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1003 master-bin.000001 # Xid # # COMMIT /* XID */
1004 -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-
1005
1006@@ -180,7 +180,7 @@
1007 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1008 Log_name Pos Event_type Server_id End_log_pos Info
1009 master-bin.000001 # Query # # BEGIN
1010-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1011+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1012 master-bin.000001 # Query # # COMMIT
1013 master-bin.000001 # Query # # BEGIN
1014 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1015@@ -197,13 +197,13 @@
1016 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1017 Log_name Pos Event_type Server_id End_log_pos Info
1018 master-bin.000001 # Query # # BEGIN
1019-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1020+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1021 master-bin.000001 # Query # # COMMIT
1022 master-bin.000001 # Query # # BEGIN
1023 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1024 master-bin.000001 # Query # # COMMIT
1025 master-bin.000001 # Query # # BEGIN
1026-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1027+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1028 master-bin.000001 # Query # # COMMIT
1029 master-bin.000001 # Query # # BEGIN
1030 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1031@@ -290,7 +290,7 @@
1032 Log_name Pos Event_type Server_id End_log_pos Info
1033 master-bin.000001 # Query # # BEGIN
1034 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1035-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1036+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1037 master-bin.000001 # Xid # # COMMIT /* XID */
1038 -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-
1039
1040@@ -310,8 +310,8 @@
1041 master-bin.000001 # Query # # COMMIT
1042 master-bin.000001 # Query # # BEGIN
1043 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1044-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1045-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1046+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1047+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1048 master-bin.000001 # Xid # # COMMIT /* XID */
1049 -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-
1050
1051@@ -362,7 +362,7 @@
1052 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1053 Log_name Pos Event_type Server_id End_log_pos Info
1054 master-bin.000001 # Query # # BEGIN
1055-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1056+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1057 master-bin.000001 # Query # # COMMIT
1058 master-bin.000001 # Query # # BEGIN
1059 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1060@@ -381,13 +381,13 @@
1061 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1062 Log_name Pos Event_type Server_id End_log_pos Info
1063 master-bin.000001 # Query # # BEGIN
1064-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1065+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1066 master-bin.000001 # Query # # COMMIT
1067 master-bin.000001 # Query # # BEGIN
1068 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1069 master-bin.000001 # Query # # COMMIT
1070 master-bin.000001 # Query # # BEGIN
1071-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1072+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1073 master-bin.000001 # Query # # COMMIT
1074 master-bin.000001 # Query # # BEGIN
1075 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1076@@ -449,11 +449,11 @@
1077 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1078 Log_name Pos Event_type Server_id End_log_pos Info
1079 master-bin.000001 # Query # # BEGIN
1080-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1081+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1082 master-bin.000001 # Query # # COMMIT
1083 master-bin.000001 # Query # # BEGIN
1084 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1085-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1086+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1087 master-bin.000001 # Xid # # COMMIT /* XID */
1088 -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-
1089
1090@@ -467,18 +467,18 @@
1091 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1092 Log_name Pos Event_type Server_id End_log_pos Info
1093 master-bin.000001 # Query # # BEGIN
1094-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1095+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1096 master-bin.000001 # Query # # COMMIT
1097 master-bin.000001 # Query # # BEGIN
1098 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1099 master-bin.000001 # Query # # COMMIT
1100 master-bin.000001 # Query # # BEGIN
1101-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1102+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1103 master-bin.000001 # Query # # COMMIT
1104 master-bin.000001 # Query # # BEGIN
1105 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1106-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1107-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1108+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1109+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1110 master-bin.000001 # Xid # # COMMIT /* XID */
1111 -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-
1112
1113@@ -491,7 +491,7 @@
1114 Log_name Pos Event_type Server_id End_log_pos Info
1115 master-bin.000001 # Query # # BEGIN
1116 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1117-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
1118+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
1119 master-bin.000001 # Xid # # COMMIT /* XID */
1120 -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-
1121
1122@@ -508,7 +508,7 @@
1123 master-bin.000001 # Query # # COMMIT
1124 master-bin.000001 # Query # # BEGIN
1125 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1126-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
1127+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
1128 master-bin.000001 # Xid # # COMMIT /* XID */
1129 -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-
1130
1131@@ -520,7 +520,7 @@
1132 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1133 Log_name Pos Event_type Server_id End_log_pos Info
1134 master-bin.000001 # Query # # BEGIN
1135-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */
1136+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
1137 master-bin.000001 # Query # # COMMIT
1138 master-bin.000001 # Query # # BEGIN
1139 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1140@@ -536,7 +536,7 @@
1141 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1142 Log_name Pos Event_type Server_id End_log_pos Info
1143 master-bin.000001 # Query # # BEGIN
1144-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */
1145+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
1146 master-bin.000001 # Query # # COMMIT
1147 master-bin.000001 # Query # # BEGIN
1148 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1149@@ -559,7 +559,7 @@
1150 Log_name Pos Event_type Server_id End_log_pos Info
1151 master-bin.000001 # Query # # BEGIN
1152 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1153-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1154+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1155 master-bin.000001 # Query # # ROLLBACK
1156 -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-
1157
1158@@ -579,8 +579,8 @@
1159 master-bin.000001 # Query # # COMMIT
1160 master-bin.000001 # Query # # BEGIN
1161 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1162-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1163-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1164+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1165+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1166 master-bin.000001 # Query # # ROLLBACK
1167 -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-
1168
1169@@ -592,7 +592,7 @@
1170 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1171 Log_name Pos Event_type Server_id End_log_pos Info
1172 master-bin.000001 # Query # # BEGIN
1173-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1174+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1175 master-bin.000001 # Query # # COMMIT
1176 master-bin.000001 # Query # # BEGIN
1177 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1178@@ -611,13 +611,13 @@
1179 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1180 Log_name Pos Event_type Server_id End_log_pos Info
1181 master-bin.000001 # Query # # BEGIN
1182-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1183+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1184 master-bin.000001 # Query # # COMMIT
1185 master-bin.000001 # Query # # BEGIN
1186 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1187 master-bin.000001 # Query # # COMMIT
1188 master-bin.000001 # Query # # BEGIN
1189-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1190+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1191 master-bin.000001 # Query # # COMMIT
1192 master-bin.000001 # Query # # BEGIN
1193 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1194@@ -708,7 +708,7 @@
1195 Log_name Pos Event_type Server_id End_log_pos Info
1196 master-bin.000001 # Query # # BEGIN
1197 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1198-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1199+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1200 master-bin.000001 # Query # # ROLLBACK
1201 -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-
1202
1203@@ -730,8 +730,8 @@
1204 master-bin.000001 # Query # # COMMIT
1205 master-bin.000001 # Query # # BEGIN
1206 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1207-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1208-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1209+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1210+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1211 master-bin.000001 # Query # # ROLLBACK
1212 -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-
1213
1214@@ -784,7 +784,7 @@
1215 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1216 Log_name Pos Event_type Server_id End_log_pos Info
1217 master-bin.000001 # Query # # BEGIN
1218-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1219+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1220 master-bin.000001 # Query # # COMMIT
1221 master-bin.000001 # Query # # BEGIN
1222 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1223@@ -805,13 +805,13 @@
1224 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1225 Log_name Pos Event_type Server_id End_log_pos Info
1226 master-bin.000001 # Query # # BEGIN
1227-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1228+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1229 master-bin.000001 # Query # # COMMIT
1230 master-bin.000001 # Query # # BEGIN
1231 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1232 master-bin.000001 # Query # # COMMIT
1233 master-bin.000001 # Query # # BEGIN
1234-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1235+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1236 master-bin.000001 # Query # # COMMIT
1237 master-bin.000001 # Query # # BEGIN
1238 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1239@@ -875,11 +875,11 @@
1240 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1241 Log_name Pos Event_type Server_id End_log_pos Info
1242 master-bin.000001 # Query # # BEGIN
1243-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1244+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1245 master-bin.000001 # Query # # COMMIT
1246 master-bin.000001 # Query # # BEGIN
1247 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1248-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1249+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1250 master-bin.000001 # Query # # ROLLBACK
1251 -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-
1252
1253@@ -895,18 +895,18 @@
1254 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1255 Log_name Pos Event_type Server_id End_log_pos Info
1256 master-bin.000001 # Query # # BEGIN
1257-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1258+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1259 master-bin.000001 # Query # # COMMIT
1260 master-bin.000001 # Query # # BEGIN
1261 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1262 master-bin.000001 # Query # # COMMIT
1263 master-bin.000001 # Query # # BEGIN
1264-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1265+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1266 master-bin.000001 # Query # # COMMIT
1267 master-bin.000001 # Query # # BEGIN
1268 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1269-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1270-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1271+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1272+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1273 master-bin.000001 # Query # # ROLLBACK
1274 -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-
1275
1276@@ -919,7 +919,7 @@
1277 Log_name Pos Event_type Server_id End_log_pos Info
1278 master-bin.000001 # Query # # BEGIN
1279 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1280-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
1281+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
1282 master-bin.000001 # Query # # ROLLBACK
1283 -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-
1284
1285@@ -938,7 +938,7 @@
1286 master-bin.000001 # Query # # COMMIT
1287 master-bin.000001 # Query # # BEGIN
1288 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1289-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
1290+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
1291 master-bin.000001 # Query # # ROLLBACK
1292 -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-
1293
1294@@ -950,7 +950,7 @@
1295 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1296 Log_name Pos Event_type Server_id End_log_pos Info
1297 master-bin.000001 # Query # # BEGIN
1298-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */
1299+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
1300 master-bin.000001 # Query # # COMMIT
1301 master-bin.000001 # Query # # BEGIN
1302 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1303@@ -968,7 +968,7 @@
1304 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1305 Log_name Pos Event_type Server_id End_log_pos Info
1306 master-bin.000001 # Query # # BEGIN
1307-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1`,`nt_tmp_2` /* generated by server */
1308+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
1309 master-bin.000001 # Query # # COMMIT
1310 master-bin.000001 # Query # # BEGIN
1311 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1312@@ -1074,8 +1074,8 @@
1313 DROP TABLE tt_tmp_2, nt_tmp_2, nt_2;
1314 -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-
1315 Log_name Pos Event_type Server_id End_log_pos Info
1316-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1317-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1318+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1319+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1320 master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */
1321 -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-
1322
1323@@ -1083,8 +1083,8 @@
1324 DROP TABLE tt_tmp_2, nt_tmp_2;
1325 -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-
1326 Log_name Pos Event_type Server_id End_log_pos Info
1327-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1328-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1329+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1330+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1331 -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-
1332
1333
1334@@ -1240,8 +1240,8 @@
1335 master-bin.000001 # Query # # BEGIN
1336 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1337 master-bin.000001 # Xid # # COMMIT /* XID */
1338-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1339-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1340+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1341+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1342 master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */
1343 -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-
1344
1345@@ -1254,8 +1254,8 @@
1346 master-bin.000001 # Query # # BEGIN
1347 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1348 master-bin.000001 # Xid # # COMMIT /* XID */
1349-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1350-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1351+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1352+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1353 -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-
1354
1355 #########################################################################
1356@@ -1272,10 +1272,9 @@
1357 DROP TEMPORARY TABLE nt_tmp_2;
1358 -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-
1359 Log_name Pos Event_type Server_id End_log_pos Info
1360-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1361-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam
1362-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1363-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1364+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1365+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1366+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1367 -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-
1368
1369 SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp';
1370@@ -1285,10 +1284,9 @@
1371 DROP TEMPORARY TABLE tt_tmp_2;
1372 -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-
1373 Log_name Pos Event_type Server_id End_log_pos Info
1374-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1375-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
1376-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1377-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1378+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1379+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1380+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1381 -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-
1382
1383
1384@@ -1306,16 +1304,13 @@
1385 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1386 Log_name Pos Event_type Server_id End_log_pos Info
1387 master-bin.000001 # Query # # BEGIN
1388-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1389-master-bin.000001 # Query # # COMMIT
1390-master-bin.000001 # Query # # BEGIN
1391-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam
1392-master-bin.000001 # Query # # COMMIT
1393-master-bin.000001 # Query # # BEGIN
1394-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1395-master-bin.000001 # Query # # COMMIT
1396-master-bin.000001 # Query # # BEGIN
1397-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1398+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1399+master-bin.000001 # Query # # COMMIT
1400+master-bin.000001 # Query # # BEGIN
1401+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1402+master-bin.000001 # Query # # COMMIT
1403+master-bin.000001 # Query # # BEGIN
1404+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1405 master-bin.000001 # Query # # COMMIT
1406 master-bin.000001 # Query # # BEGIN
1407 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1408@@ -1332,10 +1327,9 @@
1409 -b-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 C << -b-b-b-b-b-b-b-b-b-b-b-
1410 Log_name Pos Event_type Server_id End_log_pos Info
1411 master-bin.000001 # Query # # BEGIN
1412-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1413-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
1414-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1415-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1416+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1417+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1418+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1419 master-bin.000001 # Query # # COMMIT
1420 -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-
1421
1422@@ -1354,16 +1348,13 @@
1423 -b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1424 Log_name Pos Event_type Server_id End_log_pos Info
1425 master-bin.000001 # Query # # BEGIN
1426-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1427-master-bin.000001 # Query # # COMMIT
1428-master-bin.000001 # Query # # BEGIN
1429-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam
1430-master-bin.000001 # Query # # COMMIT
1431-master-bin.000001 # Query # # BEGIN
1432-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_1` /* generated by server */
1433-master-bin.000001 # Query # # COMMIT
1434-master-bin.000001 # Query # # BEGIN
1435-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
1436+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1437+master-bin.000001 # Query # # COMMIT
1438+master-bin.000001 # Query # # BEGIN
1439+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
1440+master-bin.000001 # Query # # COMMIT
1441+master-bin.000001 # Query # # BEGIN
1442+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
1443 master-bin.000001 # Query # # COMMIT
1444 master-bin.000001 # Query # # BEGIN
1445 master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
1446@@ -1380,10 +1371,9 @@
1447 -b-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 R << -b-b-b-b-b-b-b-b-b-b-b-
1448 Log_name Pos Event_type Server_id End_log_pos Info
1449 master-bin.000001 # Query # # BEGIN
1450-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1451-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
1452-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1` /* generated by server */
1453-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
1454+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1455+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
1456+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
1457 master-bin.000001 # Query # # ROLLBACK
1458 -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-
1459
1460@@ -1407,13 +1397,8 @@
1461 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1462 master-bin.000001 # Query # # COMMIT
1463 master-bin.000001 # Query # # BEGIN
1464-master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
1465-master-bin.000001 # Query # # COMMIT
1466-master-bin.000001 # Query # # BEGIN
1467-master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1
1468-master-bin.000001 # Query # # COMMIT
1469-master-bin.000001 # Query # # BEGIN
1470-master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
1471+master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1472+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1473 master-bin.000001 # Query # # COMMIT
1474 -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-
1475
1476@@ -1430,9 +1415,6 @@
1477 master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1478 master-bin.000001 # Query # # COMMIT
1479 master-bin.000001 # Query # # BEGIN
1480-master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
1481-master-bin.000001 # Query # # COMMIT
1482-master-bin.000001 # Query # # BEGIN
1483 master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
1484 master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1485 master-bin.000001 # Xid # # COMMIT /* XID */
1486@@ -1448,8 +1430,7 @@
1487 -b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1488 Log_name Pos Event_type Server_id End_log_pos Info
1489 master-bin.000001 # Query # # BEGIN
1490-master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1491-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1492+master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1493 master-bin.000001 # Query # # COMMIT
1494 -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-
1495
1496@@ -1463,8 +1444,7 @@
1497 -b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b-
1498 Log_name Pos Event_type Server_id End_log_pos Info
1499 master-bin.000001 # Query # # BEGIN
1500-master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1501-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1502+master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1503 master-bin.000001 # Query # # COMMIT
1504 -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-
1505
1506@@ -1485,8 +1465,7 @@
1507 -b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1508 Log_name Pos Event_type Server_id End_log_pos Info
1509 master-bin.000001 # Query # # BEGIN
1510-master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1511-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1512+master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1513 master-bin.000001 # Query # # COMMIT
1514 master-bin.000001 # Query # # BEGIN
1515 master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1516@@ -1506,8 +1485,7 @@
1517 -b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1518 Log_name Pos Event_type Server_id End_log_pos Info
1519 master-bin.000001 # Query # # BEGIN
1520-master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1521-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1522+master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1523 master-bin.000001 # Query # # COMMIT
1524 -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-
1525
1526@@ -1523,8 +1501,7 @@
1527 -b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1528 Log_name Pos Event_type Server_id End_log_pos Info
1529 master-bin.000001 # Query # # BEGIN
1530-master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1531-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1532+master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1533 master-bin.000001 # Query # # COMMIT
1534 -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-
1535
1536@@ -1540,8 +1517,7 @@
1537 -b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b-
1538 Log_name Pos Event_type Server_id End_log_pos Info
1539 master-bin.000001 # Query # # BEGIN
1540-master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1)
1541-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1542+master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1)
1543 master-bin.000001 # Query # # COMMIT
1544 -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-
1545
1546
1547=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result'
1548--- mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result 2013-07-27 12:05:02 +0000
1549+++ mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result 2014-10-22 21:45:42 +0000
1550@@ -390,7 +390,6 @@
1551 Log_name Pos Event_type Server_id End_log_pos Info
1552 master-bin.000001 # Query # # BEGIN
1553 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11)
1554-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int)
1555 master-bin.000001 # Xid # # COMMIT /* XID */
1556 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
1557
1558@@ -401,8 +400,7 @@
1559 -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
1560 Log_name Pos Event_type Server_id End_log_pos Info
1561 master-bin.000001 # Query # # BEGIN
1562-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
1563-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1564+master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (10)
1565 master-bin.000001 # Xid # # COMMIT /* XID */
1566 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
1567
1568@@ -413,8 +411,7 @@
1569 -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
1570 Log_name Pos Event_type Server_id End_log_pos Info
1571 master-bin.000001 # Query # # BEGIN
1572-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
1573-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1574+master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (9)
1575 master-bin.000001 # Xid # # COMMIT /* XID */
1576 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
1577
1578@@ -425,8 +422,7 @@
1579 -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
1580 Log_name Pos Event_type Server_id End_log_pos Info
1581 master-bin.000001 # Query # # BEGIN
1582-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
1583-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1584+master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8)
1585 master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */
1586 master-bin.000001 # Xid # # COMMIT /* XID */
1587 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
1588
1589=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result'
1590--- mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result 2013-07-27 12:05:02 +0000
1591+++ mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result 2014-10-22 21:45:42 +0000
1592@@ -11290,14 +11290,12 @@
1593 Log_name Pos Event_type Server_id End_log_pos Info
1594 master-bin.000001 # Query # # BEGIN
1595 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2)
1596-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb
1597 master-bin.000001 # Query # # ROLLBACK
1598 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1599 -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-
1600 Log_name Pos Event_type Server_id End_log_pos Info
1601 master-bin.000001 # Query # # BEGIN
1602 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2)
1603-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb
1604 master-bin.000001 # Query # # ROLLBACK
1605 -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-
1606
1607@@ -11344,7 +11342,6 @@
1608 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
1609 master-bin.000001 # Query # # SAVEPOINT `s1`
1610 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
1611-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
1612 master-bin.000001 # Query # # ROLLBACK TO `s1`
1613 master-bin.000001 # Query # # ROLLBACK
1614 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1615@@ -11354,7 +11351,6 @@
1616 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
1617 master-bin.000001 # Query # # SAVEPOINT `s1`
1618 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
1619-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
1620 master-bin.000001 # Query # # ROLLBACK TO `s1`
1621 master-bin.000001 # Query # # ROLLBACK
1622 -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
1623@@ -11390,7 +11386,6 @@
1624 Log_name Pos Event_type Server_id End_log_pos Info
1625 master-bin.000001 # Query # # BEGIN
1626 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2)
1627-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb
1628 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5)
1629 master-bin.000001 # Query # # ROLLBACK
1630 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1631@@ -11398,7 +11393,6 @@
1632 Log_name Pos Event_type Server_id End_log_pos Info
1633 master-bin.000001 # Query # # BEGIN
1634 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2)
1635-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb
1636 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5)
1637 master-bin.000001 # Query # # ROLLBACK
1638 -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-
1639@@ -11438,7 +11432,6 @@
1640 Warning 1196 Some non-transactional changed tables couldn't be rolled back
1641 Log_name Pos Event_type Server_id End_log_pos Info
1642 master-bin.000001 # Query # # BEGIN
1643-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb
1644 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5)
1645 master-bin.000001 # Query # # ROLLBACK
1646 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1647@@ -11448,7 +11441,6 @@
1648 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1
1649 master-bin.000001 # Query # # COMMIT
1650 master-bin.000001 # Query # # BEGIN
1651-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb
1652 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5)
1653 master-bin.000001 # Query # # ROLLBACK
1654 -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-
1655@@ -11479,14 +11471,12 @@
1656 ROLLBACK;
1657 Log_name Pos Event_type Server_id End_log_pos Info
1658 master-bin.000001 # Query # # BEGIN
1659-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb
1660 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3)
1661 master-bin.000001 # Query # # ROLLBACK
1662 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1663 -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-
1664 Log_name Pos Event_type Server_id End_log_pos Info
1665 master-bin.000001 # Query # # BEGIN
1666-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb
1667 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3)
1668 master-bin.000001 # Query # # ROLLBACK
1669 -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-
1670@@ -11526,7 +11516,6 @@
1671 Warning 1196 Some non-transactional changed tables couldn't be rolled back
1672 Log_name Pos Event_type Server_id End_log_pos Info
1673 master-bin.000001 # Query # # BEGIN
1674-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb
1675 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5)
1676 master-bin.000001 # Query # # ROLLBACK
1677 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1678@@ -11536,7 +11525,6 @@
1679 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2)
1680 master-bin.000001 # Query # # COMMIT
1681 master-bin.000001 # Query # # BEGIN
1682-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb
1683 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5)
1684 master-bin.000001 # Query # # ROLLBACK
1685 -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-
1686
1687=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result'
1688--- mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result 2013-07-27 12:05:02 +0000
1689+++ mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result 2014-10-22 21:45:42 +0000
1690@@ -11662,14 +11662,12 @@
1691 Log_name Pos Event_type Server_id End_log_pos Info
1692 master-bin.000001 # Query # # BEGIN
1693 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2)
1694-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb
1695 master-bin.000001 # Query # # ROLLBACK
1696 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1697 -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-
1698 Log_name Pos Event_type Server_id End_log_pos Info
1699 master-bin.000001 # Query # # BEGIN
1700 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2)
1701-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb
1702 master-bin.000001 # Query # # ROLLBACK
1703 -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-
1704
1705@@ -11716,7 +11714,6 @@
1706 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
1707 master-bin.000001 # Query # # SAVEPOINT `s1`
1708 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
1709-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
1710 master-bin.000001 # Query # # ROLLBACK TO `s1`
1711 master-bin.000001 # Query # # ROLLBACK
1712 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1713@@ -11726,7 +11723,6 @@
1714 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
1715 master-bin.000001 # Query # # SAVEPOINT `s1`
1716 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
1717-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
1718 master-bin.000001 # Query # # ROLLBACK TO `s1`
1719 master-bin.000001 # Query # # ROLLBACK
1720 -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
1721@@ -11762,7 +11758,6 @@
1722 Log_name Pos Event_type Server_id End_log_pos Info
1723 master-bin.000001 # Query # # BEGIN
1724 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2)
1725-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb
1726 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5)
1727 master-bin.000001 # Query # # ROLLBACK
1728 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1729@@ -11770,7 +11765,6 @@
1730 Log_name Pos Event_type Server_id End_log_pos Info
1731 master-bin.000001 # Query # # BEGIN
1732 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2)
1733-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb
1734 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5)
1735 master-bin.000001 # Query # # ROLLBACK
1736 -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-
1737@@ -11810,7 +11804,6 @@
1738 Warning 1196 Some non-transactional changed tables couldn't be rolled back
1739 Log_name Pos Event_type Server_id End_log_pos Info
1740 master-bin.000001 # Query # # BEGIN
1741-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb
1742 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5)
1743 master-bin.000001 # Query # # ROLLBACK
1744 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1745@@ -11820,7 +11813,6 @@
1746 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1
1747 master-bin.000001 # Query # # COMMIT
1748 master-bin.000001 # Query # # BEGIN
1749-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb
1750 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5)
1751 master-bin.000001 # Query # # ROLLBACK
1752 -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-
1753@@ -11851,14 +11843,12 @@
1754 ROLLBACK;
1755 Log_name Pos Event_type Server_id End_log_pos Info
1756 master-bin.000001 # Query # # BEGIN
1757-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb
1758 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3)
1759 master-bin.000001 # Query # # ROLLBACK
1760 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1761 -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-
1762 Log_name Pos Event_type Server_id End_log_pos Info
1763 master-bin.000001 # Query # # BEGIN
1764-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb
1765 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3)
1766 master-bin.000001 # Query # # ROLLBACK
1767 -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-
1768@@ -11898,7 +11888,6 @@
1769 Warning 1196 Some non-transactional changed tables couldn't be rolled back
1770 Log_name Pos Event_type Server_id End_log_pos Info
1771 master-bin.000001 # Query # # BEGIN
1772-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb
1773 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5)
1774 master-bin.000001 # Query # # ROLLBACK
1775 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
1776@@ -11908,7 +11897,6 @@
1777 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2)
1778 master-bin.000001 # Query # # COMMIT
1779 master-bin.000001 # Query # # BEGIN
1780-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb
1781 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5)
1782 master-bin.000001 # Query # # ROLLBACK
1783 -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-
1784
1785=== renamed file 'mysql-test/suite/rpl/r/rpl_drop_temp.result' => 'mysql-test/suite/rpl/r/rpl_stm_drop_temp.result'
1786=== renamed file 'mysql-test/suite/rpl/r/rpl_rewrt_db.result' => 'mysql-test/suite/rpl/r/rpl_stm_rewrt_db.result'
1787=== modified file 'mysql-test/suite/rpl/r/rpl_stop_slave.result'
1788--- mysql-test/suite/rpl/r/rpl_stop_slave.result 2014-06-26 11:54:27 +0000
1789+++ mysql-test/suite/rpl/r/rpl_stop_slave.result 2014-10-22 21:45:42 +0000
1790@@ -78,50 +78,4 @@
1791 call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
1792 [connection master]
1793 DROP TABLE t1, t2;
1794-
1795-# Bug#58546 test rpl_packet timeout failure sporadically on PB
1796-# ----------------------------------------------------------------------
1797-# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
1798-# possible that IO thread stopped after replicating part of a transaction
1799-# which SQL thread was executing. SQL thread would be hung if the
1800-# transaction could not be rolled back safely.
1801-# It caused some sporadic failures on PB2.
1802-#
1803-# This test verifies that when 'STOP SLAVE' is issued by a user, IO
1804-# thread will continue to fetch the rest events of the transaction which
1805-# is being executed by SQL thread and is not able to be rolled back safely.
1806-CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
1807-CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
1808-INSERT INTO t1 VALUES(1, 1);
1809-include/stop_slave.inc
1810-[connection master]
1811-include/stop_dump_threads.inc
1812-SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
1813-[connection slave]
1814-include/start_slave.inc
1815-BEGIN;
1816-UPDATE t1 SET c2 = 2 WHERE c1 = 1;
1817-[connection master]
1818-BEGIN;
1819-INSERT INTO t1 VALUES(2, 2);
1820-INSERT INTO t2 VALUES(1);
1821-UPDATE t1 SET c2 = 3 WHERE c1 = 1;
1822-COMMIT;
1823-[connection slave1]
1824-STOP SLAVE;
1825-[connection slave]
1826-ROLLBACK;
1827-[connection master]
1828-SET DEBUG_SYNC= 'now SIGNAL signal.continue';
1829-SET DEBUG_SYNC= 'RESET';
1830-[connection slave]
1831-include/wait_for_slave_to_stop.inc
1832-[connection slave1]
1833-[connection master]
1834-SET GLOBAL debug= '$debug_save';
1835-include/stop_dump_threads.inc
1836-[connection slave1]
1837-include/start_slave.inc
1838-[connection master]
1839-DROP TABLE t1, t2;
1840 include/rpl_end.inc
1841
1842=== removed file 'mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result'
1843--- mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result 2013-07-27 12:05:02 +0000
1844+++ mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result 1970-01-01 00:00:00 +0000
1845@@ -1,111 +0,0 @@
1846-include/master-slave.inc
1847-[connection master]
1848-==== Initialize ====
1849-[on master]
1850-CREATE TABLE t1 (a CHAR(48));
1851-CREATE TEMPORARY TABLE t1_tmp1(a INT);
1852-INSERT INTO t1 VALUES (UUID());
1853-[on slave]
1854-==== Verify results on slave ====
1855-SHOW STATUS LIKE "Slave_open_temp_tables";
1856-Variable_name Value
1857-Slave_open_temp_tables 1
1858-[on master]
1859-[on master1]
1860-[on slave]
1861-==== Verify results on slave ====
1862-SHOW STATUS LIKE "Slave_open_temp_tables";
1863-Variable_name Value
1864-Slave_open_temp_tables 0
1865-==== Clean up ====
1866-[on master]
1867-include/rpl_connect.inc [creating master]
1868-DROP TABLE t1;
1869-[on slave]
1870-include/rpl_reset.inc
1871-CREATE TABLE t1 (a int);
1872-CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
1873-CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
1874-CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ();
1875-CREATE TEMPORARY TABLE t1_tmp (i1 int);
1876-ALTER TABLE t1_tmp ADD COLUMN b INT;
1877-DELETE FROM t2;
1878-CREATE TEMPORARY TABLE t2_tmp (a int);
1879-ALTER TABLE t1_tmp ADD COLUMN c INT;
1880-### assertion: assert that there is one open temp table on slave
1881-SHOW STATUS LIKE 'Slave_open_temp_tables';
1882-Variable_name Value
1883-Slave_open_temp_tables 1
1884-DROP TABLE t1_tmp, t2;
1885-INSERT INTO t1 VALUES (1);
1886-DROP TEMPORARY TABLE t2_tmp;
1887-INSERT INTO t1 VALUES (2);
1888-### assertion: assert that slave has no temporary tables opened
1889-SHOW STATUS LIKE 'Slave_open_temp_tables';
1890-Variable_name Value
1891-Slave_open_temp_tables 0
1892-DROP TABLE t3, t1;
1893-show binlog events from <binlog_start>;
1894-Log_name Pos Event_type Server_id End_log_pos Info
1895-slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
1896-slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) )
1897-slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) )
1898-slave-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ()
1899-slave-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int)
1900-slave-bin.000001 # Query # # use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT
1901-slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */
1902-slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
1903-slave-bin.000001 # Query # # BEGIN
1904-slave-bin.000001 # Table_map # # table_id: # (test.t1)
1905-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1906-slave-bin.000001 # Xid # # COMMIT /* XID */
1907-slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2_tmp` /* generated by server */
1908-slave-bin.000001 # Query # # BEGIN
1909-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
1910-slave-bin.000001 # Xid # # COMMIT /* XID */
1911-slave-bin.000001 # Query # # use `test`; DROP TABLE `t3`,`t1` /* generated by server */
1912-
1913-# Bug#55478 Row events wrongly apply on the temporary table of the same name
1914-# ==========================================================================
1915-# The statement should be binlogged
1916-CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
1917-
1918-# Case 1: CREATE TABLE t1 ... SELECT
1919-# ----------------------------------
1920-
1921-# The statement generates row events on t1. And the rows events should
1922-# be inserted into the base table on slave.
1923-CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
1924-show binlog events in 'master-bin.000001' from <binlog_start>;
1925-Log_name Pos Event_type Server_id End_log_pos Info
1926-master-bin.000001 # Query # # BEGIN
1927-master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
1928- `rand()` double NOT NULL DEFAULT '0'
1929-) ENGINE=MyISAM
1930-master-bin.000001 # Table_map # # table_id: # (test.t1)
1931-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1932-master-bin.000001 # Query # # COMMIT
1933-
1934-# Case 2: DROP TEMPORARY TABLE in a transacation
1935-# ----------------------------------------------
1936-
1937-BEGIN;
1938-DROP TEMPORARY TABLE t1;
1939-# The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
1940-# as t1 is non-transactional table
1941-INSERT INTO t1 VALUES(Rand());
1942-COMMIT;
1943-show binlog events in 'master-bin.000001' from <binlog_start>;
1944-Log_name Pos Event_type Server_id End_log_pos Info
1945-master-bin.000001 # Query # # BEGIN
1946-master-bin.000001 # Table_map # # table_id: # (test.t1)
1947-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
1948-master-bin.000001 # Query # # COMMIT
1949-master-bin.000001 # Query # # BEGIN
1950-master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */
1951-master-bin.000001 # Query # # COMMIT
1952-# Compare the base table.
1953-include/diff_tables.inc [master:t1, slave:t1]
1954-
1955-DROP TABLE t1;
1956-include/rpl_end.inc
1957
1958=== added file 'mysql-test/suite/rpl/t/rpl_bug58546.test'
1959--- mysql-test/suite/rpl/t/rpl_bug58546.test 1970-01-01 00:00:00 +0000
1960+++ mysql-test/suite/rpl/t/rpl_bug58546.test 2014-10-22 21:45:42 +0000
1961@@ -0,0 +1,69 @@
1962+source include/master-slave.inc;
1963+source include/have_innodb.inc;
1964+source include/have_debug.inc;
1965+source include/have_debug_sync.inc;
1966+source include/have_binlog_format_mixed_or_statement.inc;
1967+
1968+--echo
1969+--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
1970+--echo # ----------------------------------------------------------------------
1971+--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
1972+--echo # possible that IO thread stopped after replicating part of a transaction
1973+--echo # which SQL thread was executing. SQL thread would be hung if the
1974+--echo # transaction could not be rolled back safely.
1975+--echo # It caused some sporadic failures on PB2.
1976+--echo #
1977+--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
1978+--echo # thread will continue to fetch the rest events of the transaction which
1979+--echo # is being executed by SQL thread and is not able to be rolled back safely.
1980+
1981+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
1982+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
1983+INSERT INTO t1 VALUES(1, 1);
1984+
1985+sync_slave_with_master;
1986+
1987+--source include/rpl_connection_master.inc
1988+
1989+let $debug_save= `SELECT @@GLOBAL.debug`;
1990+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
1991+
1992+--source include/rpl_connection_slave.inc
1993+source include/restart_slave_sql.inc;
1994+
1995+BEGIN;
1996+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
1997+
1998+--source include/rpl_connection_master.inc
1999+BEGIN;
2000+INSERT INTO t1 VALUES(2, 2);
2001+INSERT INTO t2 VALUES(1);
2002+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
2003+COMMIT;
2004+
2005+--source include/rpl_connection_slave1.inc
2006+let $show_statement= SHOW PROCESSLIST;
2007+let $field= Info;
2008+let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
2009+source include/wait_show_condition.inc;
2010+
2011+send STOP SLAVE;
2012+
2013+--source include/rpl_connection_slave.inc
2014+ROLLBACK;
2015+
2016+--source include/rpl_connection_master.inc
2017+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
2018+SET DEBUG_SYNC= 'RESET';
2019+
2020+--source include/rpl_connection_slave.inc
2021+source include/wait_for_slave_to_stop.inc;
2022+
2023+--source include/rpl_connection_slave1.inc
2024+reap;
2025+source include/start_slave.inc;
2026+
2027+--source include/rpl_connection_master.inc
2028+DROP TABLE t1, t2;
2029+SET GLOBAL debug= $debug_save;
2030+--source include/rpl_end.inc
2031
2032=== modified file 'mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test'
2033--- mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test 2013-09-26 19:54:16 +0000
2034+++ mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test 2014-10-22 21:45:42 +0000
2035@@ -24,8 +24,9 @@
2036
2037 source include/master-slave.inc;
2038 #CREATE TEMPORARY TABLE statements are not binlogged in row mode,
2039+#nor in mixed mode
2040 #So it must be test by itself.
2041-source include/have_binlog_format_mixed_or_statement.inc;
2042+source include/have_binlog_format_statement.inc;
2043 disable_warnings;
2044
2045 DROP DATABASE IF EXISTS mysqltest;
2046
2047=== added file 'mysql-test/suite/rpl/t/rpl_mix_drop_temp-slave.opt'
2048--- mysql-test/suite/rpl/t/rpl_mix_drop_temp-slave.opt 1970-01-01 00:00:00 +0000
2049+++ mysql-test/suite/rpl/t/rpl_mix_drop_temp-slave.opt 2014-10-22 21:45:42 +0000
2050@@ -0,0 +1,2 @@
2051+--replicate-ignore-table=mysqltest.t2
2052+
2053
2054=== added file 'mysql-test/suite/rpl/t/rpl_mix_drop_temp.test'
2055--- mysql-test/suite/rpl/t/rpl_mix_drop_temp.test 1970-01-01 00:00:00 +0000
2056+++ mysql-test/suite/rpl/t/rpl_mix_drop_temp.test 2014-10-22 21:45:42 +0000
2057@@ -0,0 +1,6 @@
2058+source include/master-slave.inc;
2059+source include/have_binlog_format_mixed.inc;
2060+
2061+source extra/rpl_tests/rpl_drop_temp.test;
2062+
2063+source include/rpl_end.inc;
2064
2065=== added file 'mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt'
2066--- mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt 1970-01-01 00:00:00 +0000
2067+++ mysql-test/suite/rpl/t/rpl_mix_rewrt_db-slave.opt 2014-10-22 21:45:42 +0000
2068@@ -0,0 +1,1 @@
2069+"--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"
2070
2071=== added file 'mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test'
2072--- mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test 1970-01-01 00:00:00 +0000
2073+++ mysql-test/suite/rpl/t/rpl_mix_rewrt_db.test 2014-10-22 21:45:42 +0000
2074@@ -0,0 +1,7 @@
2075+# TBF - difference in row level logging
2076+-- source include/have_binlog_format_mixed.inc
2077+-- source include/master-slave.inc
2078+
2079+-- source extra/rpl_tests/rpl_rewrt_db.test
2080+
2081+-- source include/rpl_end.inc
2082
2083=== modified file 'mysql-test/suite/rpl/t/rpl_row_reset_slave.test'
2084--- mysql-test/suite/rpl/t/rpl_row_reset_slave.test 2007-06-27 12:28:02 +0000
2085+++ mysql-test/suite/rpl/t/rpl_row_reset_slave.test 2014-10-22 21:45:42 +0000
2086@@ -1,5 +1,5 @@
2087 # TBF - difference in row level logging
2088-# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
2089--- source include/have_binlog_format_row.inc
2090+# Temp tables are not replicated in rbr or mixed, but it is still good to hit rbr with everthing
2091+-- source include/have_binlog_format_mixed_or_row.inc
2092 -- source extra/rpl_tests/rpl_reset_slave.test
2093
2094
2095=== renamed file 'mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt' => 'mysql-test/suite/rpl/t/rpl_stm_drop_temp-slave.opt'
2096=== added file 'mysql-test/suite/rpl/t/rpl_stm_drop_temp.test'
2097--- mysql-test/suite/rpl/t/rpl_stm_drop_temp.test 1970-01-01 00:00:00 +0000
2098+++ mysql-test/suite/rpl/t/rpl_stm_drop_temp.test 2014-10-22 21:45:42 +0000
2099@@ -0,0 +1,6 @@
2100+source include/master-slave.inc;
2101+source include/have_binlog_format_statement.inc;
2102+
2103+source extra/rpl_tests/rpl_drop_temp.test;
2104+
2105+source include/rpl_end.inc;
2106
2107=== modified file 'mysql-test/suite/rpl/t/rpl_stm_reset_slave.test'
2108--- mysql-test/suite/rpl/t/rpl_stm_reset_slave.test 2007-06-27 12:28:02 +0000
2109+++ mysql-test/suite/rpl/t/rpl_stm_reset_slave.test 2014-10-22 21:45:42 +0000
2110@@ -1,5 +1,5 @@
2111 # TBF - difference in row level logging
2112--- source include/have_binlog_format_mixed_or_statement.inc
2113+-- source include/have_binlog_format_statement.inc
2114 -- source extra/rpl_tests/rpl_reset_slave.test
2115
2116 # End of 4.1 tests
2117
2118=== renamed file 'mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt' => 'mysql-test/suite/rpl/t/rpl_stm_rewrt_db-slave.opt'
2119=== added file 'mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test'
2120--- mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test 1970-01-01 00:00:00 +0000
2121+++ mysql-test/suite/rpl/t/rpl_stm_rewrt_db.test 2014-10-22 21:45:42 +0000
2122@@ -0,0 +1,7 @@
2123+# TBF - difference in row level logging
2124+-- source include/have_binlog_format_statement.inc
2125+-- source include/master-slave.inc
2126+
2127+-- source extra/rpl_tests/rpl_rewrt_db.test
2128+
2129+-- source include/rpl_end.inc
2130
2131=== modified file 'mysql-test/suite/rpl/t/rpl_stop_slave.test'
2132--- mysql-test/suite/rpl/t/rpl_stop_slave.test 2014-06-26 11:54:27 +0000
2133+++ mysql-test/suite/rpl/t/rpl_stop_slave.test 2014-10-22 21:45:42 +0000
2134@@ -2,7 +2,10 @@
2135 source include/have_innodb.inc;
2136 source include/have_debug.inc;
2137 source include/have_debug_sync.inc;
2138-source include/have_binlog_format_mixed_or_statement.inc;
2139+
2140+# lp:1313901 renders this case irrelevant for mixed mode as temp tables are no
2141+# longer replicated to the slave.
2142+source include/have_binlog_format_statement.inc;
2143
2144 --echo
2145 --echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
2146@@ -54,91 +57,8 @@
2147 --source include/rpl_connection_master.inc
2148 DROP TABLE t1, t2;
2149
2150---echo
2151---echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
2152---echo # ----------------------------------------------------------------------
2153---echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
2154---echo # possible that IO thread stopped after replicating part of a transaction
2155---echo # which SQL thread was executing. SQL thread would be hung if the
2156---echo # transaction could not be rolled back safely.
2157---echo # It caused some sporadic failures on PB2.
2158---echo #
2159---echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
2160---echo # thread will continue to fetch the rest events of the transaction which
2161---echo # is being executed by SQL thread and is not able to be rolled back safely.
2162-
2163-CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
2164-CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
2165-INSERT INTO t1 VALUES(1, 1);
2166-
2167-sync_slave_with_master;
2168---source include/stop_slave.inc
2169-
2170---source include/rpl_connection_master.inc
2171-# make sure that there are no zombie threads
2172---source include/stop_dump_threads.inc
2173-
2174-let $debug_save= `SELECT @@GLOBAL.debug`;
2175-SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
2176-
2177---source include/rpl_connection_slave.inc
2178---source include/start_slave.inc
2179-
2180-BEGIN;
2181-UPDATE t1 SET c2 = 2 WHERE c1 = 1;
2182-
2183---source include/rpl_connection_master.inc
2184-BEGIN;
2185-INSERT INTO t1 VALUES(2, 2);
2186-INSERT INTO t2 VALUES(1);
2187-UPDATE t1 SET c2 = 3 WHERE c1 = 1;
2188-COMMIT;
2189-
2190-# wait for the dump thread reach the sync point
2191---let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump'
2192---source include/wait_condition.inc
2193-
2194---source include/rpl_connection_slave1.inc
2195-let $show_statement= SHOW PROCESSLIST;
2196-let $field= Info;
2197-let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
2198-source include/wait_show_condition.inc;
2199-
2200-send STOP SLAVE;
2201-
2202---source include/rpl_connection_slave.inc
2203-ROLLBACK;
2204-
2205---source include/rpl_connection_master.inc
2206-
2207-SET DEBUG_SYNC= 'now SIGNAL signal.continue';
2208-# wait for the dump thread to come out of the
2209-# waiting phase before resetting the signals
2210---let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump'
2211---source include/wait_condition.inc
2212-SET DEBUG_SYNC= 'RESET';
2213-
2214---source include/rpl_connection_slave.inc
2215-source include/wait_for_slave_to_stop.inc;
2216-
2217---source include/rpl_connection_slave1.inc
2218-reap;
2219-
2220-# Slave has stopped, thence lets make sure that
2221-# we kill the zombie dump threads. Also, make
2222-# sure that we disable the DBUG_EXECUTE_IF
2223-# that would set the dump thread to wait
2224---source include/rpl_connection_master.inc
2225-SET GLOBAL debug= '$debug_save';
2226-# make sure that there are no zombie threads
2227---source include/stop_dump_threads.inc
2228-
2229---source include/rpl_connection_slave1.inc
2230-# now the dump thread on the master will start
2231-# from a clean slate, i.e. without the
2232-# DBUG_EXECUTE_IF set
2233-source include/start_slave.inc;
2234-
2235---source include/rpl_connection_master.inc
2236-DROP TABLE t1, t2;
2237+# Bug#58546 test rpl_packet timeout failure sporadically on PB
2238+# Moved into its own test rpl.rpl_bug58546.test to allow it to continue
2239+# to test both MBR and SBR
2240+
2241 --source include/rpl_end.inc
2242
2243=== removed file 'mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test'
2244--- mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test 2010-12-19 17:15:12 +0000
2245+++ mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test 1970-01-01 00:00:00 +0000
2246@@ -1,210 +0,0 @@
2247-# ==== Purpose ====
2248-#
2249-# Test that temporary tables are correctly replicated after switching to ROW format in MIX mode.
2250-# This test case will test the condition of the bug#40013.
2251-# The test step is:
2252-# 1: create temp table on connection 'master';
2253-# 2: switch to ROW format using 'INSERT INTO t1 VALUES (UUID());'
2254-# 3: disconnect 'master' and connect to a new connection 'master1';
2255-# 4: sync to slave and check the number of temp tables on slave.
2256-#
2257-
2258-source include/master-slave.inc;
2259-source include/have_binlog_format_mixed.inc;
2260-source include/have_innodb.inc;
2261-
2262---echo ==== Initialize ====
2263-
2264---echo [on master]
2265---connection master
2266-
2267-CREATE TABLE t1 (a CHAR(48));
2268-CREATE TEMPORARY TABLE t1_tmp1(a INT);
2269-INSERT INTO t1 VALUES (UUID());
2270-
2271---echo [on slave]
2272-sync_slave_with_master;
2273-
2274---echo ==== Verify results on slave ====
2275-SHOW STATUS LIKE "Slave_open_temp_tables";
2276-
2277---echo [on master]
2278---connection master
2279-
2280-disconnect master;
2281---echo [on master1]
2282---connection master1
2283-
2284-# waiting DROP TEMPORARY TABLE event to be written into binlog
2285-let $wait_binlog_event= DROP;
2286-source include/wait_for_binlog_event.inc;
2287-
2288---echo [on slave]
2289-sync_slave_with_master;
2290-
2291---echo ==== Verify results on slave ====
2292-SHOW STATUS LIKE "Slave_open_temp_tables";
2293-
2294---echo ==== Clean up ====
2295-
2296---echo [on master]
2297---let $rpl_connection_name= master
2298---let $rpl_server_number= 1
2299---source include/rpl_connect.inc
2300---connection master
2301-DROP TABLE t1;
2302-
2303---echo [on slave]
2304-sync_slave_with_master;
2305-
2306-#
2307-# BUG#43046: mixed mode switch to row format with temp table lead to wrong
2308-# result
2309-#
2310-# NOTES
2311-# =====
2312-#
2313-# 1. Temporary tables cannot be logged using the row-based
2314-# format. Thus, once row-based logging is used, all subsequent
2315-# statements using that table are unsafe, and we approximate this
2316-# condition by treating all statements made by that client as
2317-# unsafe until the client no longer holds any temporary tables.
2318-#
2319-# 2. Two different connections can use the same temporary table
2320-# name without conflicting with each other or with an
2321-# existing non-TEMPORARY table of the same name.
2322-#
2323-# DESCRIPTION
2324-# ===========
2325-#
2326-# The test is implemented as follows:
2327-# 1. create regular tables
2328-# 2. create a temporary table t1_tmp: should be logged as statement
2329-# 3. issue an alter table: should be logged as statement
2330-# 4. issue statement that forces switch to RBR
2331-# 5. create another temporary table t2_tmp: should not be logged
2332-# 6. issue alter table on t1_tmp: should not be logged
2333-# 7. drop t1_tmp and regular table on same statement: should log both in
2334-# statement format (but different statements)
2335-# 8. issue deterministic insert: logged as row (because t2_tmp still
2336-# exists).
2337-# 9. drop t2_tmp and issue deterministic statement: should log drop and
2338-# query in statement format (show switch back to STATEMENT format)
2339-# 10. in the end the slave should not have open temp tables.
2340-#
2341-
2342---source include/rpl_reset.inc
2343--- connection master
2344-
2345-# action: setup environment
2346-CREATE TABLE t1 (a int);
2347-CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
2348-CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
2349-CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ();
2350-
2351-# assertion: assert that CREATE is logged as STATEMENT
2352-CREATE TEMPORARY TABLE t1_tmp (i1 int);
2353-
2354-# assertion: assert that ALTER TABLE is logged as STATEMENT
2355-ALTER TABLE t1_tmp ADD COLUMN b INT;
2356-
2357-# action: force switch to RBR
2358-DELETE FROM t2;
2359-
2360-# assertion: assert that t2_tmp will not make into the binlog (RBR logging atm)
2361-CREATE TEMPORARY TABLE t2_tmp (a int);
2362-
2363-# assertion: assert that ALTER TABLE on t1_tmp will not make into the binlog
2364-ALTER TABLE t1_tmp ADD COLUMN c INT;
2365-
2366--- echo ### assertion: assert that there is one open temp table on slave
2367--- sync_slave_with_master
2368-SHOW STATUS LIKE 'Slave_open_temp_tables';
2369-
2370--- connection master
2371-
2372-# assertion: assert that both drops are logged
2373-DROP TABLE t1_tmp, t2;
2374-
2375-# assertion: assert that statement is logged as row (master still has one
2376-# opened temporary table - t2_tmp.
2377-INSERT INTO t1 VALUES (1);
2378-
2379-# assertion: assert that DROP TABLE *is* logged despite CREATE is not.
2380-DROP TEMPORARY TABLE t2_tmp;
2381-
2382-# assertion: assert that statement is now logged as STMT (mixed mode switches
2383-# back to STATEMENT).
2384-INSERT INTO t1 VALUES (2);
2385-
2386--- sync_slave_with_master
2387-
2388--- echo ### assertion: assert that slave has no temporary tables opened
2389-SHOW STATUS LIKE 'Slave_open_temp_tables';
2390-
2391--- connection master
2392-
2393-# action: drop remaining tables
2394-DROP TABLE t3, t1;
2395-
2396--- sync_slave_with_master
2397-
2398--- source include/show_binlog_events.inc
2399-
2400---echo
2401---echo # Bug#55478 Row events wrongly apply on the temporary table of the same name
2402---echo # ==========================================================================
2403-connection master;
2404-
2405-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
2406-let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
2407-
2408---echo # The statement should be binlogged
2409-CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
2410-
2411---echo
2412---echo # Case 1: CREATE TABLE t1 ... SELECT
2413---echo # ----------------------------------
2414-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
2415-let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
2416-
2417---echo
2418---echo # The statement generates row events on t1. And the rows events should
2419---echo # be inserted into the base table on slave.
2420-CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
2421-
2422-source include/show_binlog_events.inc;
2423-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
2424-let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
2425-
2426---echo
2427---echo # Case 2: DROP TEMPORARY TABLE in a transacation
2428---echo # ----------------------------------------------
2429---echo
2430-
2431-BEGIN;
2432-DROP TEMPORARY TABLE t1;
2433-
2434-# The patch for BUG#55478 fixed the problem only on RBR. The problem on SBR
2435-# will be fixed by the patch for bug#55709. So This statement cannot be
2436-# executed until Bug#55709 is fixed
2437-#
2438-# INSERT INTO t1 VALUES(1);
2439-
2440---echo # The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
2441---echo # as t1 is non-transactional table
2442-INSERT INTO t1 VALUES(Rand());
2443-COMMIT;
2444-
2445-source include/show_binlog_events.inc;
2446-
2447---sync_slave_with_master
2448-
2449---echo # Compare the base table.
2450---let $diff_tables= master:t1, slave:t1
2451---source include/diff_tables.inc
2452-
2453---echo
2454-connection master;
2455-DROP TABLE t1;
2456---source include/rpl_end.inc
2457
2458=== modified file 'mysql-test/suite/rpl/t/rpl_trunc_temp.test'
2459--- mysql-test/suite/rpl/t/rpl_trunc_temp.test 2010-12-19 17:07:28 +0000
2460+++ mysql-test/suite/rpl/t/rpl_trunc_temp.test 2014-10-22 21:45:42 +0000
2461@@ -20,8 +20,9 @@
2462
2463
2464 # Requires statement-based logging since temporary tables are not
2465-# logged in row-based logging
2466--- source include/have_binlog_format_mixed_or_statement.inc
2467+# logged in row-based logging. Same now goes for mixed, valid for statement
2468+# only replication as a result of lp:1313901
2469+-- source include/have_binlog_format_statement.inc
2470
2471 source include/master-slave.inc;
2472
2473
2474=== modified file 'sql/sql_class.cc'
2475--- sql/sql_class.cc 2014-08-22 09:58:37 +0000
2476+++ sql/sql_class.cc 2014-10-22 21:45:42 +0000
2477@@ -4566,6 +4566,11 @@
2478 */
2479 my_bool multi_access_engine= FALSE;
2480 /*
2481+ bug 1313901 : Track if statement creates or drops a temporary table
2482+ and log in ROW if it does.
2483+ */
2484+ my_bool create_drop_temp_table= FALSE;
2485+ /*
2486 Identifies if a table is changed.
2487 */
2488 my_bool is_write= FALSE;
2489@@ -4597,7 +4602,25 @@
2490 for (TABLE_LIST *table= tables; table; table= table->next_global)
2491 {
2492 if (table->placeholder())
2493+ {
2494+ /*
2495+ bug 1313901 : Detect if this is a CREATE TEMPORARY or DROP of a
2496+ temporary table. This will be used later in determining
2497+ whether to log in ROW or STMT if MIXED replication is
2498+ being used.
2499+ */
2500+ if(!create_drop_temp_table &&
2501+ !table->table &&
2502+ ((lex->sql_command == SQLCOM_CREATE_TABLE &&
2503+ (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) ||
2504+ ((lex->sql_command == SQLCOM_DROP_TABLE ||
2505+ lex->sql_command == SQLCOM_TRUNCATE) &&
2506+ find_temporary_table(this, table))))
2507+ {
2508+ create_drop_temp_table= TRUE;
2509+ }
2510 continue;
2511+ }
2512
2513 if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE ||
2514 table->table->s->table_category == TABLE_CATEGORY_LOG)
2515@@ -4605,6 +4628,8 @@
2516
2517 handler::Table_flags const flags= table->table->file->ha_table_flags();
2518
2519+ my_bool trans= table->table->file->has_transactions();
2520+
2521 DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx",
2522 table->table_name, flags));
2523 if (table->lock_type >= TL_WRITE_ALLOW_WRITE)
2524@@ -4613,8 +4638,6 @@
2525 table->table->file->ht)
2526 multi_write_engine= TRUE;
2527
2528- my_bool trans= table->table->file->has_transactions();
2529-
2530 if (table->table->s->tmp_table)
2531 lex->set_stmt_accessed_table(trans ? LEX::STMT_WRITES_TEMP_TRANS_TABLE :
2532 LEX::STMT_WRITES_TEMP_NON_TRANS_TABLE);
2533@@ -4631,18 +4654,15 @@
2534 }
2535 flags_access_some_set |= flags;
2536
2537- if (lex->sql_command != SQLCOM_CREATE_TABLE ||
2538- (lex->sql_command == SQLCOM_CREATE_TABLE &&
2539- (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)))
2540- {
2541- my_bool trans= table->table->file->has_transactions();
2542-
2543- if (table->table->s->tmp_table)
2544- lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TEMP_TRANS_TABLE :
2545- LEX::STMT_READS_TEMP_NON_TRANS_TABLE);
2546- else
2547- lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TRANS_TABLE :
2548- LEX::STMT_READS_NON_TRANS_TABLE);
2549+ if (table->table->s->tmp_table)
2550+ {
2551+ lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TEMP_TRANS_TABLE :
2552+ LEX::STMT_READS_TEMP_NON_TRANS_TABLE);
2553+ }
2554+ else
2555+ {
2556+ lex->set_stmt_accessed_table(trans ? LEX::STMT_READS_TRANS_TABLE :
2557+ LEX::STMT_READS_NON_TRANS_TABLE);
2558 }
2559
2560 if (prev_access_table && prev_access_table->file->ht !=
2561@@ -4774,7 +4794,10 @@
2562 else
2563 {
2564 if (lex->is_stmt_unsafe() || lex->is_stmt_row_injection()
2565- || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0)
2566+ || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0
2567+ || lex->stmt_accessed_table(LEX::STMT_READS_TEMP_TRANS_TABLE)
2568+ || lex->stmt_accessed_table(LEX::STMT_READS_TEMP_NON_TRANS_TABLE)
2569+ || create_drop_temp_table)
2570 {
2571 /* log in row format! */
2572 set_current_stmt_binlog_format_row_if_mixed();
2573
2574=== modified file 'sql/sql_class.h'
2575--- sql/sql_class.h 2014-06-06 14:58:40 +0000
2576+++ sql/sql_class.h 2014-10-22 21:45:42 +0000
2577@@ -2812,30 +2812,15 @@
2578 inline void reset_current_stmt_binlog_format_row()
2579 {
2580 DBUG_ENTER("reset_current_stmt_binlog_format_row");
2581- /*
2582- If there are temporary tables, don't reset back to
2583- statement-based. Indeed it could be that:
2584- CREATE TEMPORARY TABLE t SELECT UUID(); # row-based
2585- # and row-based does not store updates to temp tables
2586- # in the binlog.
2587- INSERT INTO u SELECT * FROM t; # stmt-based
2588- and then the INSERT will fail as data inserted into t was not logged.
2589- So we continue with row-based until the temp table is dropped.
2590- If we are in a stored function or trigger, we mustn't reset in the
2591- middle of its execution (as the binary logging way of a stored function
2592- or trigger is decided when it starts executing, depending for example on
2593- the caller (for a stored function: if caller is SELECT or
2594- INSERT/UPDATE/DELETE...).
2595- */
2596 DBUG_PRINT("debug",
2597- ("temporary_tables: %s, in_sub_stmt: %s, system_thread: %s",
2598- YESNO(temporary_tables), YESNO(in_sub_stmt),
2599+ ("in_sub_stmt: %s, system_thread: %s",
2600+ YESNO(in_sub_stmt),
2601 show_system_thread(system_thread)));
2602 if (in_sub_stmt == 0)
2603 {
2604 if (variables.binlog_format == BINLOG_FORMAT_ROW)
2605 set_current_stmt_binlog_format_row();
2606- else if (temporary_tables == NULL)
2607+ else
2608 clear_current_stmt_binlog_format_row();
2609 }
2610 DBUG_VOID_RETURN;
2611
2612=== modified file 'sql/sql_table.cc'
2613--- sql/sql_table.cc 2014-08-22 09:58:37 +0000
2614+++ sql/sql_table.cc 2014-10-22 21:45:42 +0000
2615@@ -1891,6 +1891,15 @@
2616
2617 DBUG_ENTER("mysql_rm_table");
2618
2619+ /*
2620+ bug 1313901 : DROP tables need to have their logging format determined if
2621+ in MIXED mode and dropping a TEMP table.
2622+ */
2623+ if (thd->decide_logging_format(tables))
2624+ {
2625+ DBUG_RETURN(TRUE);
2626+ }
2627+
2628 /* Disable drop of enabled log tables, must be done before name locking */
2629 for (table= tables; table; table= table->next_local)
2630 {
2631@@ -4648,8 +4657,12 @@
2632 that we can safely perform table creation.
2633 Thus by holding both these locks we ensure that our statement is
2634 properly isolated from all concurrent operations which matter.
2635+
2636+ bug 1313901 : CREATE LIKE needs to have the logging format determined if
2637+ in MIXED mode and creating LIKE a TEMP table.
2638 */
2639- if (open_tables(thd, &thd->lex->query_tables, &not_used, 0))
2640+ if (open_tables(thd, &thd->lex->query_tables, &not_used, 0) ||
2641+ thd->decide_logging_format(thd->lex->query_tables))
2642 {
2643 res= thd->is_error();
2644 goto err;
2645
2646=== modified file 'sql/sql_truncate.cc'
2647--- sql/sql_truncate.cc 2014-06-03 13:14:25 +0000
2648+++ sql/sql_truncate.cc 2014-10-22 21:45:42 +0000
2649@@ -432,6 +432,14 @@
2650 /* If it is a temporary table, no need to take locks. */
2651 if ((table= find_temporary_table(thd, table_ref)))
2652 {
2653+ /*
2654+ bug 1313901 : THD::decide_logging_format has not yet been called and
2655+ may not be called at all dependig on the engine, so call it
2656+ here.
2657+ */
2658+ if (thd->decide_logging_format(table_ref) != 0)
2659+ DBUG_RETURN(TRUE);
2660+
2661 /* In RBR, the statement is not binlogged if the table is temporary. */
2662 binlog_stmt= !thd->is_current_stmt_binlog_format_row();
2663

Subscribers

People subscribed via source and target branches