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

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

29 30 31
connection master;
drop table if exists t1,t2;
create table t1(n int);
unknown's avatar
unknown committed
32
let $1=10;
33 34 35 36 37 38 39 40
while ($1)
{
 eval insert into t1 values($1);
 dec $1;
}
create table t2(id int);
insert into t2 values(connection_id());
save_master_pos;
unknown's avatar
unknown committed
41 42 43 44 45 46 47 48

connection master1;
#avoid generating result
create temporary table t1_temp(n int);
insert into t1_temp select get_lock('crash_lock', 1) from t2;

connection master;
send update t1 set n = n + get_lock('crash_lock', 2);
49
connection master1;
unknown's avatar
unknown committed
50
sleep 2;
51 52 53 54 55 56 57 58
select (@id := id) - id from t2;
kill @id;
drop table t2;
connection master;
--error 1053;
reap;
connection slave;
sync_with_master ;
59 60
#give the slave a chance to exit
sleep 0.5;
61 62 63 64 65 66

# The following test can't be done because the result of Pos will differ
# on different computes
# --replace_result 9306 9999 3334 9999 3335 9999
# show slave status;

67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
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;

84