2000-12-07 15:54:59 +01:00
|
|
|
source include/master-slave.inc;
|
2000-11-26 07:29:01 +01:00
|
|
|
connection master;
|
2001-04-11 04:56:54 +02:00
|
|
|
drop table if exists t1,t2,t3;
|
2001-01-03 01:15:48 +01:00
|
|
|
|
|
|
|
create table t2 (n int);
|
|
|
|
create temporary table t1 (n int);
|
|
|
|
insert into t1 values(1),(2),(3);
|
|
|
|
insert into t2 select * from t1;
|
2001-04-11 04:56:54 +02:00
|
|
|
drop table if exists test.t3;
|
|
|
|
create temporary table test.t3 (n int not null);
|
|
|
|
alter table test.t3 add primary key(n);
|
2001-10-30 02:21:33 +01:00
|
|
|
flush logs;
|
2001-04-11 04:56:54 +02:00
|
|
|
insert into t3 values (100);
|
|
|
|
insert into t2 select * from t3;
|
|
|
|
drop table if exists test.t3;
|
|
|
|
insert into t2 values (101);
|
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;
|
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
|
|
|
connection slave;
|
|
|
|
|
|
|
|
#add 1 to the saved position, so we will catch drop table on disconnect
|
|
|
|
#for sure
|
|
|
|
sync_with_master 1;
|
2000-11-26 07:29:01 +01:00
|
|
|
connection master1;
|
2001-01-03 01:15:48 +01:00
|
|
|
insert into t2 values(6);
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
2001-01-24 20:47:09 +01:00
|
|
|
disconnect master1;
|
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;
|
2001-03-25 00:02:26 +01:00
|
|
|
select * from t2;
|
|
|
|
show status like 'Slave_open_temp_tables';
|
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;
|