1
# This test checks that a slave DOES execute queries originating
2
# from itself, if running with --replicate-same-server-id.
4
source include/master-slave.inc;
6
create table t1 (n int);
10
--source include/wait_for_slave_to_stop.inc
11
--replace_result $SLAVE_MYPORT SLAVE_PORT
12
eval change master to master_port=$SLAVE_MYPORT;
14
--source include/wait_for_slave_to_start.inc
15
insert into t1 values (1);
18
select * from t1; # check that indeed 2 were inserted
19
# We stop the slave before cleaning up otherwise we'll get
20
# 'drop table t1' executed twice, so an error in the slave.err
23
--source include/wait_for_slave_to_stop.inc
28
# Bug#38934 slave slave until does not work with --replicate-same-server-id
30
# Verifying that slave performs all events until the master_log_pos
31
# in presense of --replicate-same-server-id the slave is started with.
36
# setting the until position to correspond to the first following create table
37
# which will make the event executed and the slave sql thread stopped
39
let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
42
create table t1(n int);
43
create table t2(n int);
46
--replace_result $MASTER_MYPORT MASTER_PORT
47
eval change master to master_port=$MASTER_MYPORT;
48
--replace_result $until_pos UNTIL_POS
49
eval start slave until master_log_file='master-bin.000001', master_log_pos=$until_pos;
50
--source include/wait_for_slave_io_to_start.inc
51
--source include/wait_for_slave_sql_to_stop.inc
53
--echo *** checking until position execution: must be only t1 in the list ***
59
start slave sql_thread;
64
sync_slave_with_master;
67
--source include/rpl_end.inc