2005-12-22 06:39:02 +01:00
|
|
|
# drop table t1 t2 t3 are included int master-slave.inc
|
2006-02-03 15:38:27 +01:00
|
|
|
# meaningful only in statement-based:
|
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
-- source include/have_binlog_format_statement.inc
|
|
|
|
-- source include/master-slave.inc
|
2001-01-03 01:15:48 +01:00
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
|
|
|
|
create table t2 (n int, PRIMARY KEY(n));
|
2001-01-03 01:15:48 +01:00
|
|
|
create temporary table t1 (n int);
|
2003-01-06 00:48:59 +01:00
|
|
|
create temporary table t3 (n int not null);
|
2005-12-22 06:39:02 +01:00
|
|
|
|
|
|
|
insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300);
|
|
|
|
insert into t2 select * from t1;
|
2003-01-06 00:48:59 +01:00
|
|
|
alter table t3 add primary key(n);
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2001-10-30 02:21:33 +01:00
|
|
|
flush logs;
|
2005-12-22 06:39:02 +01:00
|
|
|
insert into t3 values (1010);
|
2001-04-11 04:56:54 +02:00
|
|
|
insert into t2 select * from t3;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2003-01-06 00:48:59 +01:00
|
|
|
drop table if exists t3;
|
2005-12-22 06:39:02 +01:00
|
|
|
insert into t2 values (1012);
|
|
|
|
|
2000-11-26 07:29:01 +01:00
|
|
|
connection master1;
|
2001-01-03 01:15:48 +01:00
|
|
|
create temporary table t1 (n int);
|
|
|
|
insert into t1 values (4),(5);
|
|
|
|
insert into t2 select * from t1;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2001-01-24 20:47:09 +01:00
|
|
|
save_master_pos;
|
2000-11-26 07:29:01 +01:00
|
|
|
disconnect master;
|
2001-01-24 20:47:09 +01:00
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
connection slave;
|
2001-01-24 20:47:09 +01:00
|
|
|
#add 1 to the saved position, so we will catch drop table on disconnect
|
|
|
|
#for sure
|
|
|
|
sync_with_master 1;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2000-11-26 07:29:01 +01:00
|
|
|
connection master1;
|
2005-12-22 06:39:02 +01:00
|
|
|
insert into t2 values(61);
|
|
|
|
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
2001-01-24 20:47:09 +01:00
|
|
|
disconnect master1;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2000-11-26 07:29:01 +01:00
|
|
|
connection slave;
|
2001-01-24 20:47:09 +01:00
|
|
|
#same trick - make sure we catch drop of temporary table on disconnect
|
|
|
|
sync_with_master 1;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2001-03-25 00:02:26 +01:00
|
|
|
select * from t2;
|
2005-12-22 06:39:02 +01:00
|
|
|
select count(*) from t2;
|
|
|
|
select sum(n) from t2;
|
2001-03-25 00:02:26 +01:00
|
|
|
show status like 'Slave_open_temp_tables';
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2001-01-03 01:15:48 +01:00
|
|
|
#
|
|
|
|
# Clean up
|
|
|
|
#
|
2001-03-25 00:02:26 +01:00
|
|
|
connect (master2,localhost,root,,);
|
2001-01-03 01:15:48 +01:00
|
|
|
connection master2;
|
|
|
|
drop table if exists t1,t2;
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|