rpl000001.test 1.43 KB
Newer Older
1
source include/master-slave.inc;
2 3
connection master;
use test;
4 5 6
drop table if exists t1;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
7
drop table if exists foo;
8 9
set password = password('foo');
set password = password('');
10 11
create table foo(n int);
insert into foo values(1),(2);
12
save_master_pos;
13
connection slave;
14
sync_with_master;
15
use test;
16 17
select * from foo;
select sum(length(word)) from t1;
18 19
connection master;
drop table t1;
20 21 22
save_master_pos;
connection slave;
sync_with_master;
23

24
#test handling of aborted connection in the middle of update
25 26 27 28 29
connection master;
reset master;
connection slave;
reset slave;

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
connection master;
drop table if exists t1,t2;
create table t1(n int);
let $1=30000;
while ($1)
{
 eval insert into t1 values($1);
 dec $1;
}
create table t2(id int);
insert into t2 values(connection_id());
save_master_pos;
send update t1 set n = n + 1;
connection master1;
select (@id := id) - id from t2;
sleep 0.1;
kill @id;
drop table t2;
connection master;
--error 1053;
reap;
connection slave;
sync_with_master ;
53 54
#give the slave a chance to exit
sleep 0.5;
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
show slave status;
set sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
connection master1;
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
save_master_pos;
connection slave;
sync_with_master;
select n from t1;
connection master1;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

73