2013-02-18 15:41:17 +01:00
include/rpl_init.inc [topology=1->2->3->4]
2016-03-25 20:51:22 +04:00
connection server_1;
2013-06-25 12:05:52 +04:00
*** GTID position should be empty here ***
SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
2013-02-18 15:41:17 +01:00
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, "m1");
INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
INSERT INTO t2 VALUES (1, "i1");
BEGIN;
INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
INSERT INTO t2 VALUES (4, "i4");
COMMIT;
2013-06-25 12:05:52 +04:00
*** GTID position should be non-empty here ***
SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
<GTID_POS_SERVER_1>
2016-03-25 20:51:22 +04:00
connection server_2;
2013-06-25 12:05:52 +04:00
*** GTID position should be the same as on server_1 ***
SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
<GTID_POS_SERVER_1>
2013-02-18 15:41:17 +01:00
SELECT * FROM t1 ORDER BY a;
a b
1 m1
2 m2
3 m3
4 m4
SELECT * FROM t2 ORDER BY a;
a b
1 i1
2 i2
3 i3
4 i4
2016-03-25 20:51:22 +04:00
connection server_3;
2013-02-18 15:41:17 +01:00
SELECT * FROM t1 ORDER BY a;
a b
1 m1
2 m2
3 m3
4 m4
SELECT * FROM t2 ORDER BY a;
a b
1 i1
2 i2
3 i3
4 i4
2016-03-25 20:51:22 +04:00
connection server_4;
2013-02-18 15:41:17 +01:00
SELECT * FROM t1 ORDER BY a;
a b
1 m1
2 m2
3 m3
4 m4
SELECT * FROM t2 ORDER BY a;
a b
1 i1
2 i2
3 i3
4 i4
2013-02-21 08:10:55 +01:00
*** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
2016-03-25 20:51:22 +04:00
connection server_4;
2013-02-21 08:10:55 +01:00
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2013-02-21 08:10:55 +01:00
INSERT INTO t1 VALUES (5, "m1a");
INSERT INTO t2 VALUES (5, "i1a");
2016-03-25 20:51:22 +04:00
connection server_4;
2013-02-21 08:10:55 +01:00
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
2013-05-22 17:36:48 +02:00
MASTER_USE_GTID=CURRENT_POS;
2013-02-21 08:10:55 +01:00
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a b
1 m1
2 m2
3 m3
4 m4
5 m1a
SELECT * FROM t2 ORDER BY a;
a b
1 i1
2 i2
3 i3
4 i4
5 i1a
*** Now move B to D (C is still replicating from B) ***
2016-03-25 20:51:22 +04:00
connection server_2;
2013-02-21 08:10:55 +01:00
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
2013-05-22 17:36:48 +02:00
MASTER_USE_GTID=CURRENT_POS;
2013-02-21 08:10:55 +01:00
include/start_slave.inc
2016-03-25 20:51:22 +04:00
connection server_4;
2013-02-21 08:10:55 +01:00
UPDATE t2 SET b="j1a" WHERE a=5;
2016-03-25 20:51:22 +04:00
connection server_2;
2013-02-21 08:10:55 +01:00
SELECT * FROM t1 ORDER BY a;
a b
1 m1
2 m2
3 m3
4 m4
5 m1a
SELECT * FROM t2 ORDER BY a;
a b
1 i1
2 i2
3 i3
4 i4
5 j1a
*** Now move C to D, after letting it fall a little behind ***
2016-03-25 20:51:22 +04:00
connection server_3;
2013-02-21 08:10:55 +01:00
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2013-02-21 08:10:55 +01:00
INSERT INTO t2 VALUES (6, "i6b");
INSERT INTO t2 VALUES (7, "i7b");
2014-02-07 20:24:39 +01:00
include/save_master_gtid.inc
2016-03-25 20:51:22 +04:00
connection server_3;
2013-02-21 08:10:55 +01:00
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
2013-05-22 17:36:48 +02:00
MASTER_USE_GTID=CURRENT_POS;
2013-02-21 08:10:55 +01:00
include/start_slave.inc
2014-02-07 20:24:39 +01:00
include/sync_with_master_gtid.inc
2013-02-21 08:10:55 +01:00
SELECT * FROM t2 ORDER BY a;
a b
1 i1
2 i2
3 i3
4 i4
5 j1a
6 i6b
7 i7b
*** Now change everything back to what it was, to make rpl_end.inc happy
2016-03-25 20:51:22 +04:00
connection server_2;
2014-02-07 20:24:39 +01:00
include/sync_with_master_gtid.inc
2013-02-21 08:10:55 +01:00
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_MYPORT;
include/start_slave.inc
2013-05-16 12:41:11 +02:00
include/wait_for_slave_to_start.inc
2016-03-25 20:51:22 +04:00
connection server_3;
2013-02-21 08:10:55 +01:00
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_MYPORT;
include/start_slave.inc
2014-02-07 20:24:39 +01:00
include/sync_with_master_gtid.inc
2016-03-25 20:51:22 +04:00
connection server_4;
2013-02-21 08:10:55 +01:00
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
include/start_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2013-02-18 15:41:17 +01:00
DROP TABLE t1,t2;
2014-02-08 22:28:41 +01:00
include/save_master_gtid.inc
2013-06-25 12:05:52 +04:00
*** A few more checks for BINLOG_GTID_POS function ***
SELECT BINLOG_GTID_POS();
ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
SELECT BINLOG_GTID_POS('a');
ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
SELECT BINLOG_GTID_POS('a',1,NULL);
ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
SELECT BINLOG_GTID_POS(1,'a');
BINLOG_GTID_POS(1,'a')
NULL
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'a'
SELECT BINLOG_GTID_POS(NULL,NULL);
BINLOG_GTID_POS(NULL,NULL)
NULL
SELECT BINLOG_GTID_POS('',1);
BINLOG_GTID_POS('',1)
SELECT BINLOG_GTID_POS('a',1);
BINLOG_GTID_POS('a',1)
NULL
SELECT BINLOG_GTID_POS('master-bin.000001',-1);
BINLOG_GTID_POS('master-bin.000001',-1)
NULL
SELECT BINLOG_GTID_POS('master-bin.000001',0);
BINLOG_GTID_POS('master-bin.000001',0)
SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551615);
BINLOG_GTID_POS('master-bin.000001',18446744073709551615)
NULL
SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551616);
BINLOG_GTID_POS('master-bin.000001',18446744073709551616)
NULL
Warnings:
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
2013-08-23 14:02:13 +02:00
*** Some tests of @@GLOBAL.gtid_binlog_state ***
2016-03-25 20:51:22 +04:00
connection server_2;
2014-02-08 22:28:41 +01:00
include/sync_with_master_gtid.inc
2013-08-23 14:02:13 +02:00
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2013-08-23 14:02:13 +02:00
SET @old_state= @@GLOBAL.gtid_binlog_state;
SET GLOBAL gtid_binlog_state = '';
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
RESET MASTER;
SET GLOBAL gtid_binlog_state = '';
FLUSH LOGS;
show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
show binary logs;
Log_name File_size
master-bin.000001 #
2014-08-06 13:07:16 +04:00
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
master-bin.000001 # Gtid_list # # [#-#-#]
master-bin.000001 # Binlog_checkpoint # # master-bin.000001
2013-08-23 14:02:13 +02:00
SET GLOBAL gtid_binlog_state = @old_state;
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
RESET MASTER;
SET GLOBAL gtid_binlog_state = @old_state;
CREATE TABLE t1 (a INT PRIMARY KEY);
2013-11-25 15:21:25 +01:00
SET gtid_seq_no=100;
2013-08-23 14:02:13 +02:00
INSERT INTO t1 VALUES (1);
2014-02-07 20:24:39 +01:00
include/save_master_gtid.inc
2016-03-25 20:51:22 +04:00
connection server_2;
2013-08-23 14:02:13 +02:00
include/start_slave.inc
2014-02-07 19:15:28 +01:00
include/sync_with_master_gtid.inc
2013-08-23 14:02:13 +02:00
SELECT * FROM t1;
a
1
2013-11-25 15:21:25 +01:00
Gtid_IO_Pos = '0-1-100'
2014-02-07 19:15:28 +01:00
*** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
2016-03-25 20:51:22 +04:00
connection server_1;
2014-02-07 19:15:28 +01:00
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
2016-03-25 20:51:22 +04:00
connection server_2;
2014-02-07 19:15:28 +01:00
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connect m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
2014-02-07 19:15:28 +01:00
SELECT @@last_gtid;
@@last_gtid
SET gtid_seq_no=110;
SELECT @@last_gtid;
@@last_gtid
BEGIN;
SELECT @@last_gtid;
@@last_gtid
INSERT INTO t1 VALUES (2);
SELECT @@last_gtid;
@@last_gtid
COMMIT;
SELECT @@last_gtid;
@@last_gtid
0-1-110
2016-03-25 20:51:22 +04:00
connect s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SET @pos= '0-1-110';
SELECT master_gtid_wait(NULL);
master_gtid_wait(NULL)
NULL
SELECT master_gtid_wait('', NULL);
master_gtid_wait('', NULL)
0
2015-03-12 06:43:38 +11:00
SHOW STATUS LIKE 'Master_gtid_wait_count';
Variable_name Value
Master_gtid_wait_count 1
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 0
SHOW STATUS LIKE 'Master_gtid_wait_time';
Variable_name Value
Master_gtid_wait_time 0
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait(@pos, 0.5);
master_gtid_wait(@pos, 0.5)
-1
SELECT * FROM t1 ORDER BY a;
a
SELECT master_gtid_wait(@pos);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-02-07 19:15:28 +01:00
include/start_slave.inc
2016-03-25 20:51:22 +04:00
connection s1;
2014-02-07 19:15:28 +01:00
master_gtid_wait(@pos)
0
SELECT * FROM t1 ORDER BY a;
a
2
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2014-02-07 19:15:28 +01:00
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (3);
2016-03-25 20:51:22 +04:00
connection s1;
2014-07-22 14:54:38 +04:00
SET @pos= 'POS';
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait(@pos, 0);
master_gtid_wait(@pos, 0)
-1
SELECT * FROM t1 WHERE a >= 3;
a
SELECT master_gtid_wait(@pos, -1);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-02-07 19:15:28 +01:00
include/start_slave.inc
2016-03-25 20:51:22 +04:00
connection s1;
2014-02-07 19:15:28 +01:00
master_gtid_wait(@pos, -1)
0
SELECT * FROM t1 WHERE a >= 3;
a
3
SELECT master_gtid_wait('1-1-1', 0);
master_gtid_wait('1-1-1', 0)
0
2016-03-25 20:51:22 +04:00
connection s1;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
2016-03-25 20:51:22 +04:00
connect s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('0-1-1000', 0.5);
2016-03-25 20:51:22 +04:00
connect s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('0-1-2000');
2016-03-25 20:51:22 +04:00
connect s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-10');
2016-03-25 20:51:22 +04:00
connect s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-08 01:16:45 +01:00
SELECT master_gtid_wait('2-1-6', 1);
2016-03-25 20:51:22 +04:00
connect s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-5');
2016-03-25 20:51:22 +04:00
connect s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-10');
2016-03-25 20:51:22 +04:00
connect s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
2016-03-25 20:51:22 +04:00
connect s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-2');
2016-03-25 20:51:22 +04:00
connection server_2;
2015-03-12 06:43:38 +11:00
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 0
SHOW STATUS LIKE 'Master_gtid_wait_count';
Variable_name Value
Master_gtid_wait_count 3
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('1-1-1');
master_gtid_wait('1-1-1')
0
2015-03-12 06:43:38 +11:00
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 0
SHOW STATUS LIKE 'Master_gtid_wait_count';
Variable_name Value
Master_gtid_wait_count 4
2015-03-16 14:40:29 +01:00
SET @a= MASTER_GTID_WAIT_TIME;
SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
AS Master_gtid_wait_time_as_expected;
Master_gtid_wait_time_as_expected
OK
2016-03-25 20:51:22 +04:00
connect s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('0-1-109');
2016-03-25 20:51:22 +04:00
connection server_2;
2015-03-12 06:43:38 +11:00
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 0
SHOW STATUS LIKE 'Master_gtid_wait_count';
Variable_name Value
Master_gtid_wait_count 4
2014-02-07 19:15:28 +01:00
SELECT master_gtid_wait('2-1-2', 0.5);
master_gtid_wait('2-1-2', 0.5)
-1
2015-03-12 06:43:38 +11:00
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 1
SHOW STATUS LIKE 'Master_gtid_wait_count';
Variable_name Value
Master_gtid_wait_count 5
2015-03-16 14:40:29 +01:00
SET @a= MASTER_GTID_WAIT_TIME;
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;
Master_gtid_wait_time_as_expected
OK
2014-02-08 01:16:45 +01:00
KILL QUERY KILL_ID;
2016-03-25 20:51:22 +04:00
connection s3;
2014-02-07 19:15:28 +01:00
ERROR 70100: Query execution was interrupted
2016-03-25 20:51:22 +04:00
connection server_1;
2014-02-07 19:15:28 +01:00
SET gtid_domain_id=2;
SET gtid_seq_no=2;
INSERT INTO t1 VALUES (4);
2016-03-25 20:51:22 +04:00
connection s9;
2014-02-07 19:15:28 +01:00
master_gtid_wait('2-1-2')
0
2016-03-25 20:51:22 +04:00
connection server_2;
2014-02-08 01:16:45 +01:00
KILL CONNECTION KILL_ID;
2016-03-25 20:51:22 +04:00
connection s6;
2014-12-02 12:10:21 +01:00
Got one of the listed errors
2016-03-25 20:51:22 +04:00
connection server_1;
2014-02-07 19:15:28 +01:00
SET gtid_domain_id=1;
SET gtid_seq_no=4;
INSERT INTO t1 VALUES (5);
SET gtid_domain_id=2;
SET gtid_seq_no=5;
INSERT INTO t1 VALUES (6);
2016-03-25 20:51:22 +04:00
connection s8;
2014-02-07 19:15:28 +01:00
master_gtid_wait('2-1-5,1-1-4,0-1-110')
0
2016-03-25 20:51:22 +04:00
connection s1;
2014-02-07 19:15:28 +01:00
master_gtid_wait('2-1-1,1-1-4,0-1-110')
0
2016-03-25 20:51:22 +04:00
connection s2;
2014-02-07 19:15:28 +01:00
master_gtid_wait('0-1-1000', 0.5)
-1
2016-03-25 20:51:22 +04:00
connection s5;
2014-02-08 01:16:45 +01:00
master_gtid_wait('2-1-6', 1)
-1
2016-03-25 20:51:22 +04:00
connection s10;
2014-02-07 19:15:28 +01:00
master_gtid_wait('0-1-109')
0
2016-03-25 20:51:22 +04:00
connection server_1;
2014-02-07 19:15:28 +01:00
SET gtid_domain_id=2;
SET gtid_seq_no=10;
INSERT INTO t1 VALUES (7);
2016-03-25 20:51:22 +04:00
connection s4;
2014-02-07 19:15:28 +01:00
master_gtid_wait('2-1-10')
0
2016-03-25 20:51:22 +04:00
connection s7;
2014-02-07 19:15:28 +01:00
master_gtid_wait('2-1-10')
0
2015-03-05 09:40:12 +01:00
*** Test gtid_slave_pos when used with GTID ***
2016-03-25 20:51:22 +04:00
connection server_2;
2014-06-25 15:24:11 +02:00
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2014-06-25 15:24:11 +02:00
SET gtid_domain_id=2;
SET gtid_seq_no=1000;
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-06-25 15:24:11 +02:00
SET sql_slave_skip_counter= 1;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
11
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;
status
Ok
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2014-06-25 15:24:11 +02:00
SET gtid_domain_id=2;
SET gtid_seq_no=1010;
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-06-25 15:24:11 +02:00
SET sql_slave_skip_counter= 2;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
11
13
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;
status
Ok
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2014-06-25 15:24:11 +02:00
SET gtid_domain_id=2;
SET gtid_seq_no=1020;
INSERT INTO t1 VALUES (14);
INSERT INTO t1 VALUES (15);
INSERT INTO t1 VALUES (16);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-06-25 15:24:11 +02:00
SET sql_slave_skip_counter= 3;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
11
13
15
16
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;
status
Ok
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2014-06-25 15:24:11 +02:00
SET gtid_domain_id=2;
SET gtid_seq_no=1030;
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-06-25 15:24:11 +02:00
SET sql_slave_skip_counter= 5;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
11
13
15
16
19
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;
status
Ok
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2014-06-25 15:24:11 +02:00
SET gtid_domain_id=3;
SET gtid_seq_no=100;
CREATE TABLE t2 (a INT PRIMARY KEY);
DROP TABLE t2;
SET gtid_domain_id=2;
SET gtid_seq_no=1040;
INSERT INTO t1 VALUES (20);
2016-03-25 20:51:22 +04:00
connection server_2;
2014-06-25 15:24:11 +02:00
SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
SET GLOBAL slave_ddl_exec_mode=STRICT;
SET sql_slave_skip_counter=1;
START SLAVE UNTIL master_gtid_pos="3-1-100";
include/sync_with_master_gtid.inc
2014-12-02 12:10:21 +01:00
include/wait_for_slave_to_stop.inc
2014-06-25 15:24:11 +02:00
SELECT * FROM t2;
ERROR 42S02: Table 'test.t2' doesn't exist
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;
status
Ok
SET sql_log_bin=0;
CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
SET sql_log_bin=1;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1051]
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;
status
Ok
STOP SLAVE IO_THREAD;
SET sql_slave_skip_counter=2;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
a
20
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;
status
Ok
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;
status
Ok
SET GLOBAL slave_ddl_exec_mode= @saved_mode;
2015-03-05 09:40:12 +01:00
*** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
2016-03-25 20:51:22 +04:00
connection server_1;
2015-03-05 09:40:12 +01:00
SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
INSERT INTO t1 VALUES (31);
2016-03-25 20:51:22 +04:00
connection server_2;
2015-03-05 09:40:12 +01:00
SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
INSERT INTO t1 VALUES (32);
2016-03-25 20:51:22 +04:00
connection server_1;
2015-03-05 09:40:12 +01:00
INSERT INTO t1 VALUES (33);
2016-03-25 20:51:22 +04:00
connection server_2;
connection server_3;
2015-03-05 09:40:12 +01:00
include/stop_slave.inc
2016-03-25 20:51:22 +04:00
connection server_1;
2015-03-05 09:40:12 +01:00
INSERT INTO t1 VALUES (34);
2016-03-25 20:51:22 +04:00
connection server_2;
connection server_3;
2015-03-05 09:40:12 +01:00
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
a
31
32
33
34
2016-03-25 20:51:22 +04:00
connection server_4;
2015-03-05 09:40:12 +01:00
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
a
31
32
33
2015-03-16 14:40:29 +01:00
34
2016-03-25 20:51:22 +04:00
connection server_1;
2013-08-23 14:02:13 +02:00
DROP TABLE t1;
2013-02-18 15:41:17 +01:00
include/rpl_end.inc
More test for MDEV-10134 Add full support for DEFAULT
Miscelaneous functions:
BENCHMARK(), SLEEP(), ROW_COUNT(), FOUND_ROWS(),
GET_LOCK(), RELEASE_LOCK(), IS_USED_LOCK(), IS_FREE_LOCK(),
MASTER_POS_WAIT(), MASTER_GTID_WAIT(), BINLOG_GTID_POS(),
ST_GIS_DEBUG(), DECODE_HISTOGRAM(),
2016-06-10 12:10:17 +04:00
#
# Start of 10.2 tests
#
#
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600));
2016-06-27 19:22:09 +02:00
ERROR HY000: Function or expression 'binlog_gtid_pos()' cannot be used in the DEFAULT clause of `a`
More test for MDEV-10134 Add full support for DEFAULT
Miscelaneous functions:
BENCHMARK(), SLEEP(), ROW_COUNT(), FOUND_ROWS(),
GET_LOCK(), RELEASE_LOCK(), IS_USED_LOCK(), IS_FREE_LOCK(),
MASTER_POS_WAIT(), MASTER_GTID_WAIT(), BINLOG_GTID_POS(),
ST_GIS_DEBUG(), DECODE_HISTOGRAM(),
2016-06-10 12:10:17 +04:00
#
# End of 10.2 tests
#