1
-- source include/have_binlog_format_mixed_or_statement.inc
2
-- source include/master-slave.inc
4
# Test is dependent on binlog positions
6
# prepare version for substitutions
7
let $VERSION=`select version()`;
9
# stop slave before he will start replication also sync with master
10
# for avoiding undetermenistic behaviour
15
# Make sure the slave sql and io thread has stopped
16
--source include/wait_for_slave_to_stop.inc
19
# create some events on master
20
create table t1(n int not null auto_increment primary key);
21
insert into t1 values (1),(2),(3),(4);
23
create table t2(n int not null auto_increment primary key);
24
insert into t2 values (1),(2);
25
insert into t2 values (3),(4);
28
# try to replicate all queries until drop of t1
30
start slave until master_log_file='master-bin.000001', master_log_pos=323;
31
--source include/wait_for_slave_sql_to_stop.inc
32
# here table should be still not deleted
34
source include/show_slave_status2.inc;
36
# this should fail right after start
37
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
38
--source include/wait_for_slave_sql_to_stop.inc
39
# again this table should be still not deleted
41
source include/show_slave_status2.inc;
43
# try replicate all up to and not including the second insert to t2;
44
start slave until relay_log_file='slave-relay-bin.000003', relay_log_pos=746;
45
--source include/wait_for_slave_sql_to_stop.inc
47
source include/show_slave_status2.inc;
56
# Make sure the slave sql and io thread has stopped
57
--source include/wait_for_slave_to_stop.inc
59
# this should stop immediately as we are already there
60
start slave until master_log_file='master-bin.000001', master_log_pos=776;
61
--source include/wait_for_slave_sql_to_stop.inc
62
# here the sql slave thread should be stopped
63
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
64
source include/show_slave_status2.inc;
66
#testing various error conditions
68
start slave until master_log_file='master-bin', master_log_pos=561;
70
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
72
start slave until master_log_file='master-bin.000001';
74
start slave until relay_log_file='slave-relay-bin.000002';
76
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
77
# Warning should be given for second command
78
start slave sql_thread;
79
start slave until master_log_file='master-bin.000001', master_log_pos=776;