2000-12-07 07:54:59 -07:00
|
|
|
source include/master-slave.inc;
|
2000-11-25 23:29:01 -07:00
|
|
|
connection master;
|
2001-01-03 02:15:48 +02: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;
|
2003-01-06 01:48:59 +02:00
|
|
|
create temporary table t3 (n int not null);
|
|
|
|
alter table t3 add primary key(n);
|
2001-10-29 18:21:33 -07:00
|
|
|
flush logs;
|
2001-04-10 20:56:54 -06:00
|
|
|
insert into t3 values (100);
|
|
|
|
insert into t2 select * from t3;
|
2003-01-06 01:48:59 +02:00
|
|
|
drop table if exists t3;
|
2001-04-10 20:56:54 -06:00
|
|
|
insert into t2 values (101);
|
2000-11-25 23:29:01 -07:00
|
|
|
connection master1;
|
2001-01-03 02:15:48 +02:00
|
|
|
create temporary table t1 (n int);
|
|
|
|
insert into t1 values (4),(5);
|
|
|
|
insert into t2 select * from t1;
|
2001-01-24 12:47:09 -07:00
|
|
|
save_master_pos;
|
2000-11-25 23:29:01 -07:00
|
|
|
disconnect master;
|
2001-01-24 12:47:09 -07: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-25 23:29:01 -07:00
|
|
|
connection master1;
|
2001-01-03 02:15:48 +02:00
|
|
|
insert into t2 values(6);
|
2001-01-17 05:47:33 -07:00
|
|
|
save_master_pos;
|
2001-01-24 12:47:09 -07:00
|
|
|
disconnect master1;
|
2000-11-25 23:29:01 -07:00
|
|
|
connection slave;
|
2001-01-24 12:47:09 -07:00
|
|
|
#same trick - make sure we catch drop of temporary table on disconnect
|
|
|
|
sync_with_master 1;
|
2001-03-25 01:02:26 +02:00
|
|
|
select * from t2;
|
|
|
|
show status like 'Slave_open_temp_tables';
|
2001-01-03 02:15:48 +02:00
|
|
|
#
|
|
|
|
# Clean up
|
|
|
|
#
|
2001-03-25 01:02:26 +02:00
|
|
|
connect (master2,localhost,root,,);
|
2001-01-03 02:15:48 +02:00
|
|
|
connection master2;
|
|
|
|
drop table if exists t1,t2;
|
2001-01-17 05:47:33 -07:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|