3
# Verify that START SLAVE UNTIL replicates until the given binlog
4
# position but not longer. Verify that START SLAVE UNTIL with various
5
# incorrect arguments gives an error.
9
# On master, create a table and insert some rows. On slave, START
10
# SLAVE UNTIL so that it reads one event at a time, and check the
11
# table and the slave status each time.
13
# Then, on slave, run START SLAVE UNTIL with incorrect arguments and
14
# verify that it gives an error.
16
# ==== Related bugs ====
18
# Bug in this test: BUG#37717: rpl.rpl_stm_until 'stmt' fails sporadically on pushbuild
1
20
-- source include/have_binlog_format_mixed_or_statement.inc
2
21
-- source include/master-slave.inc
4
23
# 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
25
# Stop slave before it starts replication. Also sync with master
26
# to avoid nondeterministic behaviour.
28
sync_slave_with_master;
29
--source include/stop_slave.inc
31
--echo ==== Create some events on master ====
19
# create some events on master
20
35
create table t1(n int not null auto_increment primary key);
21
36
insert into t1 values (1),(2),(3),(4);
25
40
insert into t2 values (3),(4);
43
--echo ==== Replicate one event at a time on slave ====
28
45
# try to replicate all queries until drop of t1
30
48
start slave until master_log_file='master-bin.000001', master_log_pos=323;
49
--source include/wait_for_slave_io_to_start.inc
31
50
--source include/wait_for_slave_sql_to_stop.inc
32
51
# here table should be still not deleted
36
55
# this should fail right after start
37
56
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
57
--source include/wait_for_slave_io_to_start.inc
38
58
--source include/wait_for_slave_sql_to_stop.inc
39
59
# again this table should be still not deleted
43
63
# try replicate all up to and not including the second insert to t2;
44
64
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
65
--source include/wait_for_slave_io_to_start.inc
45
66
--source include/wait_for_slave_sql_to_stop.inc
47
68
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
75
sync_slave_with_master;
76
--source include/stop_slave.inc
59
78
# this should stop immediately as we are already there
60
79
start slave until master_log_file='master-bin.000001', master_log_pos=776;
80
--source include/wait_for_slave_io_to_start.inc
61
81
--source include/wait_for_slave_sql_to_stop.inc
62
# here the sql slave thread should be stopped
63
82
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
64
83
source include/show_slave_status2.inc;
66
#testing various error conditions
85
--echo ==== Test various error conditions ====
68
88
start slave until master_log_file='master-bin', master_log_pos=561;