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
18
# create some events on master
19
create table t1(n int not null auto_increment primary key);
20
insert into t1 values (1),(2),(3),(4);
22
create table t2(n int not null auto_increment primary key);
23
insert into t2 values (1),(2);
24
insert into t2 values (3),(4);
27
# try to replicate all queries until drop of t1
29
start slave until master_log_file='master-bin.000001', master_log_pos=311;
31
wait_for_slave_to_stop;
32
# here table should be still not deleted
35
--replace_result $MASTER_MYPORT MASTER_MYPORT
36
--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
39
# this should fail right after start
40
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
41
# again this table should be still not deleted
44
wait_for_slave_to_stop;
46
--replace_result $MASTER_MYPORT MASTER_MYPORT
47
--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
50
# try replicate all up to and not including the second insert to t2;
51
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
53
wait_for_slave_to_stop;
56
--replace_result $MASTER_MYPORT MASTER_MYPORT
57
--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
68
# this should stop immediately as we are already there
69
start slave until master_log_file='master-bin.000001', master_log_pos=740;
71
wait_for_slave_to_stop;
72
# here the sql slave thread should be stopped
74
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
75
--replace_column 1 # 7 # 9 # 22 # 23 # 33 #
78
#testing various error conditions
80
start slave until master_log_file='master-bin', master_log_pos=561;
82
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
84
start slave until master_log_file='master-bin.000001';
86
start slave until relay_log_file='slave-relay-bin.000002';
88
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
89
# Warning should be given for second command
90
start slave sql_thread;
91
start slave until master_log_file='master-bin.000001', master_log_pos=740;