1--let $rpl_topology=1->2
2--source include/rpl_init.inc
3--source include/have_binlog_format_statement.inc
4
5--connection server_1
6SET @old_strict= @@GLOBAL.gtid_strict_mode;
7SET GLOBAL gtid_strict_mode= 1;
8select @@global.log_slave_updates;
9
10CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
11INSERT INTO t1 VALUES (1, 1);
12INSERT INTO t1 VALUES (2, 1);
13--save_master_pos
14
15--connection server_2
16SET @old_strict= @@GLOBAL.gtid_strict_mode;
17SET GLOBAL gtid_strict_mode= 1;
18select @@global.log_slave_updates;
19
20--sync_with_master
21SELECT * FROM t1 ORDER BY a;
22
23--source include/stop_slave.inc
24
25--connection server_1
26--replace_result $SLAVE_MYPORT SLAVE_PORT
27eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
28     master_user = 'root', master_use_gtid = current_pos;
29START SLAVE;
30--source include/wait_for_slave_to_start.inc
31
32--connection server_2
33INSERT INTO t1 VALUES (3, 2);
34INSERT INTO t1 VALUES (4, 2);
35--source include/save_master_gtid.inc
36
37--source include/show_binlog_events.inc
38
39--connection server_1
40--source include/sync_with_master_gtid.inc
41
42SELECT * FROM t1 ORDER BY a;
43
44--source include/stop_slave.inc
45RESET SLAVE;
46INSERT INTO t1 VALUES (5, 1);
47INSERT INTO t1 VALUES (6, 1);
48--source include/save_master_gtid.inc
49
50--connection server_2
51--replace_result $MASTER_MYPORT MASTER_PORT
52eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
53     master_use_gtid = current_pos;
54START SLAVE;
55--source include/sync_with_master_gtid.inc
56
57SELECT * FROM t1 ORDER BY a;
58
59# Cleanup.
60SET GLOBAL gtid_strict_mode= @old_strict;
61
62--connection server_1
63SET GLOBAL gtid_strict_mode= @old_strict;
64DROP TABLE t1;
65
66--source include/rpl_end.inc
67