diff options
Diffstat (limited to 'mysql-test/suite/rpl/r')
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_drop_db.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_gtid_basic.result | 47 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result | 63 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result | 13 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_gtid_reconnect.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_gtid_startpos.result | 36 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_gtid_stop_start.result | 95 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_loaddata_m.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_mdev382.result | 2 |
9 files changed, 254 insertions, 12 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result index dda578a419e..800a70c8c9b 100644 --- a/mysql-test/suite/rpl/r/rpl_drop_db.result +++ b/mysql-test/suite/rpl/r/rpl_drop_db.result @@ -8,12 +8,12 @@ select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt'; create table mysqltest1.t2 (n int); create table mysqltest1.t3 (n int); drop database mysqltest1; -ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17 "File exists") +ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty") use mysqltest1; show tables; Tables_in_mysqltest1 drop database mysqltest1; -ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17 "File exists") +ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty") use mysqltest1; show tables; Tables_in_mysqltest1 diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result index f98a3bf322d..9c77f203b22 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result @@ -1,4 +1,8 @@ include/rpl_init.inc [topology=1->2->3->4] +*** GTID position should be empty here *** +SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>); +BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>) + 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"); @@ -8,6 +12,14 @@ BEGIN; INSERT INTO t2 VALUES (2, "i2"), (3, "i3"); INSERT INTO t2 VALUES (4, "i4"); COMMIT; +*** 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> +*** 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> SELECT * FROM t1 ORDER BY a; a b 1 m1 @@ -115,4 +127,39 @@ include/stop_slave.inc CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3; include/start_slave.inc DROP TABLE t1,t2; +*** 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. include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result index 59f288d4afd..7597813bcb1 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result @@ -29,6 +29,29 @@ include/start_slave.inc SELECT * FROM t1; a 1 +*** Test that setting @@gtid_domain_id or @@gtid_seq_no is not allowed inside a transaction. *** +BEGIN; +INSERT INTO t1 VALUES (100); +SET SESSION gtid_domain_id= 100; +ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction +SET SESSION gtid_seq_no= 100; +ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction +SET @old_domain= @@GLOBAL.gtid_domain_id; +SET GLOBAL gtid_domain_id= 100; +SELECT @@SESSION.gtid_domain_id; +@@SESSION.gtid_domain_id +0 +SET GLOBAL gtid_domain_id= @old_domain; +INSERT INTO t1 VALUES (101); +SELECT * FROM t1 ORDER BY a; +a +1 +100 +101 +ROLLBACK; +SELECT * FROM t1 ORDER BY a; +a +1 *** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. *** include/stop_slave.inc RESET MASTER; @@ -67,9 +90,38 @@ a 2 3 4 +*** MDEV-4688: Empty value of @@GLOBAL.gtid_slave_pos *** +include/stop_slave.inc +INSERT INTO t1 VALUES (5); +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output"; +SET GLOBAL debug_dbug="+d,gtid_fail_after_record_gtid"; +SET sql_log_bin=0; +CALL mtr.add_suppression('Got error 131 "Command not supported by database" during COMMIT'); +SET sql_log_bin=1; +START SLAVE; +include/wait_for_slave_sql_error.inc [errno=1180] +SELECT @@GLOBAL.gtid_slave_pos; +@@GLOBAL.gtid_slave_pos +0-1-2 +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +SET GLOBAL debug_dbug= @old_dbug; +START SLAVE SQL_THREAD; +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 *** Test slave requesting a GTID that is not present in the master's binlog *** include/stop_slave.inc -SET GLOBAL gtid_slave_pos = "0-1-3"; +SET GLOBAL gtid_slave_pos = "0-1-4"; START SLAVE; SET sql_log_bin=0; CALL mtr.add_suppression("Got fatal error .* from master when reading data from binary log: 'Error: connecting slave requested to start from GTID .*, which is not in the master's binlog'"); @@ -77,13 +129,13 @@ SET sql_log_bin=1; include/wait_for_slave_io_error.inc [errno=1236] Slave_IO_State = '' Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 0-1-3, which is not in the master's binlog'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 0-1-4, which is not in the master's binlog'' Using_Gtid = 'Current_Pos' include/stop_slave.inc -SET GLOBAL gtid_slave_pos = "0-1-2"; +SET GLOBAL gtid_slave_pos = "0-1-3"; START SLAVE; include/wait_for_slave_to_start.inc -INSERT INTO t1 VALUES (5); +INSERT INTO t1 VALUES (6); SELECT * FROM t1 ORDER BY a; a 1 @@ -91,6 +143,7 @@ a 3 4 5 +6 *** MDEV-4278: Slave does not detect that master is not GTID-aware *** include/stop_slave.inc SET @old_dbug= @@global.DEBUG_DBUG; @@ -98,7 +151,7 @@ SET GLOBAL debug_dbug="+d,simulate_non_gtid_aware_master"; START SLAVE; include/wait_for_slave_io_error.inc [errno=1233] SET GLOBAL debug_dbug= @old_dbug; -INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (7); START SLAVE; SET sql_log_bin=0; CALL mtr.add_suppression("The slave I/O thread stops because master does not support MariaDB global transaction id"); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result index 824fe8d879f..5a9acb157c6 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result @@ -1,10 +1,14 @@ include/rpl_init.inc [topology=1->2] +SET @old_strict= @@GLOBAL.gtid_strict_mode; +SET GLOBAL gtid_strict_mode= 1; select @@global.log_slave_updates; @@global.log_slave_updates 0 CREATE TABLE t1 (a INT PRIMARY KEY, b INT); INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (2, 1); +SET @old_strict= @@GLOBAL.gtid_strict_mode; +SET GLOBAL gtid_strict_mode= 1; select @@global.log_slave_updates; @@global.log_slave_updates 0 @@ -13,6 +17,10 @@ a b 1 1 2 1 include/stop_slave.inc +CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT, +master_user = 'root', master_use_gtid = current_pos; +START SLAVE; +include/wait_for_slave_to_start.inc INSERT INTO t1 VALUES (3, 2); INSERT INTO t1 VALUES (4, 2); include/show_binlog_events.inc @@ -23,9 +31,6 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, 2) slave-bin.000001 # Query # # COMMIT -CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT, -master_user = 'root', master_use_gtid = current_pos; -START SLAVE; SELECT * FROM t1 ORDER BY a; a b 1 1 @@ -47,5 +52,7 @@ a b 4 2 5 1 6 1 +SET GLOBAL gtid_strict_mode= @old_strict; +SET GLOBAL gtid_strict_mode= @old_strict; DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result index e9f64628e12..001362825f9 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result @@ -22,6 +22,7 @@ a include/kill_binlog_dump_threads.inc INSERT INTO t1 VALUES (10); SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output"; SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100"; include/start_slave.inc SELECT * FROM t1 ORDER BY a; @@ -64,6 +65,7 @@ a 13 include/kill_binlog_dump_threads.inc INSERT INTO t1 VALUES (20); +SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output"; SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100"; include/start_slave.inc SELECT * FROM t1 ORDER BY a; @@ -99,6 +101,7 @@ SET gtid_domain_id= 10; SET gtid_seq_no= 200; INSERT INTO t1 VALUES (13); SET gtid_domain_id= 10; +SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output"; SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100"; START SLAVE UNTIL master_gtid_pos="9-1-50,10-1-200"; include/wait_for_slave_to_stop.inc @@ -129,6 +132,7 @@ SET GLOBAL debug_dbug= @old_debug; TRUNCATE t1; RESET MASTER; include/kill_binlog_dump_threads.inc +SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output"; SET GLOBAL debug_dbug="+d,binlog_force_reconnect_after_22_events"; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t2 VALUES (1); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result index d226ffa68f7..9be5903b2e9 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result @@ -188,5 +188,41 @@ include/start_slave.inc SELECT '0-1-2' AS Gtid_Slave_Pos; Gtid_Slave_Pos 0-1-2 +*** MDEV-4483: Slave loses traditional master coordinates immediately on CHANGE MASTER TO MASTER_USE_GTID = 1 *** +include/stop_slave.inc +DROP TABLE t1; +RESET SLAVE ALL; +RESET MASTER; +SET GLOBAL gtid_slave_pos= ""; +CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=no, master_log_file="", master_log_pos= 4; +DROP TABLE t1; +RESET MASTER; +CREATE TABLE t1 (a INT PRIMARY KEY); +include/start_slave.inc +include/stop_slave.inc +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +START SLAVE UNTIL master_log_file='LOG_FILE1', master_log_pos=LOG_POS1; +include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t1; +a +1 +include/wait_for_slave_param.inc [Read_Master_Log_Pos] +include/stop_slave_io.inc +CHANGE MASTER TO master_use_gtid=slave_pos; +SET GLOBAL gtid_slave_pos="0-42-42"; +SET sql_log_bin=0; +call mtr.add_suppression("Error: connecting slave requested to start from GTID"); +SET sql_log_bin=1; +START SLAVE; +include/wait_for_slave_io_error.inc [errno=1236] +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +CHANGE MASTER TO master_use_gtid=no; +include/start_slave.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result index b524ab17c23..6d607ff0277 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result @@ -59,6 +59,101 @@ OK SELECT IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2)); IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2)) OK +INSERT INTO t1 VALUES (6); include/start_slave.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +*** MDEV-4490: Old-style master position points at the last GTID event after slave restart *** +INSERT INTO t1 VALUES (7); +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +7 +include/wait_for_slave_to_start.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +7 +*** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable +include/stop_slave.inc +CHANGE MASTER TO master_use_gtid= no; +include/start_slave.inc +INSERT INTO t1 VALUES (8); +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +7 +8 +include/stop_slave.inc +SET sql_log_bin= 0; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +SET sql_log_bin= 1; +SELECT * FROM mysql.gtid_slave_pos; +ERROR 42000: Unknown storage engine 'InnoDB' +SET sql_log_bin=0; +call mtr.add_suppression("Failed to load slave replication state from table"); +call mtr.add_suppression("Unable to load replication GTID slave state"); +SET sql_log_bin=1; +include/start_slave.inc +Warnings: +Error 1286 Unknown storage engine 'InnoDB' +INSERT INTO t1 VALUES (9); +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +7 +8 +9 +SET sql_log_bin= 0; +ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM; +SET sql_log_bin= 1; +include/start_slave.inc +INSERT INTO t1 VALUES (10); +include/stop_slave.inc +CHANGE MASTER TO master_use_gtid= slave_pos; +include/start_slave.inc +*** MDEV-4692: mysql.gtid_slave_pos accumulates values for a domain *** +SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; +domain_id COUNT(*) +0 2 +1 2 +INSERT INTO t1 VALUES (11); +SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; +domain_id COUNT(*) +0 2 +1 2 +include/start_slave.inc +INSERT INTO t1 VALUES (12); +INSERT INTO t1 VALUES (13); +SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; +domain_id COUNT(*) +0 2 +1 2 DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result index c34021b1fef..538592f0d43 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result @@ -33,5 +33,5 @@ SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result index c4995a739db..b339188f8b8 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev382.result +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -315,7 +315,7 @@ CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; TRUNCATE `t``1`; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `INNODB_FOREIGN_KEY_NAME` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```)) +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `t@00602_ibfk_1` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```)) DROP TABLE `t``2`; DROP TABLE `t``1`; *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart |