Debian Codegraph @

mysql-test/suite/binlog_encryption/rpl_gtid_basic.result

raw
1 include/rpl_init.inc [topology=1->2->3->4]
2 connection server_1;
3 *** GTID position should be empty here ***
4 SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
5 BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
6
7 CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
8 CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
9 INSERT INTO t1 VALUES (1, "m1");
10 INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
11 INSERT INTO t2 VALUES (1, "i1");
12 BEGIN;
13 INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
14 INSERT INTO t2 VALUES (4, "i4");
15 COMMIT;
16 *** GTID position should be non-empty here ***
17 SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
18 BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
19 <GTID_POS_SERVER_1>
20 connection server_2;
21 *** GTID position should be the same as on server_1 ***
22 SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
23 BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
24 <GTID_POS_SERVER_1>
25 SELECT * FROM t1 ORDER BY a;
26 a b
27 1 m1
28 2 m2
29 3 m3
30 4 m4
31 SELECT * FROM t2 ORDER BY a;
32 a b
33 1 i1
34 2 i2
35 3 i3
36 4 i4
37 connection server_3;
38 SELECT * FROM t1 ORDER BY a;
39 a b
40 1 m1
41 2 m2
42 3 m3
43 4 m4
44 SELECT * FROM t2 ORDER BY a;
45 a b
46 1 i1
47 2 i2
48 3 i3
49 4 i4
50 connection server_4;
51 SELECT * FROM t1 ORDER BY a;
52 a b
53 1 m1
54 2 m2
55 3 m3
56 4 m4
57 SELECT * FROM t2 ORDER BY a;
58 a b
59 1 i1
60 2 i2
61 3 i3
62 4 i4
63 *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
64 connection server_4;
65 include/stop_slave.inc
66 connection server_1;
67 INSERT INTO t1 VALUES (5, "m1a");
68 INSERT INTO t2 VALUES (5, "i1a");
69 connection server_4;
70 CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
71 MASTER_USE_GTID=CURRENT_POS;
72 include/start_slave.inc
73 SELECT * FROM t1 ORDER BY a;
74 a b
75 1 m1
76 2 m2
77 3 m3
78 4 m4
79 5 m1a
80 SELECT * FROM t2 ORDER BY a;
81 a b
82 1 i1
83 2 i2
84 3 i3
85 4 i4
86 5 i1a
87 *** Now move B to D (C is still replicating from B) ***
88 connection server_2;
89 include/stop_slave.inc
90 CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
91 MASTER_USE_GTID=CURRENT_POS;
92 include/start_slave.inc
93 connection server_4;
94 UPDATE t2 SET b="j1a" WHERE a=5;
95 connection server_2;
96 SELECT * FROM t1 ORDER BY a;
97 a b
98 1 m1
99 2 m2
100 3 m3
101 4 m4
102 5 m1a
103 SELECT * FROM t2 ORDER BY a;
104 a b
105 1 i1
106 2 i2
107 3 i3
108 4 i4
109 5 j1a
110 *** Now move C to D, after letting it fall a little behind ***
111 connection server_3;
112 include/stop_slave.inc
113 connection server_1;
114 INSERT INTO t2 VALUES (6, "i6b");
115 INSERT INTO t2 VALUES (7, "i7b");
116 include/save_master_gtid.inc
117 connection server_3;
118 CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
119 MASTER_USE_GTID=CURRENT_POS;
120 include/start_slave.inc
121 include/sync_with_master_gtid.inc
122 SELECT * FROM t2 ORDER BY a;
123 a b
124 1 i1
125 2 i2
126 3 i3
127 4 i4
128 5 j1a
129 6 i6b
130 7 i7b
131 *** Now change everything back to what it was, to make rpl_end.inc happy
132 connection server_2;
133 include/sync_with_master_gtid.inc
134 include/stop_slave.inc
135 CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_MYPORT;
136 include/start_slave.inc
137 include/wait_for_slave_to_start.inc
138 connection server_3;
139 include/stop_slave.inc
140 CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_MYPORT;
141 include/start_slave.inc
142 include/sync_with_master_gtid.inc
143 connection server_4;
144 include/stop_slave.inc
145 CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
146 include/start_slave.inc
147 connection server_1;
148 DROP TABLE t1,t2;
149 include/save_master_gtid.inc
150 *** A few more checks for BINLOG_GTID_POS function ***
151 SELECT BINLOG_GTID_POS();
152 ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
153 SELECT BINLOG_GTID_POS('a');
154 ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
155 SELECT BINLOG_GTID_POS('a',1,NULL);
156 ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
157 SELECT BINLOG_GTID_POS(1,'a');
158 BINLOG_GTID_POS(1,'a')
159 NULL
160 Warnings:
161 Warning 1292 Truncated incorrect INTEGER value: 'a'
162 SELECT BINLOG_GTID_POS(NULL,NULL);
163 BINLOG_GTID_POS(NULL,NULL)
164 NULL
165 SELECT BINLOG_GTID_POS('',1);
166 BINLOG_GTID_POS('',1)
167
168 SELECT BINLOG_GTID_POS('a',1);
169 BINLOG_GTID_POS('a',1)
170 NULL
171 SELECT BINLOG_GTID_POS('master-bin.000001',-1);
172 BINLOG_GTID_POS('master-bin.000001',-1)
173 NULL
174 SELECT BINLOG_GTID_POS('master-bin.000001',0);
175 BINLOG_GTID_POS('master-bin.000001',0)
176
177 SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551615);
178 BINLOG_GTID_POS('master-bin.000001',18446744073709551615)
179 NULL
180 SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551616);
181 BINLOG_GTID_POS('master-bin.000001',18446744073709551616)
182 NULL
183 Warnings:
184 Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated
185 SET sql_log_bin= 0;
186 CREATE TABLE t1 AS SELECT MASTER_POS_WAIT(@binlog_file, 4, 0);
187 SELECT BINLOG_GTID_POS(@binlog_file, 4);
188 BINLOG_GTID_POS(@binlog_file, 4)
189 NULL
190 DROP TABLE t1;
191 SET sql_log_bin= 1;
192 *** Some tests of @@GLOBAL.gtid_binlog_state ***
193 connection server_2;
194 include/sync_with_master_gtid.inc
195 include/stop_slave.inc
196 connection server_1;
197 SET @old_state= @@GLOBAL.gtid_binlog_state;
198 SET GLOBAL gtid_binlog_state = '';
199 ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log
200 RESET MASTER;
201 SET GLOBAL gtid_binlog_state = '';
202 FLUSH LOGS;
203 show binary logs;
204 Log_name File_size
205 master-bin.000001 #
206 master-bin.000002 #
207 SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
208 show binary logs;
209 Log_name File_size
210 master-bin.000001 #
211 include/show_binlog_events.inc
212 Log_name Pos Event_type Server_id End_log_pos Info
213 master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
214 master-bin.000001 # Start_encryption # #
215 master-bin.000001 # Gtid_list # # [#-#-#]
216 master-bin.000001 # Binlog_checkpoint # # master-bin.000001
217 SET GLOBAL gtid_binlog_state = @old_state;
218 ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log
219 RESET MASTER;
220 SET GLOBAL gtid_binlog_state = @old_state;
221 CREATE TABLE t1 (a INT PRIMARY KEY);
222 SET gtid_seq_no=100;
223 INSERT INTO t1 VALUES (1);
224 include/save_master_gtid.inc
225 connection server_2;
226 include/start_slave.inc
227 include/sync_with_master_gtid.inc
228 SELECT * FROM t1;
229 a
230 1
231 Gtid_IO_Pos = '0-1-100'
232 *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
233 connection server_1;
234 DROP TABLE t1;
235 CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
236 connection server_2;
237 include/stop_slave.inc
238 connect m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
239 SELECT @@last_gtid;
240 @@last_gtid
241
242 SET gtid_seq_no=110;
243 SELECT @@last_gtid;
244 @@last_gtid
245
246 BEGIN;
247 SELECT @@last_gtid;
248 @@last_gtid
249
250 INSERT INTO t1 VALUES (2);
251 SELECT @@last_gtid;
252 @@last_gtid
253
254 COMMIT;
255 SELECT @@last_gtid;
256 @@last_gtid
257 0-1-110
258 connect s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
259 SET @pos= '0-1-110';
260 SELECT master_gtid_wait(NULL);
261 master_gtid_wait(NULL)
262 NULL
263 SELECT master_gtid_wait('', NULL);
264 master_gtid_wait('', NULL)
265 0
266 SHOW STATUS LIKE 'Master_gtid_wait_count';
267 Variable_name Value
268 Master_gtid_wait_count 1
269 SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
270 Variable_name Value
271 Master_gtid_wait_timeouts 0
272 SHOW STATUS LIKE 'Master_gtid_wait_time';
273 Variable_name Value
274 Master_gtid_wait_time 0
275 SELECT master_gtid_wait(@pos, 0.5);
276 master_gtid_wait(@pos, 0.5)
277 -1
278 SELECT * FROM t1 ORDER BY a;
279 a
280 SELECT master_gtid_wait(@pos);
281 connection server_2;
282 include/start_slave.inc
283 connection s1;
284 master_gtid_wait(@pos)
285 0
286 SELECT * FROM t1 ORDER BY a;
287 a
288 2
289 include/stop_slave.inc
290 connection server_1;
291 SET gtid_domain_id= 1;
292 INSERT INTO t1 VALUES (3);
293 connection s1;
294 SET @pos= 'POS';
295 SELECT master_gtid_wait(@pos, 0);
296 master_gtid_wait(@pos, 0)
297 -1
298 SELECT * FROM t1 WHERE a >= 3;
299 a
300 SELECT master_gtid_wait(@pos, -1);
301 connection server_2;
302 include/start_slave.inc
303 connection s1;
304 master_gtid_wait(@pos, -1)
305 0
306 SELECT * FROM t1 WHERE a >= 3;
307 a
308 3
309 SELECT master_gtid_wait('1-1-1', 0);
310 master_gtid_wait('1-1-1', 0)
311 0
312 connection s1;
313 SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
314 connect s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
315 SELECT master_gtid_wait('0-1-1000', 0.5);
316 connect s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
317 SELECT master_gtid_wait('0-1-2000');
318 connect s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
319 SELECT master_gtid_wait('2-1-10');
320 connect s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
321 SELECT master_gtid_wait('2-1-6', 1);
322 connect s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
323 SELECT master_gtid_wait('2-1-5');
324 connect s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
325 SELECT master_gtid_wait('2-1-10');
326 connect s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
327 SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
328 connect s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
329 SELECT master_gtid_wait('2-1-2');
330 connection server_2;
331 SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
332 Variable_name Value
333 Master_gtid_wait_timeouts 0
334 SHOW STATUS LIKE 'Master_gtid_wait_count';
335 Variable_name Value
336 Master_gtid_wait_count 3
337 SELECT master_gtid_wait('1-1-1');
338 master_gtid_wait('1-1-1')
339 0
340 SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
341 Variable_name Value
342 Master_gtid_wait_timeouts 0
343 SHOW STATUS LIKE 'Master_gtid_wait_count';
344 Variable_name Value
345 Master_gtid_wait_count 4
346 SET @a= MASTER_GTID_WAIT_TIME;
347 SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
348 AS Master_gtid_wait_time_as_expected;
349 Master_gtid_wait_time_as_expected
350 OK
351 connect s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
352 SELECT master_gtid_wait('0-1-109');
353 connection server_2;
354 SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
355 Variable_name Value
356 Master_gtid_wait_timeouts 0
357 SHOW STATUS LIKE 'Master_gtid_wait_count';
358 Variable_name Value
359 Master_gtid_wait_count 4
360 SELECT master_gtid_wait('2-1-2', 0.5);
361 master_gtid_wait('2-1-2', 0.5)
362 -1
363 SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
364 Variable_name Value
365 Master_gtid_wait_timeouts 1
366 SHOW STATUS LIKE 'Master_gtid_wait_count';
367 Variable_name Value
368 Master_gtid_wait_count 5
369 SET @a= MASTER_GTID_WAIT_TIME;
370 SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
371 Master_gtid_wait_time_as_expected
372 OK
373 KILL QUERY KILL_ID;
374 connection s3;
375 ERROR 70100: Query execution was interrupted
376 connection server_1;
377 SET gtid_domain_id=2;
378 SET gtid_seq_no=2;
379 INSERT INTO t1 VALUES (4);
380 connection s9;
381 master_gtid_wait('2-1-2')
382 0
383 connection server_2;
384 KILL CONNECTION KILL_ID;
385 connection s6;
386 Got one of the listed errors
387 connection server_1;
388 SET gtid_domain_id=1;
389 SET gtid_seq_no=4;
390 INSERT INTO t1 VALUES (5);
391 SET gtid_domain_id=2;
392 SET gtid_seq_no=5;
393 INSERT INTO t1 VALUES (6);
394 connection s8;
395 master_gtid_wait('2-1-5,1-1-4,0-1-110')
396 0
397 connection s1;
398 master_gtid_wait('2-1-1,1-1-4,0-1-110')
399 0
400 connection s2;
401 master_gtid_wait('0-1-1000', 0.5)
402 -1
403 connection s5;
404 master_gtid_wait('2-1-6', 1)
405 -1
406 connection s10;
407 master_gtid_wait('0-1-109')
408 0
409 connection server_1;
410 SET gtid_domain_id=2;
411 SET gtid_seq_no=10;
412 INSERT INTO t1 VALUES (7);
413 connection s4;
414 master_gtid_wait('2-1-10')
415 0
416 connection s7;
417 master_gtid_wait('2-1-10')
418 0
419 *** Test gtid_slave_pos when used with GTID ***
420 connection server_2;
421 include/stop_slave.inc
422 connection server_1;
423 SET gtid_domain_id=2;
424 SET gtid_seq_no=1000;
425 INSERT INTO t1 VALUES (10);
426 INSERT INTO t1 VALUES (11);
427 connection server_2;
428 SET sql_slave_skip_counter= 1;
429 include/start_slave.inc
430 SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
431 a
432 11
433 SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
434 status
435 Ok
436 include/stop_slave.inc
437 connection server_1;
438 SET gtid_domain_id=2;
439 SET gtid_seq_no=1010;
440 INSERT INTO t1 VALUES (12);
441 INSERT INTO t1 VALUES (13);
442 connection server_2;
443 SET sql_slave_skip_counter= 2;
444 include/start_slave.inc
445 SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
446 a
447 11
448 13
449 SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
450 status
451 Ok
452 include/stop_slave.inc
453 connection server_1;
454 SET gtid_domain_id=2;
455 SET gtid_seq_no=1020;
456 INSERT INTO t1 VALUES (14);
457 INSERT INTO t1 VALUES (15);
458 INSERT INTO t1 VALUES (16);
459 connection server_2;
460 SET sql_slave_skip_counter= 3;
461 include/start_slave.inc
462 SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
463 a
464 11
465 13
466 15
467 16
468 SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
469 status
470 Ok
471 include/stop_slave.inc
472 connection server_1;
473 SET gtid_domain_id=2;
474 SET gtid_seq_no=1030;
475 SET @@binlog_annotate_row_events= 0;
476 INSERT INTO t1 VALUES (17);
477 INSERT INTO t1 VALUES (18);
478 INSERT INTO t1 VALUES (19);
479 SET @@binlog_annotate_row_events= 1;
480 connection server_2;
481 SET sql_slave_skip_counter= 5;
482 include/start_slave.inc
483 SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
484 a
485 11
486 13
487 15
488 16
489 19
490 SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
491 status
492 Ok
493 include/stop_slave.inc
494 connection server_1;
495 SET gtid_domain_id=3;
496 SET gtid_seq_no=100;
497 CREATE TABLE t2 (a INT PRIMARY KEY);
498 DROP TABLE t2;
499 SET gtid_domain_id=2;
500 SET gtid_seq_no=1040;
501 INSERT INTO t1 VALUES (20);
502 connection server_2;
503 SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
504 SET GLOBAL slave_ddl_exec_mode=STRICT;
505 SET sql_slave_skip_counter=1;
506 START SLAVE UNTIL master_gtid_pos="3-1-100";
507 include/sync_with_master_gtid.inc
508 include/wait_for_slave_to_stop.inc
509 SELECT * FROM t2;
510 ERROR 42S02: Table 'test.t2' doesn't exist
511 SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
512 status
513 Ok
514 SET sql_log_bin=0;
515 CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
516 SET sql_log_bin=1;
517 START SLAVE;
518 include/wait_for_slave_sql_error.inc [errno=1051]
519 SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
520 status
521 Ok
522 STOP SLAVE IO_THREAD;
523 SET sql_slave_skip_counter=2;
524 include/start_slave.inc
525 SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
526 a
527 20
528 SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
529 status
530 Ok
531 SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
532 status
533 Ok
534 SET GLOBAL slave_ddl_exec_mode= @saved_mode;
535 *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
536 connection server_1;
537 SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
538 INSERT INTO t1 VALUES (31);
539 connection server_2;
540 SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
541 INSERT INTO t1 VALUES (32);
542 connection server_1;
543 INSERT INTO t1 VALUES (33);
544 connection server_2;
545 connection server_3;
546 include/stop_slave.inc
547 connection server_1;
548 INSERT INTO t1 VALUES (34);
549 connection server_2;
550 connection server_3;
551 include/start_slave.inc
552 SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
553 a
554 31
555 32
556 33
557 34
558 connection server_4;
559 SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
560 a
561 31
562 32
563 33
564 34
565 *** MDEV-31723: Crash on SET SESSION gtid_seq_no= DEFAULT
566 connection server_1;
567 SET SESSION gtid_seq_no= 2000;
568 SELECT @@SESSION.gtid_seq_no;
569 @@SESSION.gtid_seq_no
570 2000
571 INSERT INTO t1 VALUES (40);
572 SELECT @@SESSION.gtid_seq_no;
573 @@SESSION.gtid_seq_no
574 0
575 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
576 dom0_pos
577 0-1-2000
578 INSERT INTO t1 VALUES (41);
579 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
580 dom0_pos
581 0-1-2001
582 SET SESSION gtid_seq_no= 2010;
583 INSERT INTO t1 VALUES (42);
584 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
585 dom0_pos
586 0-1-2010
587 SET @old_strict= @@GLOBAL.gtid_strict_mode;
588 SET GLOBAL gtid_strict_mode= 1;
589 SET SESSION gtid_seq_no= 0;
590 INSERT INTO t1 VALUES (43);
591 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
592 dom0_pos
593 0-1-2011
594 SET GLOBAL gtid_strict_mode= @old_strict;
595 INSERT INTO t1 VALUES (44);
596 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
597 dom0_pos
598 0-1-2012
599 SET SESSION gtid_seq_no= 2020;
600 SET SESSION gtid_seq_no= 2030;
601 INSERT INTO t1 VALUES (45);
602 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
603 dom0_pos
604 0-1-2030
605 SET SESSION gtid_seq_no= 2040;
606 SET SESSION gtid_seq_no= DEFAULT;
607 INSERT INTO t1 VALUES (46);
608 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
609 dom0_pos
610 0-1-2031
611 INSERT INTO t1 VALUES (47);
612 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
613 dom0_pos
614 0-1-2032
615 SET SESSION gtid_seq_no= 2050;
616 SET SESSION gtid_seq_no= 0;
617 INSERT INTO t1 VALUES (48);
618 SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
619 dom0_pos
620 0-1-2033
621 connection server_1;
622 DROP TABLE t1;
623 include/rpl_end.inc
624 #
625 # Start of 10.2 tests
626 #
627 #
628 # MDEV-10134 Add full support for DEFAULT
629 #
630 CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600));
631 ERROR HY000: Function or expression 'binlog_gtid_pos()' cannot be used in the DEFAULT clause of `a`
632 #
633 # End of 10.2 tests
634 #
635 #
636 # Start of 10.3 tests
637 #
638 #
639 # MDEV-13967 Parameter data type control for Item_long_func
640 #
641 SELECT MASTER_GTID_WAIT(ROW(1,1),'str');
642 ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait'
643 SELECT MASTER_GTID_WAIT('str',ROW(1,1));
644 ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait'
645 #
646 # End of 10.3 tests
647 #