2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
1
include/master-slave.inc
9
5
CREATE TABLE t1 (a CHAR(48));
22
19
Slave_open_temp_tables 0
22
include/rpl_connect.inc [creating master]
28
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
31
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
33
26
CREATE TABLE t1 (a int);
34
27
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
35
28
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
69
62
slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */
70
63
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
71
64
slave-bin.000001 # Query # # use `test`; DROP TABLE t3, t1
66
# Bug#55478 Row events wrongly apply on the temporary table of the same name
67
# ==========================================================================
68
# The statement should be binlogged
69
CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
71
# Case 1: CREATE TABLE t1 ... SELECT
72
# ----------------------------------
74
# The statement generates row events on t1. And the rows events should
75
# be inserted into the base table on slave.
76
CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
77
show binlog events in 'master-bin.000001' from <binlog_start>;
78
Log_name Pos Event_type Server_id End_log_pos Info
79
master-bin.000001 # Query # # BEGIN
80
master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
81
`rand()` double NOT NULL DEFAULT '0'
83
master-bin.000001 # Table_map # # table_id: # (test.t1)
84
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
85
master-bin.000001 # Query # # COMMIT
87
# Case 2: DROP TEMPORARY TABLE in a transacation(happens only on 5.5+)
88
# --------------------------------------------------------------------
91
DROP TEMPORARY TABLE t1;
92
# The statement will binlogged after 'DROP TEMPORARY TABLE t1'
93
INSERT INTO t1 VALUES(1);
94
# The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
95
INSERT INTO t1 VALUES(Rand());
97
show binlog events in 'master-bin.000001' from <binlog_start>;
98
Log_name Pos Event_type Server_id End_log_pos Info
99
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
100
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1)
101
master-bin.000001 # Query # # BEGIN
102
master-bin.000001 # Table_map # # table_id: # (test.t1)
103
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
104
master-bin.000001 # Query # # COMMIT
105
# Compare the base table.
106
include/diff_tables.inc [master:t1, slave:t1]