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;
7
create table t1 (a int);
8
insert into t1 values (10);
9
create table t2 (a int);
10
create table t3 (a int) engine=merge union(t1);
11
create table t4 (a int);
12
insert into t4 select * from t3;
13
rename table t1 to t5, t2 to t1;
14
flush no_write_to_binlog tables;
15
SHOW BINLOG EVENTS FROM 897 ;
16
Log_name Pos Event_type Server_id End_log_pos Info
17
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
21
SHOW BINLOG EVENTS FROM 897 ;
22
Log_name Pos Event_type Server_id End_log_pos Info
23
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
24
master-bin.000001 # Query 1 # use `test`; flush tables
29
flush tables with read lock;
32
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
34
drop table t3, t4, t5;