~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_flsh_tbls.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# depends on the binlog output
 
2
# Test of replicating FLUSH TABLES to make
 
3
# RENAME TABLE work with MERGE tables on the slave.
 
4
# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
 
5
#
 
6
 
 
7
 
 
8
-- source include/master-slave.inc
 
9
 
 
10
let $SERVER_VERSION=`select version()`;
 
11
 
 
12
create table t1 (a int);
 
13
insert into t1 values (10);
 
14
create table t2 (a int);
 
15
create table t3 (a int) engine=merge union(t1);
 
16
create table t4 (a int);
 
17
# We force the slave to open t3 (because we want to try confusing him) with this :
 
18
insert into t4 select * from t3;
 
19
rename table t1 to t5, t2 to t1;
 
20
# RENAME may have confused the master (this is a known bug): so FLUSH tables,
 
21
# first don't write it to the binlog, to test the NO_WRITE_TO_BINLOG keyword.
 
22
flush no_write_to_binlog tables;
 
23
# Check that it's not in the binlog.
 
24
--replace_result $SERVER_VERSION SERVER_VERSION
 
25
--replace_column 2 # 5 #
 
26
--replace_regex /table_id: [0-9]+/table_id: #/
 
27
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
 
28
# Check that the master is not confused.
 
29
select * from t3;
 
30
# This FLUSH should go into the binlog to not confuse the slave.
 
31
flush tables;
 
32
# Check that it's in the binlog.
 
33
--replace_result $SERVER_VERSION SERVER_VERSION
 
34
--replace_column 2 # 5 #
 
35
--replace_regex /table_id: [0-9]+/table_id: #/
 
36
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
 
37
save_master_pos;
 
38
connection slave;
 
39
sync_with_master;
 
40
# Check that the slave is not confused.
 
41
select * from t3;
 
42
# Note that all this confusion may cause warnings 'table xx is open on rename'
 
43
# in the .err files; these are not fatal and are not reported by mysql-test-run.
 
44
 
 
45
stop slave;
 
46
connection master;
 
47
drop table t1;
 
48
connection slave;
 
49
flush tables with read lock;
 
50
start slave;
 
51
sleep 1;
 
52
--error 1192
 
53
stop slave;
 
54
 
 
55
connection master;
 
56
drop table t3, t4, t5;
 
57
 
 
58
# End of 4.1 tests
 
59