1
-- source include/not_ndb_default.inc
2
-- source include/have_binlog_format_row.inc
3
-- source include/master-slave.inc
5
# Test is dependent on binlog positions
7
# prepare version for substitutions
8
let $VERSION=`select version()`;
10
# stop slave before he will start replication also sync with master
11
# for avoiding undetermenistic behaviour
16
# Make sure the slave sql and io thread has stopped
17
--source include/wait_for_slave_to_stop.inc
20
# create some events on master
21
create table t1(n int not null auto_increment primary key);
22
insert into t1 values (1),(2),(3),(4);
24
create table t2(n int not null auto_increment primary key);
25
insert into t2 values (1),(2);
26
insert into t2 values (3),(4);
29
# try to replicate all queries until drop of t1
31
start slave until master_log_file='master-bin.000001', master_log_pos=311;
32
--source include/wait_for_slave_sql_to_stop.inc
33
# here table should be still not deleted
35
source include/show_slave_status.inc;
37
# this should fail right after start
38
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
39
--source include/wait_for_slave_sql_to_stop.inc
40
# again this table should be still not deleted
42
source include/show_slave_status.inc;
44
# try replicate all up to and not including the second insert to t2;
45
start slave until relay_log_file='slave-relay-bin.000003', relay_log_pos=728;
46
--source include/wait_for_slave_sql_to_stop.inc
48
source include/show_slave_status.inc;
57
# Make sure the slave sql and io thread has stopped
58
--source include/wait_for_slave_to_stop.inc
60
# this should stop immediately as we are already there
61
start slave until master_log_file='master-bin.000001', master_log_pos=740;
62
--source include/wait_for_slave_sql_to_stop.inc
63
# here the sql slave thread should be stopped
64
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
65
source include/show_slave_status.inc;
67
#testing various error conditions
69
start slave until master_log_file='master-bin', master_log_pos=561;
71
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
73
start slave until master_log_file='master-bin.000001';
75
start slave until relay_log_file='slave-relay-bin.000002';
77
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
78
# Warning should be given for second command
79
start slave sql_thread;
80
start slave until master_log_file='master-bin.000001', master_log_pos=740;