~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
source include/master-slave.inc;
13
13
source include/have_binlog_format_mixed.inc;
 
14
source include/have_innodb.inc;
14
15
 
15
16
--echo ==== Initialize ====
16
17
 
31
32
--connection master
32
33
 
33
34
disconnect master;
 
35
--echo [on master1]
34
36
--connection master1
35
37
 
36
38
# waiting DROP TEMPORARY TABLE event to be written into binlog
46
48
--echo ==== Clean up ====
47
49
 
48
50
--echo [on master]
49
 
--connection master1
 
51
--let $rpl_connection_name= master
 
52
--let $rpl_server_number= 1
 
53
--source include/rpl_connect.inc
 
54
--connection master
50
55
DROP TABLE t1;
51
56
 
52
57
--echo [on slave]
88
93
#    10. in the end the slave should not have open temp tables.
89
94
#  
90
95
 
91
 
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
 
96
--source include/rpl_reset.inc
92
97
-- connection master
93
98
 
94
99
# action: setup environment
146
150
-- sync_slave_with_master
147
151
 
148
152
-- source include/show_binlog_events.inc
 
153
 
 
154
--echo
 
155
--echo # Bug#55478 Row events wrongly apply on the temporary table of the same name
 
156
--echo # ==========================================================================
 
157
connection master;
 
158
 
 
159
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
 
160
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
 
161
 
 
162
--echo # The statement should be binlogged
 
163
CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
 
164
 
 
165
--echo
 
166
--echo # Case 1: CREATE TABLE t1 ... SELECT
 
167
--echo # ----------------------------------
 
168
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
 
169
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
 
170
 
 
171
--echo
 
172
--echo # The statement generates row events on t1. And the rows events should
 
173
--echo # be inserted into the base table on slave.
 
174
CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
 
175
 
 
176
source include/show_binlog_events.inc;
 
177
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
 
178
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
 
179
 
 
180
--echo
 
181
--echo # Case 2: DROP TEMPORARY TABLE in a transacation(happens only on 5.5+)
 
182
--echo # --------------------------------------------------------------------
 
183
--echo
 
184
 
 
185
BEGIN;
 
186
DROP TEMPORARY TABLE t1;
 
187
 
 
188
--echo # The statement will binlogged after 'DROP TEMPORARY TABLE t1'
 
189
INSERT INTO t1 VALUES(1);
 
190
 
 
191
--echo # The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
 
192
INSERT INTO t1 VALUES(Rand());
 
193
COMMIT;
 
194
 
 
195
source include/show_binlog_events.inc;
 
196
 
 
197
--sync_slave_with_master
 
198
 
 
199
--echo # Compare the base table.
 
200
--let $diff_tables= master:t1, slave:t1
 
201
--source include/diff_tables.inc
 
202
 
 
203
--echo
 
204
connection master;
 
205
DROP TABLE t1;
 
206
--source include/rpl_end.inc