@@ -8,26 +8,25 @@ connection master;
88use test;
99connection slave;
1010/*M!999999\- enable the sandbox mode */
11- -- SET GLOBAL gtid_slave_pos='';
1211CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
1312
13+ -- SET GLOBAL gtid_slave_pos='';
1414/*M!999999\- enable the sandbox mode */
1515STOP ALL SLAVES;
16- -- SET GLOBAL gtid_slave_pos='';
1716CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
1817
18+ -- SET GLOBAL gtid_slave_pos='';
1919START ALL SLAVES;
2020/*M!999999\- enable the sandbox mode */
2121STOP ALL SLAVES;
22- -- SET GLOBAL gtid_slave_pos='';
2322CHANGE MASTER '' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
2423
24+ -- SET GLOBAL gtid_slave_pos='';
2525START ALL SLAVES;
2626start slave;
2727Warnings:
2828Note 1254 Slave is already running
2929/*M!999999\- enable the sandbox mode */
30- -- SET GLOBAL gtid_slave_pos='';
3130CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
3231
3332start slave;
@@ -46,72 +45,72 @@ DROP TABLE t2;
46451. --dump-slave=1 --gtid
4746
4847/*M!999999\- enable the sandbox mode */
49- SET GLOBAL gtid_slave_pos='0-1-1001';
5048CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
5149-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
5250
51+ SET GLOBAL gtid_slave_pos='0-1-1001';
5352
54531a. --dump-slave=1
5554
5655/*M!999999\- enable the sandbox mode */
57- -- SET GLOBAL gtid_slave_pos='0-1-1001';
5856CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
5957
58+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
6059
61602. --dump-slave=2 --gtid
6261
6362/*M!999999\- enable the sandbox mode */
64- -- SET GLOBAL gtid_slave_pos='0-1-1001';
6563-- CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
6664-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
6765
66+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
6867
69682. --dump-slave=2
7069
7170/*M!999999\- enable the sandbox mode */
72- -- SET GLOBAL gtid_slave_pos='0-1-1001';
7371-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
7472
73+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
7574*** Test mysqldump --master-data GTID/non-gtid functionality.
7675
77761. --master-data=1 --gtid
7877
7978/*M!999999\- enable the sandbox mode */
8079CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
81- SET GLOBAL gtid_slave_pos='0-2-1003';
8280-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
81+ SET GLOBAL gtid_slave_pos='0-2-1003';
8382
84831a. --master-data=1
8584
8685/*M!999999\- enable the sandbox mode */
87- -- SET GLOBAL gtid_slave_pos='0-2-1003';
8886CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
87+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
8988
90892. --master-data=2 --gtid
9190
9291/*M!999999\- enable the sandbox mode */
9392-- CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
94- -- SET GLOBAL gtid_slave_pos='0-2-1003';
9593-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
94+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
9695
97962a. --master-data=2
9897
9998/*M!999999\- enable the sandbox mode */
100- -- SET GLOBAL gtid_slave_pos='0-2-1003';
10199-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
100+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
102101
1031023. --master-data --single-transaction --gtid
104103
105104/*M!999999\- enable the sandbox mode */
106105CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
107- SET GLOBAL gtid_slave_pos='0-2-1003';
108106-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
107+ SET GLOBAL gtid_slave_pos='0-2-1003';
109108
1101093a. --master-data --single-transaction
111110
112111/*M!999999\- enable the sandbox mode */
113- -- SET GLOBAL gtid_slave_pos='0-2-1003';
114112CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
113+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
115114
1161154. --master-data=2 --dump-slave=2 --single-transaction --gtid (MDEV-4827)
117116
@@ -130,11 +129,9 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
130129/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
131130/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
132131/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
133-
134- -- Preferably use GTID to start replication from GTID position:
135-
136132-- CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
137- -- SET GLOBAL gtid_slave_pos='0-2-1003';
133+
134+ -- A corresponding to the above master-data CHANGE-MASTER settings to the slave gtid state is printed later in the file.
138135
139136--
140137-- Alternately, following is the position of the binary logging from SHOW MASTER STATUS at point of backup.
@@ -149,14 +146,24 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
149146-- Use this position when creating a clone of, or replacement server, from where the backup was taken.
150147-- This new server will connects to the same primary server(s).
151148--
152- -- GTID position to start replication:
153- -- SET GLOBAL gtid_slave_pos='0-1-1001';
149+
150+ -- A corresponding to the below dump-slave CHANGE-MASTER settings to the slave gtid state is printed later in the file.
154151
155152-- Use only the MASTER_USE_GTID=slave_pos or MASTER_LOG_FILE/MASTER_LOG_POS in the statements below.
156153
157154-- CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
158155-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
159156
157+
158+ -- The deferred gtid setting for slave corresponding to the master-data CHANGE-MASTER follows
159+
160+ -- Preferably use GTID to start replication from GTID position:
161+
162+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
163+
164+ -- The deferred gtid setting for slave corresponding to the dump-slave CHANGE-MASTER follows
165+ -- GTID position to start replication:
166+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
160167/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
161168
162169/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -187,10 +194,6 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
187194/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
188195/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
189196
190- -- Preferably use GTID to start replication from GTID position:
191-
192- -- SET GLOBAL gtid_slave_pos='0-2-1003';
193-
194197--
195198-- Alternately, following is the position of the binary logging from SHOW MASTER STATUS at point of backup.
196199-- Use this when creating a replica of the primary server where the backup was made.
@@ -199,15 +202,27 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
199202
200203-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
201204
205+ -- A corresponding to the above master-data CHANGE-MASTER settings to the slave gtid state is printed as comments later in the file.
206+
202207--
203208-- The following is the SQL position of the replication taken from SHOW SLAVE STATUS at the time of backup.
204209-- Use this position when creating a clone of, or replacement server, from where the backup was taken.
205210-- This new server will connects to the same primary server(s).
206211--
207- -- GTID position to start replication:
208- -- SET GLOBAL gtid_slave_pos='0-1-1001';
212+
213+ -- A corresponding to the below dump-slave CHANGE-MASTER settings to the slave gtid state is printed later in the file.
209214-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
210215
216+
217+ -- The deferred gtid setting for slave corresponding to the master-data CHANGE-MASTER follows
218+
219+ -- Preferably use GTID to start replication from GTID position:
220+
221+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
222+
223+ -- The deferred gtid setting for slave corresponding to the dump-slave CHANGE-MASTER follows
224+ -- GTID position to start replication:
225+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
211226/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
212227
213228/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -232,8 +247,8 @@ change master to master_use_gtid=slave_pos;
232247connection master;
233248# Ensuring the binlog dump thread is killed on primary...
234249/*M!999999\- enable the sandbox mode */
235- -- SET GLOBAL gtid_slave_pos='0-1-1005';
236250-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=BINLOG_START;
251+ -- SET GLOBAL gtid_slave_pos='0-1-1005';
237252connection slave;
238253include/start_slave.inc
239254include/rpl_end.inc
0 commit comments