diff options
author | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-05-23 14:14:00 -0600 |
---|---|---|
committer | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-07-26 13:31:27 -0600 |
commit | 5ab5ff08b008417f32dd4bb15820a1a53ea3821c (patch) | |
tree | 065fb608faf7067e7efb40e5d2ef1f74d9d7a17e | |
parent | 8c2faad576d6a77314e92755a389de2c41e21242 (diff) | |
download | mariadb-git-5ab5ff08b008417f32dd4bb15820a1a53ea3821c.tar.gz |
MDEV-19801: Change defaults for CHANGE MASTER TO so that GTID-based replication is used by default if master supports it
This commit makes replicas crash-safe by default by changing the
Using_Gtid value to be Slave_Pos on a fresh slave start and after
RESET SLAVE is issued. If the primary server does not support GTIDs
(i.e., version < 10), the replica will fall back to Using_Gtid=No on
slave start and after RESET SLAVE.
The following additional informational messages/warnings are added:
1. When Using_Gtid is automatically changed. That is, if RESET
SLAVE reverts Using_Gtid back to Slave_Pos, or Using_Gtid is
inferred to No from a CHANGE MASTER TO given with log coordinates
without MASTER_USE_GTID.
2. If options are ignored in CHANGE MASTER TO. If CHANGE MASTER TO
is given with log coordinates, yet also specifies
MASTER_USE_GTID=Slave_Pos, a warning message is given that the log
coordinate options are ignored.
Additionally, an MTR macro has been added for RESET SLAVE,
reset_slave.inc, which provides modes/options for resetting a slave
in log coordinate or gtid modes. When in log coordinates mode, the
macro will execute CHANGE MASTER TO MASTER_USE_GTID=No after the
RESET SLAVE command. When in GTID mode, an extra parameter,
reset_slave_keep_gtid_state, can be set to reset or preserve the
value of gtid_slave_pos.
Reviewed By:
===========
Andrei Elkin <andrei.elkin@mariadb.com>
167 files changed, 1404 insertions, 344 deletions
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test index 60b376a2836..4a1af2a4553 100644 --- a/mysql-test/include/check-testcase.test +++ b/mysql-test/include/check-testcase.test @@ -62,7 +62,7 @@ if ($tmp) --echo Master_Server_Id # --echo Master_SSL_Crl # --echo Master_SSL_Crlpath # - --echo Using_Gtid No + --echo Using_Gtid Slave_Pos --echo Gtid_IO_Pos # --echo Replicate_Do_Domain_Ids --echo Replicate_Ignore_Domain_Ids diff --git a/mysql-test/include/reset_slave.inc b/mysql-test/include/reset_slave.inc new file mode 100644 index 00000000000..89778148f4a --- /dev/null +++ b/mysql-test/include/reset_slave.inc @@ -0,0 +1,58 @@ +# ==== Purpose ==== +# +# Reset the slave on the active connection +# +# +# ==== Usage ==== +# +# [--let $master_use_gtid_option= NO] +# --source include/rpl_reset_slave.inc +# +# Parameters: +# $master_use_gtid_option +# Sets the context for the reset slave. When No, execute +# CHANGE MASTER TO MASTER_USE_GTID=No after the RESET SLAVE. When +# Slave_Pos, execute set gtid_slave_pos= "" after RESET SLAVE. +# +# $reset_slave_keep_gtid_state +# When master_use_gtid_option is Slave_Pos, this defines whether or not +# gtid_slave_pos will be reset as well. Accepted values are of boolean +# type. Default value is false. +# + +--let $include_filename= reset_slave.inc +--source include/begin_include_file.inc + + +if (!$rpl_debug) +{ + --disable_query_log +} + +if (!$master_use_gtid_option) +{ + --let $master_use_gtid_option= Slave_Pos +} + +if (!$reset_slave_keep_gtid_state) +{ + --let $reset_slave_keep_gtid_state=0 +} + +if (`SELECT strcmp("$master_use_gtid_option","Slave_Pos") != 0 AND strcmp("$master_use_gtid_option","No") != 0`) +{ + die Invalid option provided as master_use_gtid_option, Slave_Pos or No are the only allowed options; +} + +RESET SLAVE; +if (`SELECT strcmp("$master_use_gtid_option","Slave_Pos") = 0 AND NOT $reset_slave_keep_gtid_state`) +{ + SET @@GLOBAL.gtid_slave_pos= ""; +} +if (`SELECT strcmp("$master_use_gtid_option","No") = 0`) +{ + CHANGE MASTER TO MASTER_USE_GTID=No; +} + +--let $include_filename= reset_slave.inc +--source include/end_include_file.inc diff --git a/mysql-test/include/rpl_change_topology.inc b/mysql-test/include/rpl_change_topology.inc index 799262986e6..387ab196ad1 100644 --- a/mysql-test/include/rpl_change_topology.inc +++ b/mysql-test/include/rpl_change_topology.inc @@ -225,7 +225,14 @@ if (!$rpl_skip_change_master) { --let $_rpl_master_log_pos= } - eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1; + if ($rpl_master_log_file) + { + eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1, MASTER_USE_GTID=NO; + } + if (!$rpl_master_log_file) + { + eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_CONNECT_RETRY=1; + } } if ($_rpl_master == '') { diff --git a/mysql-test/include/rpl_end.inc b/mysql-test/include/rpl_end.inc index 3fdd91ba319..f49079db332 100644 --- a/mysql-test/include/rpl_end.inc +++ b/mysql-test/include/rpl_end.inc @@ -90,7 +90,7 @@ while ($_rpl_server) --source include/rpl_connection.inc # Clear Using_Gtid in SHOW SLAVE STATUS to keep check_testcase happy. - CHANGE MASTER TO master_log_file=''; + CHANGE MASTER TO master_use_gtid=Slave_Pos; --dec $_rpl_server } diff --git a/mysql-test/include/rpl_reset.inc b/mysql-test/include/rpl_reset.inc index a94371c38fc..53ed1de9874 100644 --- a/mysql-test/include/rpl_reset.inc +++ b/mysql-test/include/rpl_reset.inc @@ -63,13 +63,13 @@ while ($_rpl_server) --let $rpl_connection_name= server_$_rpl_server --source include/rpl_connection.inc + RESET MASTER; # Check if this server is configured to have a master if (`SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`) { --source include/stop_slave.inc - RESET SLAVE; + --source include/reset_slave.inc } - RESET MASTER; --dec $_rpl_server } diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index a1964572427..9f0447925db 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -100,7 +100,7 @@ RESET SLAVE; --let $_fake_old_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1) # Setup replication from existing relay log. -eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4; +eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4, MASTER_USE_GTID=NO; --let $include_filename= setup_fake_relay_log.inc --source include/end_include_file.inc diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc index 105574b15b9..1ce846eed0b 100644 --- a/mysql-test/include/test_fieldsize.inc +++ b/mysql-test/include/test_fieldsize.inc @@ -11,7 +11,8 @@ DROP TABLE IF EXISTS t1; sync_slave_with_master; STOP SLAVE; -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc eval $test_table_slave; connection master; @@ -29,7 +30,7 @@ START SLAVE; # The following should be 0 SELECT COUNT(*) FROM t1; STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc connection master; RESET MASTER; diff --git a/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.result b/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.result index cf660297640..a8d96642bd1 100644 --- a/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.result +++ b/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.result @@ -12,7 +12,7 @@ include/rpl_start_server.inc [server_number=1] connection slave; RESET SLAVE; RESET MASTER; -CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; include/start_slave.inc DESC t1; Field Type Null Key Default Extra diff --git a/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.test b/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.test index 417df631878..3f8220630ba 100644 --- a/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.test +++ b/mysql-test/suite/binlog_encryption/binlog_mdev_20574_old_binlog.test @@ -36,7 +36,7 @@ RESET SLAVE; RESET MASTER; --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 -eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; --source include/start_slave.inc --sync_with_master DESC t1; diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result index d632c565ad2..a628d0d409b 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result @@ -4,6 +4,11 @@ include/rpl_init.inc [topology=1->2] connection server_2; include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection server_1; +connection server_2; +include/stop_slave.inc ##################################################### # Part 1: unencrypted master ##################################################### @@ -63,7 +68,9 @@ SHOW TABLES; Tables_in_test table1_no_encryption include/stop_slave.inc -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' ########## # Cleanup ########## diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test index 1e1b0cbd353..d36086da73b 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test @@ -20,6 +20,13 @@ --let $rpl_topology= 1->2 --source include/rpl_init.inc +--connection server_2 +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + +--connection server_1 + --enable_connect_log # We stop replication because we want it to happen after the switch @@ -132,7 +139,8 @@ SHOW TABLES; --disable_connect_log --source include/stop_slave.inc --enable_connect_log -reset slave; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --echo ########## --echo # Cleanup diff --git a/mysql-test/suite/binlog_encryption/multisource.result b/mysql-test/suite/binlog_encryption/multisource.result index ad1f2e24f9e..4b53b4653cd 100644 --- a/mysql-test/suite/binlog_encryption/multisource.result +++ b/mysql-test/suite/binlog_encryption/multisource.result @@ -99,7 +99,8 @@ set default_master_connection = ''; change master to master_port=MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; include/wait_for_slave_to_start.inc # diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result index 4c667bd7f5a..0c79b079bd6 100644 --- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result +++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result @@ -232,6 +232,9 @@ connection master; ####################################################################### include/rpl_reset.inc connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); call mtr.add_suppression("Error writing file .*"); call mtr.add_suppression("Could not use .*"); @@ -277,5 +280,7 @@ include/stop_slave_sql.inc Warnings: Note 1255 Slave already has been stopped RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' RESET MASTER; include/rpl_end.inc diff --git a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result index 5aff978538f..86659816f6c 100644 --- a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.result @@ -2,6 +2,9 @@ include/master-slave.inc [connection master] connection slave; include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +include/stop_slave.inc connection master; call mtr.add_suppression("Error in Log_event::read_log_event()"); include/rpl_stop_server.inc [server_number=1] @@ -10,7 +13,9 @@ show binlog events; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error connection slave; call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log"); -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' @@ -20,6 +25,8 @@ reset master; connection slave; stop slave; reset slave; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' drop table if exists t; reset master; End of the tests diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.result b/mysql-test/suite/binlog_encryption/rpl_checksum.result index 22220b8e9fb..0b894e05a46 100644 --- a/mysql-test/suite/binlog_encryption/rpl_checksum.result +++ b/mysql-test/suite/binlog_encryption/rpl_checksum.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log'); call mtr.add_suppression('Replication event checksum verification failed'); call mtr.add_suppression('Relay log write failure: could not queue event from master'); @@ -122,7 +127,9 @@ must be zero 0 connection slave; stop slave; -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); flush logs; connection master; diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.result b/mysql-test/suite/binlog_encryption/rpl_corruption.result index 73bb373d6be..7c60e15a567 100644 --- a/mysql-test/suite/binlog_encryption/rpl_corruption.result +++ b/mysql-test/suite/binlog_encryption/rpl_corruption.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression('Found invalid event in binary log'); call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master'); call mtr.add_suppression('event read from binlog did not pass crc check'); diff --git a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result index 388c8e67b68..fd33ec992f6 100644 --- a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result index d18bd1efda7..edd5e7748e0 100644 --- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result +++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result @@ -6,16 +6,18 @@ call mtr.add_suppression("Read semi-sync reply"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); call mtr.add_suppression("mysqld: Got an error reading communication packets"); connection slave; +set sql_log_bin=0; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin=1; connection master; # # Uninstall semi-sync plugins on master and slave # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; @@ -310,7 +312,7 @@ Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc @@ -340,7 +342,7 @@ Rpl_semi_sync_master_yes_tx 3 # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc connection master; reset master; include/kill_binlog_dump_threads.inc diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.result b/mysql-test/suite/binlog_encryption/rpl_skip_replication.result index 59d5b50e5cc..96e0a30331d 100644 --- a/mysql-test/suite/binlog_encryption/rpl_skip_replication.result +++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.result @@ -1,6 +1,11 @@ include/master-slave.inc [connection master] connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; +connection slave; CREATE USER 'nonsuperuser'@'127.0.0.1'; GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE, SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1'; diff --git a/mysql-test/suite/engines/funcs/r/rpl_000010.result b/mysql-test/suite/engines/funcs/r/rpl_000010.result index ae989f25e1b..a86d71bd33f 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_000010.result +++ b/mysql-test/suite/engines/funcs/r/rpl_000010.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); diff --git a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result index 7f5f34bf831..74080b3936f 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result +++ b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result @@ -9,7 +9,7 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> connection slave; include/stop_slave.inc -change master to master_log_pos=MASTER_LOG_POS; +change master to master_log_pos=MASTER_LOG_POS, master_use_gtid=no; start slave; include/wait_for_slave_io_error.inc [errno=1236] Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' @@ -23,7 +23,7 @@ drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); connection slave; -change master to master_log_pos=MASTER_LOG_POS; +change master to master_log_pos=MASTER_LOG_POS, master_use_gtid=no; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result index b9e98d5a97d..5e595447e50 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result @@ -7,7 +7,7 @@ include/stop_slave.inc change master to master_user='test'; Master_User = 'test' Master_Host = '127.0.0.1' -reset slave; +include/reset_slave.inc Master_User = 'test' Master_Host = '127.0.0.1' change master to master_user='root'; @@ -15,13 +15,13 @@ include/start_slave.inc Master_User = 'root' Master_Host = '127.0.0.1' include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc connection master; create temporary table t1 (a int); connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value @@ -30,7 +30,7 @@ connection master; drop temporary table if exists t1; connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='impossible_user_name'; start slave; @@ -44,13 +44,14 @@ change master to master_user='impossible_user_name'; start slave; include/wait_for_slave_io_error.inc [errno=1045] include/stop_slave_sql.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='root'; -reset slave; +include/reset_slave.inc include/start_slave.inc include/stop_slave.inc reset slave all; +set @@global.gtid_slave_pos= ""; start slave; ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_until.result b/mysql-test/suite/engines/funcs/r/rpl_row_until.result index 82268ce72eb..8ef10bf47b5 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result @@ -10,7 +10,7 @@ INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; connection slave; include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT; connection slave; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1; @@ -52,7 +52,7 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc include/start_slave.inc include/rpl_reset.inc connection master; diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result index 74145645920..3d8eeb02ca6 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result +++ b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result @@ -1,6 +1,9 @@ include/master-slave.inc [connection master] connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc create table t1 (n int); reset master; stop slave; diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result index 1ba2d1b624b..0a365b30b38 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result @@ -7,7 +7,7 @@ include/stop_slave.inc change master to master_user='test'; Master_User = 'test' Master_Host = '127.0.0.1' -reset slave; +include/reset_slave.inc Master_User = 'test' Master_Host = '127.0.0.1' change master to master_user='root'; @@ -15,13 +15,13 @@ include/start_slave.inc Master_User = 'root' Master_Host = '127.0.0.1' include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc connection master; create temporary table t1 (a int); connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value @@ -30,7 +30,7 @@ connection master; drop temporary table if exists t1; connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='impossible_user_name'; start slave; @@ -44,13 +44,14 @@ change master to master_user='impossible_user_name'; start slave; include/wait_for_slave_io_error.inc [errno=1045] include/stop_slave_sql.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='root'; -reset slave; +include/reset_slave.inc include/start_slave.inc include/stop_slave.inc reset slave all; +set @@global.gtid_slave_pos= ""; start slave; ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; diff --git a/mysql-test/suite/engines/funcs/r/rpl_trigger.result b/mysql-test/suite/engines/funcs/r/rpl_trigger.result index b5b88670fc6..3913508d032 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_trigger.result +++ b/mysql-test/suite/engines/funcs/r/rpl_trigger.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t2 (a int auto_increment, primary key (a), b int); @@ -960,7 +965,9 @@ include/rpl_stop_server.inc [server_number=1] include/rpl_start_server.inc [server_number=1] --> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4 connection slave; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' include/start_slave.inc SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; MASTER_POS_WAIT('master-bin.000001', 513) >= 0 @@ -991,7 +998,9 @@ DROP TRIGGER trg1; DROP TABLE t1; DROP TABLE t2; include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; SHOW TABLES LIKE 't_'; Tables_in_test (t_) diff --git a/mysql-test/suite/engines/funcs/t/rpl_trigger.test b/mysql-test/suite/engines/funcs/t/rpl_trigger.test index 4f61e738200..12eef32ef83 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_trigger.test +++ b/mysql-test/suite/engines/funcs/t/rpl_trigger.test @@ -5,6 +5,12 @@ --source include/have_binlog_format_mixed_or_statement.inc --source include/master-slave.inc +connection slave; +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--connection master + call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); # @@ -315,7 +321,8 @@ let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1); # Make the slave to replay the new binlog. connection slave; -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --source include/start_slave.inc SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; @@ -342,7 +349,7 @@ DROP TABLE t1; DROP TABLE t2; --source include/stop_slave.inc -RESET SLAVE; +--source include/reset_slave.inc # The master should be clean. diff --git a/mysql-test/suite/mariabackup/slave_info_norpl.result b/mysql-test/suite/mariabackup/slave_info_norpl.result index 9fcd67a8916..04ca2fb2242 100644 --- a/mysql-test/suite/mariabackup/slave_info_norpl.result +++ b/mysql-test/suite/mariabackup/slave_info_norpl.result @@ -31,28 +31,30 @@ CHANGE MASTER 'master4' TO MASTER_HOST='localhost', MASTER_PORT=10004, MASTER_US CHANGE MASTER 'master5' TO MASTER_HOST='localhost', MASTER_PORT=10005, MASTER_USE_GTID=slave_pos; lineno line 1 SET GLOBAL gtid_slave_pos = '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; -2 CHANGE MASTER TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>; -3 CHANGE MASTER 'master2' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>; +2 CHANGE MASTER TO master_use_gtid = slave_pos; +3 CHANGE MASTER 'master2' TO master_use_gtid = slave_pos; 4 CHANGE MASTER 'master3' TO master_use_gtid = slave_pos; 5 CHANGE MASTER 'master4' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>; 6 CHANGE MASTER 'master5' TO master_use_gtid = slave_pos; line -[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: gtid_slave_pos '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; master '' filename '' position '0'; master 'master2' filename '' position '0'; master 'master3' master_use_gtid = slave_pos; master 'master4' filename '' position '0'; master 'master5' master_use_gtid = slave_pos +[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: gtid_slave_pos '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; master '' master_use_gtid = slave_pos; master 'master2' master_use_gtid = slave_pos; master 'master3' master_use_gtid = slave_pos; master 'master4' filename '' position '0'; master 'master5' master_use_gtid = slave_pos CHANGE MASTER TO MASTER_HOST='localhost', MASTER_PORT=10000, MASTER_USE_GTID=slave_pos; lineno line 1 SET GLOBAL gtid_slave_pos = '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; 2 CHANGE MASTER TO master_use_gtid = slave_pos; -3 CHANGE MASTER 'master2' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>; +3 CHANGE MASTER 'master2' TO master_use_gtid = slave_pos; 4 CHANGE MASTER 'master3' TO master_use_gtid = slave_pos; 5 CHANGE MASTER 'master4' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>; 6 CHANGE MASTER 'master5' TO master_use_gtid = slave_pos; line -[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: gtid_slave_pos '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; master '' master_use_gtid = slave_pos; master 'master2' filename '' position '0'; master 'master3' master_use_gtid = slave_pos; master 'master4' filename '' position '0'; master 'master5' master_use_gtid = slave_pos +[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: gtid_slave_pos '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; master '' master_use_gtid = slave_pos; master 'master2' master_use_gtid = slave_pos; master 'master3' master_use_gtid = slave_pos; master 'master4' filename '' position '0'; master 'master5' master_use_gtid = slave_pos RESET SLAVE ALL; RESET SLAVE 'master2' ALL; RESET SLAVE 'master3' ALL; RESET SLAVE 'master4' ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' RESET SLAVE 'master5' ALL; # # End of 10.2 tests diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result index b0a112aaf3b..c19620b46cc 100644 --- a/mysql-test/suite/multi_source/info_logs.result +++ b/mysql-test/suite/multi_source/info_logs.result @@ -10,7 +10,8 @@ multi-master.info change master 'master1' to master_port=MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave 'master1'; set default_master_connection = 'master1'; include/wait_for_slave_to_start.inc @@ -28,7 +29,8 @@ master1 change master 'MASTER 2.2' to master_port=MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave 'MASTER 2.2'; set default_master_connection = 'MASTER 2.2'; include/wait_for_slave_to_start.inc @@ -53,6 +55,8 @@ stop slave 'master1'; set default_master_connection = 'master1'; include/wait_for_slave_to_stop.inc reset slave 'master1' all; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' # # List of files matching '*info*' pattern # after 'master1' was completely reset, 'MASTER 2.2' still running @@ -69,7 +73,8 @@ set default_master_connection = ''; change master to master_port=MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; include/wait_for_slave_to_start.inc connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1; diff --git a/mysql-test/suite/multi_source/info_logs.test b/mysql-test/suite/multi_source/info_logs.test index 234e317e5ce..f8352978645 100644 --- a/mysql-test/suite/multi_source/info_logs.test +++ b/mysql-test/suite/multi_source/info_logs.test @@ -30,7 +30,8 @@ eval change master 'master1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave 'master1'; set default_master_connection = 'master1'; @@ -54,7 +55,8 @@ set default_master_connection = 'master1'; eval change master 'MASTER 2.2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave 'MASTER 2.2'; set default_master_connection = 'MASTER 2.2'; @@ -107,7 +109,8 @@ set default_master_connection = ''; eval change master to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; --source include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/multi_source/mdev-8874.result b/mysql-test/suite/multi_source/mdev-8874.result index aa9cc39b403..12bc251f4e2 100644 --- a/mysql-test/suite/multi_source/mdev-8874.result +++ b/mysql-test/suite/multi_source/mdev-8874.result @@ -24,9 +24,9 @@ insert into t1 values(1); create table t2(a int); insert into t2 values(1); connection server_4; -change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; -change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; -change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; +change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; +change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; +change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; start all slaves; set default_master_connection = 'm1'; include/wait_for_slave_to_start.inc @@ -65,14 +65,20 @@ Note 1938 SLAVE 'm2' stopped Note 1938 SLAVE '' stopped Note 1938 SLAVE 'm1' stopped RESET SLAVE 'm1' ALL ; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' RESET SLAVE 'm2' ALL ; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' RESET SLAVE ALL ; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' drop database a; drop database b; drop database c; -change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; -change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; -change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; +change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; +change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; +change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; start all slaves; Warnings: Note 1937 SLAVE 'm2' started @@ -124,3 +130,6 @@ SET default_master_connection = "m2"; include/wait_for_slave_to_stop.inc SET default_master_connection = ""; include/wait_for_slave_to_stop.inc +RESET SLAVE ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' diff --git a/mysql-test/suite/multi_source/mdev-8874.test b/mysql-test/suite/multi_source/mdev-8874.test index d03c255b911..1a99ae73d9b 100644 --- a/mysql-test/suite/multi_source/mdev-8874.test +++ b/mysql-test/suite/multi_source/mdev-8874.test @@ -40,11 +40,11 @@ insert into t2 values(1); --connection server_4 --disable_warnings --replace_result $SERVER_MYPORT_1 MYPORT_1 -eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root'; +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; --replace_result $SERVER_MYPORT_2 MYPORT_2 -eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root'; +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; --replace_result $SERVER_MYPORT_3 MYPORT_3 -eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root'; +eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; start all slaves; set default_master_connection = 'm1'; --source include/wait_for_slave_to_start.inc @@ -78,11 +78,11 @@ drop database a; drop database b; drop database c; --replace_result $SERVER_MYPORT_1 MYPORT_1 -eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root'; +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; --replace_result $SERVER_MYPORT_2 MYPORT_2 -eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root'; +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; --replace_result $SERVER_MYPORT_3 MYPORT_3 -eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root'; +eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; start all slaves; set default_master_connection = 'm1'; --source include/wait_for_slave_to_start.inc @@ -139,3 +139,4 @@ SET default_master_connection = "m2"; --source include/wait_for_slave_to_stop.inc SET default_master_connection = ""; --source include/wait_for_slave_to_stop.inc +RESET SLAVE ALL; diff --git a/mysql-test/suite/multi_source/mdev-9544.result b/mysql-test/suite/multi_source/mdev-9544.result index 42e6b6a9f56..452964fd862 100644 --- a/mysql-test/suite/multi_source/mdev-9544.result +++ b/mysql-test/suite/multi_source/mdev-9544.result @@ -24,9 +24,9 @@ insert into t1 values(1); create table t2(a int); insert into t2 values(1); connection server_4; -change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; -change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; -change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; +change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; +change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; +change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; start all slaves; set default_master_connection = 'm1'; include/wait_for_slave_to_start.inc @@ -88,3 +88,6 @@ SET default_master_connection = "m2"; include/wait_for_slave_to_stop.inc SET default_master_connection = ""; include/wait_for_slave_to_stop.inc +change master to master_use_gtid=slave_pos; +change master 'm1' to master_use_gtid=slave_pos; +change master 'm2' to master_use_gtid=slave_pos; diff --git a/mysql-test/suite/multi_source/mdev-9544.test b/mysql-test/suite/multi_source/mdev-9544.test index f532a63a585..fd89bdfa744 100644 --- a/mysql-test/suite/multi_source/mdev-9544.test +++ b/mysql-test/suite/multi_source/mdev-9544.test @@ -37,11 +37,11 @@ insert into t2 values(1); --connection server_4 --disable_warnings --replace_result $SERVER_MYPORT_1 MYPORT_1 -eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root'; +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; --replace_result $SERVER_MYPORT_2 MYPORT_2 -eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root'; +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; --replace_result $SERVER_MYPORT_3 MYPORT_3 -eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root'; +eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no; start all slaves; set default_master_connection = 'm1'; --source include/wait_for_slave_to_start.inc @@ -114,3 +114,7 @@ SET default_master_connection = "m2"; SET default_master_connection = ""; --source include/wait_for_slave_to_stop.inc +# Reset for check-testcase +change master to master_use_gtid=slave_pos; +change master 'm1' to master_use_gtid=slave_pos; +change master 'm2' to master_use_gtid=slave_pos; diff --git a/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result b/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result index b1aa31d059a..25cd85d7018 100644 --- a/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result +++ b/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result @@ -64,7 +64,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 1 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -125,7 +125,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 2 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result index ad1f2e24f9e..4b53b4653cd 100644 --- a/mysql-test/suite/multi_source/multisource.result +++ b/mysql-test/suite/multi_source/multisource.result @@ -99,7 +99,8 @@ set default_master_connection = ''; change master to master_port=MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; include/wait_for_slave_to_start.inc # diff --git a/mysql-test/suite/multi_source/multisource_for_channel.result b/mysql-test/suite/multi_source/multisource_for_channel.result index f96a5a93b97..c932cd1ecb9 100644 --- a/mysql-test/suite/multi_source/multisource_for_channel.result +++ b/mysql-test/suite/multi_source/multisource_for_channel.result @@ -7,7 +7,8 @@ ERROR HY000: Incorrect arguments to MASTER_HOST change master to master_port=MYPORT_1, master_host='127.0.0.1', -master_user='root' +master_user='root', +master_use_gtid=no for channel 'master1'; start slave for channel 'master1'; set default_master_connection = 'master1'; @@ -102,7 +103,8 @@ set default_master_connection = ''; change master to master_port=MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; include/wait_for_slave_to_start.inc # @@ -318,6 +320,8 @@ Last_SQL_Errno = '0' # reset slave # RESET SLAVE for channel 'master1'; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' show slave status for channel 'master1' Master_Port = 'MYPORT_1' diff --git a/mysql-test/suite/multi_source/multisource_for_channel.test b/mysql-test/suite/multi_source/multisource_for_channel.test index 9b74ea97742..628efe1daae 100644 --- a/mysql-test/suite/multi_source/multisource_for_channel.test +++ b/mysql-test/suite/multi_source/multisource_for_channel.test @@ -29,7 +29,8 @@ change master to master_host='' for channel 'abc2'; eval change master to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', -master_user='root' +master_user='root', +master_use_gtid=no for channel 'master1'; start slave for channel 'master1'; @@ -154,7 +155,8 @@ set default_master_connection = ''; eval change master to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; --source include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result index c048784e28d..a55a6ec235f 100644 --- a/mysql-test/suite/multi_source/reset_slave.result +++ b/mysql-test/suite/multi_source/reset_slave.result @@ -14,14 +14,14 @@ connection slave; stop slave 'master1'; show slave 'master1' status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups - 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 No NULL No 0 0 1 No optimistic 0 NULL 2 1 0 + 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 No NULL No 0 0 1 Slave_Pos 0-1-3 optimistic 0 NULL 2 1 0 mysqld-relay-bin-master1.000001 mysqld-relay-bin-master1.000002 mysqld-relay-bin-master1.index reset slave 'master1'; show slave 'master1' status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups - 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 No NULL No 0 0 1 No optimistic 0 NULL 2 1 0 + 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 No NULL No 0 0 1 Slave_Pos optimistic 0 NULL 2 1 0 reset slave 'master1' all; show slave 'master1' status; ERROR HY000: There is no master connection 'master1' diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result index 191cd0a1a0f..5a167907b3b 100644 --- a/mysql-test/suite/multi_source/simple.result +++ b/mysql-test/suite/multi_source/simple.result @@ -62,7 +62,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 1 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -123,7 +123,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 2 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -148,7 +148,7 @@ CHANNEL_NAME slave2 HOST 127.0.0.1 PORT # USER root -USING_GTID NO +USING_GTID SLAVE_POS SSL_ALLOWED NO SSL_CA_FILE SSL_CA_PATH @@ -168,7 +168,7 @@ CHANNEL_NAME slave1 HOST 127.0.0.1 PORT # USER root -USING_GTID NO +USING_GTID SLAVE_POS SSL_ALLOWED NO SSL_CA_FILE SSL_CA_PATH @@ -249,7 +249,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 1 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -306,7 +306,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 1 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -367,7 +367,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 2 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -430,7 +430,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 2 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids @@ -495,7 +495,7 @@ Replicate_Ignore_Server_Ids Master_Server_Id 2 Master_SSL_Crl Master_SSL_Crlpath -Using_Gtid No +Using_Gtid Slave_Pos Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids diff --git a/mysql-test/suite/multi_source/skip_counter.result b/mysql-test/suite/multi_source/skip_counter.result index 03103af21b9..4573d54ca38 100644 --- a/mysql-test/suite/multi_source/skip_counter.result +++ b/mysql-test/suite/multi_source/skip_counter.result @@ -12,7 +12,8 @@ connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3; change master 'master1' to master_port=MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave 'master1'; set default_master_connection = 'master1'; include/wait_for_slave_to_start.inc @@ -20,7 +21,8 @@ set default_master_connection = 'master2'; change master 'master2' to master_port=MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; set global sql_slave_skip_counter = 2; select @@global.sql_slave_skip_counter; @@global.sql_slave_skip_counter diff --git a/mysql-test/suite/multi_source/skip_counter.test b/mysql-test/suite/multi_source/skip_counter.test index e53d0276a91..e89480f55c5 100644 --- a/mysql-test/suite/multi_source/skip_counter.test +++ b/mysql-test/suite/multi_source/skip_counter.test @@ -38,7 +38,8 @@ create table db.t3 (i int) engine=MyISAM; eval change master 'master1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave 'master1'; set default_master_connection = 'master1'; @@ -53,7 +54,8 @@ set default_master_connection = 'master2'; eval change master 'master2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; # the schema creation will be replicated from the 1st master, # so we want to skip it in the second replication connection diff --git a/mysql-test/suite/rpl/include/multisource.inc b/mysql-test/suite/rpl/include/multisource.inc index 7a2d9ea79b2..96c4a9aa348 100644 --- a/mysql-test/suite/rpl/include/multisource.inc +++ b/mysql-test/suite/rpl/include/multisource.inc @@ -159,7 +159,8 @@ set default_master_connection = ''; eval change master to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_use_gtid=no; start slave; --source include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc b/mysql-test/suite/rpl/include/rpl_binlog_errors.inc index bf92736a2af..ab95c9b4ee3 100644 --- a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc +++ b/mysql-test/suite/rpl/include/rpl_binlog_errors.inc @@ -389,6 +389,11 @@ RESET MASTER; --source include/rpl_reset.inc -- connection slave +# Slave tests rely on logic of non-gtid mode +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + # slave suppressions call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); diff --git a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test index 4c93ad86209..790719e3b09 100644 --- a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test +++ b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test @@ -21,6 +21,13 @@ # and slave are diverging. # ######################################################################################## + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--connection master + call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1); diff --git a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc b/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc index 7dfef023947..7c1d0ea25e2 100644 --- a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc +++ b/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc @@ -22,6 +22,10 @@ --source include/master-slave.inc --connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + # Make sure the slave is stopped while we are messing with master. # Otherwise we get occasional failures as the slave manages to re-connect # to the newly started master and we get extra events applied, causing @@ -49,7 +53,8 @@ show binlog events; --connection slave call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log"); -reset slave; +--let $master_use_gtid_option= No +--source include/reset_slave.inc start slave; # ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 diff --git a/mysql-test/suite/rpl/include/rpl_checksum.inc b/mysql-test/suite/rpl/include/rpl_checksum.inc index 17a986dc308..fc765744b3f 100644 --- a/mysql-test/suite/rpl/include/rpl_checksum.inc +++ b/mysql-test/suite/rpl/include/rpl_checksum.inc @@ -11,6 +11,12 @@ --source include/have_binlog_format_mixed.inc --source include/master-slave.inc +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + +--connection master call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log'); call mtr.add_suppression('Replication event checksum verification failed'); # due to C failure simulation @@ -196,7 +202,8 @@ select count(*) as 'must be zero' from t2; # connection slave; stop slave; -reset slave; +--let $master_use_gtid_option= No +--source include/reset_slave.inc # randomize slave server's own checksum policy set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); diff --git a/mysql-test/suite/rpl/include/rpl_corruption.inc b/mysql-test/suite/rpl/include/rpl_corruption.inc index c7a913af9d7..cd2a1cc7ef2 100644 --- a/mysql-test/suite/rpl/include/rpl_corruption.inc +++ b/mysql-test/suite/rpl/include/rpl_corruption.inc @@ -24,6 +24,12 @@ --source include/have_debug.inc --source include/master-slave.inc +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--connection master + # Block legal errors for MTR call mtr.add_suppression('Found invalid event in binary log'); call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master'); diff --git a/mysql-test/suite/rpl/include/rpl_deadlock.test b/mysql-test/suite/rpl/include/rpl_deadlock.test index 53002d255f3..7fcf5cbd22c 100644 --- a/mysql-test/suite/rpl/include/rpl_deadlock.test +++ b/mysql-test/suite/rpl/include/rpl_deadlock.test @@ -88,7 +88,7 @@ connection slave; DELETE FROM t2; # Set slave position to the BEGIN log event --replace_result $master_pos_begin <master_pos_begin> -eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; +eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin, MASTER_USE_GTID=NO; BEGIN; # Hold lock SELECT * FROM t1 FOR UPDATE; @@ -121,7 +121,7 @@ SET global max_relay_log_size=0; DELETE FROM t2; # Set slave position to the BEGIN log event --replace_result $master_pos_begin <master_pos_begin> -eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; +eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin, MASTER_USE_GTID=NO; BEGIN; # Hold lock SELECT * FROM t1 FOR UPDATE; diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_master.test b/mysql-test/suite/rpl/include/rpl_extra_col_master.test index 0d397b7e3ba..a7abe69db0a 100644 --- a/mysql-test/suite/rpl/include/rpl_extra_col_master.test +++ b/mysql-test/suite/rpl/include/rpl_extra_col_master.test @@ -450,7 +450,7 @@ connection master; --echo ** Stop and Reset Slave ** --echo STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --echo --echo ** create table slave side ** eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) @@ -507,7 +507,7 @@ sync_slave_with_master; --echo --echo *** Create t11 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE=$engine_type; @@ -563,7 +563,7 @@ sync_slave_with_master; --echo --echo *** Create t12 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE=$engine_type; @@ -614,7 +614,7 @@ sync_slave_with_master; --echo --echo *** Create t14 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; @@ -689,7 +689,7 @@ connection slave; #*************************** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --echo --echo *** Drop t14 *** @@ -711,7 +711,7 @@ START SLAVE; --echo --echo *** Create t15 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; @@ -753,7 +753,7 @@ connection slave; --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --echo --echo *** Drop t15 *** @@ -775,7 +775,7 @@ START SLAVE; --echo --echo *** Create t16 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; @@ -830,7 +830,7 @@ connection slave; --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --echo --echo *** Drop t16 *** @@ -853,7 +853,7 @@ START SLAVE; --echo --echo *** Create t17 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; @@ -919,7 +919,7 @@ sync_slave_with_master; --echo STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; @@ -982,7 +982,7 @@ sync_slave_with_master; --echo --echo *** Create t5 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=$engine_type; diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test index a58fa85a72d..680d5724bea 100644 --- a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test +++ b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test @@ -25,7 +25,7 @@ call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot sync_slave_with_master; STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc SET @saved_slave_type_conversions = @@slave_type_conversions; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; @@ -71,7 +71,7 @@ sync_slave_with_master; ## BUG22086 --echo *** Create t2 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -96,7 +96,7 @@ START SLAVE; --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc SELECT * FROM t2 ORDER BY a; connection master; @@ -116,7 +116,7 @@ sync_slave_with_master; #################################### --echo *** Create t3 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -161,7 +161,7 @@ sync_slave_with_master; --echo *** Create t4 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -204,7 +204,7 @@ sync_slave_with_master; --echo *** Create t5 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT, e DOUBLE, f DECIMAL(8,2))ENGINE=$engine_type; @@ -249,7 +249,7 @@ sync_slave_with_master; --echo *** Create t6 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT)ENGINE=$engine_type; @@ -307,7 +307,7 @@ DROP TABLE t6; --echo *** Create t7 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e CHAR(20) DEFAULT 'Extra Column Testing') @@ -349,7 +349,7 @@ sync_slave_with_master; ########################################### --echo *** Create t8 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e INT)ENGINE=$engine_type; @@ -395,7 +395,7 @@ sync_slave_with_master; # Error reaction is up to sql_mode of the slave sql (bug#38173) #--echo *** Create t9 on slave *** STOP SLAVE; - RESET SLAVE; + --source include/reset_slave.inc eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -449,7 +449,7 @@ sync_slave_with_master; ############################################ --echo *** Create t10 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type; @@ -491,7 +491,7 @@ sync_slave_with_master; ############################################ --echo *** Create t11 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; @@ -533,7 +533,7 @@ sync_slave_with_master; ############################################ --echo *** Create t12 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; @@ -572,7 +572,7 @@ sync_slave_with_master; --echo *** BUG 22177 Start *** --echo *** Create t13 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5), d INT DEFAULT '1', e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -620,7 +620,7 @@ sync_slave_with_master; --echo *** Create t14 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -660,7 +660,7 @@ SELECT * FROM t14 ORDER BY c1; --echo *** Create t14a on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -690,7 +690,7 @@ sync_slave_with_master; --replace_column 5 CURRENT_TIMESTAMP SELECT * FROM t14a ORDER BY c1; STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --echo *** Master Drop c5 *** connection master; @@ -749,7 +749,7 @@ sync_slave_with_master; --echo *** Create t15 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', @@ -822,7 +822,7 @@ sync_slave_with_master; --echo *** Create t16 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', @@ -877,7 +877,7 @@ sync_slave_with_master; --echo *** Create t17 on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') diff --git a/mysql-test/suite/rpl/include/rpl_flsh_tbls.test b/mysql-test/suite/rpl/include/rpl_flsh_tbls.test index a8cec3d2a1a..491897ae1e5 100644 --- a/mysql-test/suite/rpl/include/rpl_flsh_tbls.test +++ b/mysql-test/suite/rpl/include/rpl_flsh_tbls.test @@ -6,6 +6,12 @@ source include/master-slave.inc; +connection slave; +source include/stop_slave.inc; +change master to master_use_gtid=no; +source include/start_slave.inc; +connection master; + let $SERVER_VERSION=`select version()`; create table t1 (a int) ENGINE=MyISAM; diff --git a/mysql-test/suite/rpl/include/rpl_loaddata.test b/mysql-test/suite/rpl/include/rpl_loaddata.test index f0933c1023f..0a6d03aa837 100644 --- a/mysql-test/suite/rpl/include/rpl_loaddata.test +++ b/mysql-test/suite/rpl/include/rpl_loaddata.test @@ -109,7 +109,7 @@ connection slave; # RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS. stop slave; -reset slave; +--source include/reset_slave.inc --source include/check_slave_no_error.inc # Finally, see if logging is done ok on master for a failing LOAD DATA INFILE diff --git a/mysql-test/suite/rpl/include/rpl_reset_slave.test b/mysql-test/suite/rpl/include/rpl_reset_slave.test index e7a78f36efc..d4c9d70169b 100644 --- a/mysql-test/suite/rpl/include/rpl_reset_slave.test +++ b/mysql-test/suite/rpl/include/rpl_reset_slave.test @@ -11,7 +11,9 @@ -- source include/master-slave.inc sync_slave_with_master; --disable_query_log +set sql_log_bin=0; call mtr.add_suppression('Slave I/O: Get master BINLOG_CHECKSUM failed with error'); +set sql_log_bin=1; --enable_query_log let $status_items= Master_User, Master_Host; source include/show_slave_status.inc; @@ -20,7 +22,7 @@ source include/stop_slave.inc; change master to master_user='test'; source include/show_slave_status.inc; -reset slave; +--source include/reset_slave.inc source include/show_slave_status.inc; change master to master_user='root'; @@ -31,13 +33,13 @@ source include/show_slave_status.inc; # test of crash with temp tables & RESET SLAVE # (test to see if RESET SLAVE clears temp tables in memory and disk) source include/stop_slave.inc; -reset slave; +--source include/reset_slave.inc source include/start_slave.inc; connection master; create temporary table t1 (a int); sync_slave_with_master; source include/stop_slave.inc; -reset slave; +--source include/reset_slave.inc source include/start_slave.inc; sync_with_master; show status like 'slave_open_temp_tables'; @@ -51,7 +53,7 @@ sync_slave_with_master; # clearing the status source include/stop_slave.inc; -reset slave; +--source include/reset_slave.inc source include/check_slave_no_error.inc; # @@ -79,7 +81,7 @@ let $slave_io_errno= 1045; --source include/wait_for_slave_io_error.inc --source include/stop_slave_sql.inc -reset slave; +--source include/reset_slave.inc source include/check_slave_no_error.inc; change master to master_user='root'; @@ -88,7 +90,7 @@ change master to master_user='root'; # BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796 # -reset slave; +--source include/reset_slave.inc --source include/start_slave.inc --source include/stop_slave.inc @@ -97,6 +99,7 @@ reset slave; --let $_slave_master_port= query_get_value(SHOW SLAVE STATUS, Master_Port, 1) reset slave all; +set @@global.gtid_slave_pos= ""; --error ER_BAD_SLAVE start slave; diff --git a/mysql-test/suite/rpl/include/rpl_semi_sync.inc b/mysql-test/suite/rpl/include/rpl_semi_sync.inc index c3cd918b5fc..720ec059350 100644 --- a/mysql-test/suite/rpl/include/rpl_semi_sync.inc +++ b/mysql-test/suite/rpl/include/rpl_semi_sync.inc @@ -17,9 +17,16 @@ call mtr.add_suppression("Read semi-sync reply"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); call mtr.add_suppression("mysqld: Got an error reading communication packets"); connection slave; +# While 'Current_Pos' exists as an option for Using_Gtd, keeping these +# events in the binlog will update gtid_binlog_pos, and the later calls to +# set `@@global.gtid_slave_pos= ""` will provide warning messages with +# inconsistent GTID values because the seq_nos are non-deterministic with +# the masters events coming in concurrently +set sql_log_bin=0; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin=1; connection master; # wait for dying connections (if any) to disappear @@ -36,7 +43,7 @@ let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connec --echo # connection slave; source include/stop_slave.inc; -reset slave; +--source include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; @@ -351,7 +358,7 @@ show status like 'Rpl_semi_sync_master_yes_tx'; connection slave; source include/stop_slave.inc; -reset slave; +--source include/reset_slave.inc # Kill the dump thread on master for previous slave connection and --source include/kill_binlog_dump_threads.inc @@ -388,7 +395,7 @@ show status like 'Rpl_semi_sync_master_yes_tx'; --echo # connection slave; source include/stop_slave.inc; -reset slave; +--source include/reset_slave.inc connection master; reset master; diff --git a/mysql-test/suite/rpl/include/rpl_skip_replication.inc b/mysql-test/suite/rpl/include/rpl_skip_replication.inc index 97fc961d438..d1044c4bf51 100644 --- a/mysql-test/suite/rpl/include/rpl_skip_replication.inc +++ b/mysql-test/suite/rpl/include/rpl_skip_replication.inc @@ -19,6 +19,12 @@ --source include/have_innodb.inc --source include/master-slave.inc +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--connection master + connection slave; # Test that SUPER is required to change @@replicate_events_marked_for_skip. CREATE USER 'nonsuperuser'@'127.0.0.1'; diff --git a/mysql-test/suite/rpl/include/rpl_start_stop_slave.test b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test index 32f33b2a31d..ae5f83613fe 100644 --- a/mysql-test/suite/rpl/include/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test @@ -195,7 +195,7 @@ let $master_pos= `SELECT $master_pos + 1`; --connection slave --source include/stop_slave.inc --replace_regex /[0-9]+/MASTER_POS/ -eval CHANGE MASTER TO master_log_pos=$master_pos; +eval CHANGE MASTER TO master_log_pos=$master_pos, master_use_gtid=no; START SLAVE; # ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 diff --git a/mysql-test/suite/rpl/r/rpl_000010.result b/mysql-test/suite/rpl/r/rpl_000010.result index ae989f25e1b..a86d71bd33f 100644 --- a/mysql-test/suite/rpl/r/rpl_000010.result +++ b/mysql-test/suite/rpl/r/rpl_000010.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result index c75e65ebb6f..49f3ac455f1 100644 --- a/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result +++ b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result @@ -38,6 +38,8 @@ id ==== Clean up ==== stop slave sql_thread; include/cleanup_fake_relay_log.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' DROP TABLE t1, t2; DROP PROCEDURE p1; DROP PROCEDURE p2; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result index 5c141eed596..730fb67ebc9 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result @@ -14,4 +14,6 @@ include/wait_for_slave_sql_error.inc [errno=1594] Last_SQL_Error = Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MariaDB code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. ==== Clean up ==== include/cleanup_fake_relay_log.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result index 4c667bd7f5a..0c79b079bd6 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result @@ -232,6 +232,9 @@ connection master; ####################################################################### include/rpl_reset.inc connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); call mtr.add_suppression("Error writing file .*"); call mtr.add_suppression("Could not use .*"); @@ -277,5 +280,7 @@ include/stop_slave_sql.inc Warnings: Note 1255 Slave already has been stopped RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' RESET MASTER; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result index 5aff978538f..86659816f6c 100644 --- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result @@ -2,6 +2,9 @@ include/master-slave.inc [connection master] connection slave; include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +include/stop_slave.inc connection master; call mtr.add_suppression("Error in Log_event::read_log_event()"); include/rpl_stop_server.inc [server_number=1] @@ -10,7 +13,9 @@ show binlog events; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error connection slave; call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log"); -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' @@ -20,6 +25,8 @@ reset master; connection slave; stop slave; reset slave; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' drop table if exists t; reset master; End of the tests diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result index 21d8ca22feb..7ade3067eae 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum.result +++ b/mysql-test/suite/rpl/r/rpl_checksum.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log'); call mtr.add_suppression('Replication event checksum verification failed'); call mtr.add_suppression('Relay log write failure: could not queue event from master'); @@ -122,7 +127,9 @@ must be zero 0 connection slave; stop slave; -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); flush logs; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index 4ec1e2512d2..85cc0cc7ebc 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -184,6 +184,8 @@ connection server_3; RESET MASTER; connection server_4; RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' include/rpl_change_topology.inc [new topology=1->2->3->4->1] include/start_slave.inc connection server_3; diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result index 503bf85222e..94b5cad8724 100644 --- a/mysql-test/suite/rpl/r/rpl_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_colSize.result @@ -6,7 +6,7 @@ DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; include/wait_for_slave_to_stop.inc -RESET SLAVE; +include/reset_slave.inc SET @saved_slave_type_conversions = @@slave_type_conversions; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 ( diff --git a/mysql-test/suite/rpl/r/rpl_corruption.result b/mysql-test/suite/rpl/r/rpl_corruption.result index 73bb373d6be..7c60e15a567 100644 --- a/mysql-test/suite/rpl/r/rpl_corruption.result +++ b/mysql-test/suite/rpl/r/rpl_corruption.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression('Found invalid event in binary log'); call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master'); call mtr.add_suppression('event read from binlog did not pass crc check'); diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result index b94b02a24ff..1b67542c106 100644 --- a/mysql-test/suite/rpl/r/rpl_cross_version.result +++ b/mysql-test/suite/rpl/r/rpl_cross_version.result @@ -16,5 +16,7 @@ zero ==== Clean up ==== include/stop_slave_sql.inc include/cleanup_fake_relay_log.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' drop table t1, t3; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result index fd50e98414f..ee3aedc5fe4 100644 --- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result @@ -63,7 +63,7 @@ include/check_slave_is_running.inc connection slave; include/stop_slave.inc DELETE FROM t2; -CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>; +CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>, MASTER_USE_GTID=NO; BEGIN; SELECT * FROM t1 FOR UPDATE; a @@ -95,7 +95,7 @@ Warnings: Warning 1292 Truncated incorrect max_relay_log_size value: '0' include/stop_slave.inc DELETE FROM t2; -CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>; +CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>, MASTER_USE_GTID=NO; BEGIN; SELECT * FROM t1 FOR UPDATE; a diff --git a/mysql-test/suite/rpl/r/rpl_delayed_slave.result b/mysql-test/suite/rpl/r/rpl_delayed_slave.result index e7daa3328ce..f63d3ccd0d9 100644 --- a/mysql-test/suite/rpl/r/rpl_delayed_slave.result +++ b/mysql-test/suite/rpl/r/rpl_delayed_slave.result @@ -3,6 +3,9 @@ include/master-slave.inc call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); connection slave; call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc connection master; [on master] CREATE TABLE t1 (a VARCHAR(100), b INT); @@ -153,7 +156,9 @@ CHANGE MASTER TO MASTER_DELAY = 71; include/start_slave.inc # Asserted this: Delay should be 71 when we set it to 71 include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is changing the current value of Using_Gtid from 'No' to its default value of 'Slave_Pos' [on master] connection master; RESET MASTER; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index 5865b75550f..be98b7e3dcd 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -437,7 +437,7 @@ connection master; ** Stop and Reset Slave ** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc ** create table slave side ** CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) @@ -482,7 +482,7 @@ connection slave; *** Create t11 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE='InnoDB'; @@ -524,7 +524,7 @@ connection slave; *** Create t12 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE='InnoDB'; @@ -573,7 +573,7 @@ connection slave; *** Create t14 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -638,7 +638,7 @@ connection slave; include/wait_for_slave_sql_error.inc [errno=1091] Last_SQL_Error = 'Error 'Can't DROP COLUMN `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc *** Drop t14 *** DROP TABLE t14; @@ -655,7 +655,9 @@ START SLAVE; *** Create t15 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-103. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -693,7 +695,9 @@ connection slave; include/wait_for_slave_sql_error.inc [errno=1054] Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-104. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t15 *** DROP TABLE t15; @@ -710,7 +714,9 @@ START SLAVE; *** Create t16 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-105. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -748,7 +754,9 @@ connection slave; include/wait_for_slave_sql_error.inc [errno=1072] Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-106. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t16 *** DROP TABLE t16; @@ -765,7 +773,9 @@ START SLAVE; *** Create t17 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-107. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -831,7 +841,7 @@ connection slave; *** Create t18 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -896,7 +906,7 @@ connection slave; *** Create t5 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index f47d79b5b86..53b20b188ba 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -437,7 +437,7 @@ connection master; ** Stop and Reset Slave ** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc ** create table slave side ** CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) @@ -482,7 +482,7 @@ connection slave; *** Create t11 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE='MyISAM'; @@ -524,7 +524,7 @@ connection slave; *** Create t12 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE='MyISAM'; @@ -573,7 +573,7 @@ connection slave; *** Create t14 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -638,7 +638,7 @@ connection slave; include/wait_for_slave_sql_error.inc [errno=1091] Last_SQL_Error = 'Error 'Can't DROP COLUMN `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc *** Drop t14 *** DROP TABLE t14; @@ -655,7 +655,9 @@ START SLAVE; *** Create t15 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-103. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -693,7 +695,9 @@ connection slave; include/wait_for_slave_sql_error.inc [errno=1054] Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-104. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t15 *** DROP TABLE t15; @@ -710,7 +714,9 @@ START SLAVE; *** Create t16 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-105. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -748,7 +754,9 @@ connection slave; include/wait_for_slave_sql_error.inc [errno=1072] Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-106. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t16 *** DROP TABLE t16; @@ -765,7 +773,9 @@ START SLAVE; *** Create t17 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-107. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -831,7 +841,7 @@ connection slave; *** Create t18 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -896,7 +906,7 @@ connection slave; *** Create t5 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index a9cbbd9fafe..e006d99f47c 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -5,7 +5,7 @@ call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot **** Diff Table Def Start **** connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc SET @saved_slave_type_conversions = @@slave_type_conversions; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20), @@ -42,7 +42,7 @@ DROP TABLE t1; connection slave; *** Create t2 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -66,7 +66,9 @@ START SLAVE; include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10 octets)' to type 'char(5 octets) character set latin1'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-4. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos SELECT * FROM t2 ORDER BY a; a b c d e connection master; @@ -79,7 +81,7 @@ DROP TABLE t2; connection slave; *** Create t3 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -109,7 +111,7 @@ DROP TABLE t3; connection slave; *** Create t4 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -138,7 +140,7 @@ DROP TABLE t4; connection slave; *** Create t5 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT, e DOUBLE, f DECIMAL(8,2))ENGINE='InnoDB'; @@ -167,7 +169,7 @@ DROP TABLE t5; connection slave; *** Create t6 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT)ENGINE='InnoDB'; *** Create t6 on Master *** @@ -198,7 +200,7 @@ connection slave; **** Extra Colums Start **** *** Create t7 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e CHAR(20) DEFAULT 'Extra Column Testing') @@ -234,7 +236,7 @@ DROP TABLE t7; connection slave; *** Create t8 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e INT)ENGINE='InnoDB'; @@ -256,7 +258,7 @@ connection master; DROP TABLE t8; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -289,7 +291,7 @@ DROP TABLE t9; connection slave; *** Create t10 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; *** Create t10 on Master *** @@ -317,7 +319,7 @@ DROP TABLE t10; connection slave; *** Create t11 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; *** Create t11 on Master *** @@ -345,7 +347,7 @@ DROP TABLE t11; connection slave; *** Create t12 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; *** Create t12 on Master *** @@ -381,7 +383,7 @@ connection slave; *** BUG 22177 Start *** *** Create t13 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5), d INT DEFAULT '1', e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -419,7 +421,7 @@ connection slave; *** Alter Master Table Testing Start *** *** Create t14 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -455,7 +457,7 @@ c1 c2 c3 c4 c5 c6 c7 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP *** Create t14a on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -488,7 +490,7 @@ c1 c4 c5 c6 c7 2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc *** Master Drop c5 *** connection master; ALTER TABLE t14a DROP COLUMN c5; @@ -547,7 +549,7 @@ DROP TABLE t14; connection slave; *** Create t15 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', @@ -615,7 +617,7 @@ DROP TABLE t15; connection slave; *** Create t16 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', @@ -687,7 +689,7 @@ connection slave; *** Alter Master End *** *** Create t17 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index 11a716f22b6..ad1874056d6 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -5,7 +5,7 @@ call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot **** Diff Table Def Start **** connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc SET @saved_slave_type_conversions = @@slave_type_conversions; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20), @@ -42,7 +42,7 @@ DROP TABLE t1; connection slave; *** Create t2 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -66,7 +66,9 @@ START SLAVE; include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10 octets)' to type 'char(5 octets) character set latin1'' STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-4. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos SELECT * FROM t2 ORDER BY a; a b c d e connection master; @@ -79,7 +81,7 @@ DROP TABLE t2; connection slave; *** Create t3 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -109,7 +111,7 @@ DROP TABLE t3; connection slave; *** Create t4 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') @@ -138,7 +140,7 @@ DROP TABLE t4; connection slave; *** Create t5 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT, e DOUBLE, f DECIMAL(8,2))ENGINE='MyISAM'; @@ -167,7 +169,7 @@ DROP TABLE t5; connection slave; *** Create t6 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT)ENGINE='MyISAM'; *** Create t6 on Master *** @@ -198,7 +200,7 @@ connection slave; **** Extra Colums Start **** *** Create t7 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e CHAR(20) DEFAULT 'Extra Column Testing') @@ -234,7 +236,7 @@ DROP TABLE t7; connection slave; *** Create t8 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e INT)ENGINE='MyISAM'; @@ -256,7 +258,7 @@ connection master; DROP TABLE t8; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -289,7 +291,7 @@ DROP TABLE t9; connection slave; *** Create t10 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; *** Create t10 on Master *** @@ -317,7 +319,7 @@ DROP TABLE t10; connection slave; *** Create t11 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; *** Create t11 on Master *** @@ -345,7 +347,7 @@ DROP TABLE t11; connection slave; *** Create t12 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; *** Create t12 on Master *** @@ -381,7 +383,7 @@ connection slave; *** BUG 22177 Start *** *** Create t13 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5), d INT DEFAULT '1', e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -419,7 +421,7 @@ connection slave; *** Alter Master Table Testing Start *** *** Create t14 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -455,7 +457,7 @@ c1 c2 c3 c4 c5 c6 c7 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP *** Create t14a on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -488,7 +490,7 @@ c1 c4 c5 c6 c7 2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc *** Master Drop c5 *** connection master; ALTER TABLE t14a DROP COLUMN c5; @@ -547,7 +549,7 @@ DROP TABLE t14; connection slave; *** Create t15 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', @@ -615,7 +617,7 @@ DROP TABLE t15; connection slave; *** Create t16 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', @@ -687,7 +689,7 @@ connection slave; *** Alter Master End *** *** Create t17 on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5), d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') diff --git a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result index 15bcb6621ff..1901e341103 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result @@ -377,6 +377,8 @@ a b connection server_1; include/stop_slave.inc RESET SLAVE ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' connection server_2; CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result index 5c80e64dc9b..644add9280e 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result @@ -53,6 +53,8 @@ connection server_1; include/stop_slave.inc include/wait_for_slave_to_stop.inc reset slave all; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' connection server_2; CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1, master_user = 'root', MASTER_USE_GTID=CURRENT_POS; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result index 606207c1d99..665fc536df6 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result @@ -67,6 +67,8 @@ a 11 include/stop_slave.inc RESET SLAVE ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' INSERT INTO t1 VALUES (12); connection server_2; INSERT INTO t1 VALUES (22); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result index 9f0ad66bb83..2471f26bc04 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result @@ -58,8 +58,8 @@ connection server_3; include/sync_with_master_gtid.inc connection server_2; STOP SLAVE; -CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = (); +CHANGE MASTER TO IGNORE_DOMAIN_IDS = (); connection server_3; STOP SLAVE; -CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = (); +CHANGE MASTER TO IGNORE_DOMAIN_IDS = (); # End of test. diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result index c42348d40ee..76694a2e72d 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result @@ -46,6 +46,8 @@ a b 4 2 include/stop_slave.inc RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' INSERT INTO t1 VALUES (5, 1); INSERT INTO t1 VALUES (6, 1); include/save_master_gtid.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result index 3c363004170..fcbabd17b11 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result @@ -38,7 +38,7 @@ START SLAVE; include/wait_for_slave_io_error.inc [errno=1236] include/stop_slave.inc CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, -MASTER_LOG_FILE="master-bin.000003", MASTER_LOG_POS=4; +MASTER_LOG_FILE="master-bin.000003", MASTER_LOG_POS=4, MASTER_USE_GTID=NO; include/start_slave.inc SELECT * FROM t1 ORDER BY a; a @@ -90,6 +90,8 @@ connection server_2; connection server_2; include/stop_slave.inc RESET SLAVE ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' RESET MASTER; connection server_1; RESET MASTER; @@ -119,6 +121,8 @@ connection server_2; include/stop_slave.inc DROP TABLE t1; RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' SET GLOBAL gtid_slave_pos=""; Warnings: Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-4. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos @@ -145,7 +149,7 @@ a 2 *** Test that RESET SLAVE clears the Using_Gtid flag. *** include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc Using_Gtid = 'No' START SLAVE; include/wait_for_slave_sql_error.inc [errno=1050] @@ -238,6 +242,9 @@ connection server_2; include/stop_slave.inc DROP TABLE t1; RESET SLAVE ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' +CHANGE MASTER TO MASTER_USE_GTID=NO; 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; 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 50f24d56e9a..00f3a48e805 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result @@ -6,7 +6,7 @@ INSERT INTO t1 VALUES (1); connection server_2; include/stop_slave.inc Master_Log_File = 'master-bin.000001' -Using_Gtid = 'No' +Using_Gtid = 'Slave_Pos' CHANGE MASTER TO master_use_gtid=current_pos; FLUSH LOGS; connection server_1; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result index 2295aad34ac..353e64bd3e3 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_until.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result @@ -1,4 +1,8 @@ include/rpl_init.inc [topology=1->2] +connection server_2; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc connection server_1; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100)) @@ -199,6 +203,8 @@ include/start_slave.inc connection server_2; include/stop_slave.inc RESET SLAVE ALL; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' RESET MASTER; SET GLOBAL gtid_slave_pos=''; connection server_1; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 1db69ea4b83..88e0214150b 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -14,12 +14,12 @@ connection slave; *** Default value *** CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root'; slave_net_timeout/slave_heartbeat_timeout=2.0000 -RESET SLAVE; +include/reset_slave.inc *** Reset slave affect *** SET @@global.slave_net_timeout=30; CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5; -RESET SLAVE; +include/reset_slave.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 15.000 @@ -31,7 +31,7 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 25.000 SET @@global.slave_net_timeout=@restore_slave_net_timeout; -RESET SLAVE; +include/reset_slave.inc *** Warning if updated slave_net_timeout < slave_heartbeat_timeout *** SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1; @@ -223,11 +223,15 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL); connection master; INSERT INTO t1 VALUES (1, 'on master', NULL); connection slave; +set sql_log_bin= 0; call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin= 1; Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 include/stop_slave.inc +set sql_log_bin= 0; DROP TABLE t1; +set sql_log_bin= 1; *** Master send to slave *** connection master; @@ -240,7 +244,9 @@ END| Warnings: Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it. connection slave; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-2. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5; include/start_slave.inc connection master; @@ -256,8 +262,10 @@ connection slave; *** Flush logs on slave *** STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +set sql_log_bin= 0; DROP TABLE t1; +set sql_log_bin= 1; connection master; DROP TABLE t1; RESET MASTER; @@ -271,7 +279,7 @@ connection master; SET @@global.slave_compressed_protocol=1; connection slave; include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc SET @@global.slave_compressed_protocol=1; CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc @@ -283,7 +291,7 @@ SET @@global.slave_compressed_protocol=0; *** Reset master *** connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc connection master; @@ -294,7 +302,7 @@ Heartbeat events are received after reset of master (1 means 'yes'): 1 *** Reload master *** connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc Heartbeat event received diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result index ff7178ae700..533290d25ca 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result @@ -15,7 +15,8 @@ MASTER_LOG_FILE='MASTER_BINLOG', MASTER_SSL=1, MASTER_SSL_CA='MYSQL_TEST_DIR/std_data/cacert.pem', MASTER_SSL_CERT='MYSQL_TEST_DIR/std_data/client-cert.pem', -MASTER_SSL_KEY='MYSQL_TEST_DIR/std_data/client-key.pem'; +MASTER_SSL_KEY='MYSQL_TEST_DIR/std_data/client-key.pem', +MASTER_USE_GTID=NO; include/start_slave.inc Master_SSL_Allowed: Yes Heartbeat event has received diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result index e759f34bb9d..0be197642e9 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -57,7 +57,9 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1; connection slave; include/wait_for_slave_sql_error.inc [errno=1062] stop slave; -reset slave; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-14. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos include/check_slave_no_error.inc connection master; reset master; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 7f5f34bf831..74080b3936f 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,7 +9,7 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> connection slave; include/stop_slave.inc -change master to master_log_pos=MASTER_LOG_POS; +change master to master_log_pos=MASTER_LOG_POS, master_use_gtid=no; start slave; include/wait_for_slave_io_error.inc [errno=1236] Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' @@ -23,7 +23,7 @@ drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); connection slave; -change master to master_log_pos=MASTER_LOG_POS; +change master to master_log_pos=MASTER_LOG_POS, master_use_gtid=no; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index 78a86437867..9de66d179a6 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; FLUSH LOGS; CREATE TABLE t1(c1 INT); connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result index ac846ac6c00..68e8b22dd02 100644 --- a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result +++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result @@ -4,6 +4,9 @@ connection master; set @old_master_binlog_checksum= @@global.binlog_checksum; connection slave; include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +include/stop_slave.inc # Test slave with no capability gets dummy event, which is ignored. set @old_dbug= @@global.debug_dbug; SET @@global.debug_dbug='+d,simulate_slave_capability_none'; diff --git a/mysql-test/suite/rpl/r/rpl_mdev6020.result b/mysql-test/suite/rpl/r/rpl_mdev6020.result index b0cb392b04c..fbea6ac38d2 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev6020.result +++ b/mysql-test/suite/rpl/r/rpl_mdev6020.result @@ -13,7 +13,7 @@ SET @old_engine= @@GLOBAL.default_storage_engine; SET GLOBAL default_storage_engine=InnoDB; SET @old_parallel= @@GLOBAL.slave_parallel_threads; SET GLOBAL slave_parallel_threads=12; -CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; include/start_slave.inc connection master; SET SQL_LOG_BIN=0; diff --git a/mysql-test/suite/rpl/r/rpl_mdev_17614.result b/mysql-test/suite/rpl/r/rpl_mdev_17614.result index ba077111522..0cc924749c8 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev_17614.result +++ b/mysql-test/suite/rpl/r/rpl_mdev_17614.result @@ -31,7 +31,7 @@ a b c 2 2 3 stop slave; include/wait_for_slave_to_stop.inc -reset slave; +include/reset_slave.inc connection master; reset master; drop table t1; @@ -191,7 +191,7 @@ a b c 2 2 3 stop slave; include/wait_for_slave_to_stop.inc -reset slave; +include/reset_slave.inc connection master; reset master; drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 388c8e67b68..fd33ec992f6 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; diff --git a/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result b/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result index bedd103c2a0..7a5cf257458 100644 --- a/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result +++ b/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result @@ -10,7 +10,7 @@ connection master; include/rpl_stop_server.inc [server_number=1] include/rpl_start_server.inc [server_number=1] connection slave; -CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; include/start_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result b/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result index 23b3217895a..8e1d3d03952 100644 --- a/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result +++ b/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result @@ -10,7 +10,7 @@ connection master; include/rpl_stop_server.inc [server_number=1] include/rpl_start_server.inc [server_number=1] connection slave; -CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; include/start_slave.inc connection master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_old_master.result b/mysql-test/suite/rpl/r/rpl_old_master.result index f985bee6832..5e9d8a88a20 100644 --- a/mysql-test/suite/rpl/r/rpl_old_master.result +++ b/mysql-test/suite/rpl/r/rpl_old_master.result @@ -8,7 +8,7 @@ include/rpl_start_server.inc [server_number=1] connection slave; SET @old_parallel= @@GLOBAL.slave_parallel_threads; SET GLOBAL slave_parallel_threads=10; -CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; FLUSH TABLES WITH READ LOCK; include/start_slave.inc include/wait_for_slave_param.inc [Seconds_Behind_Master] diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result index 88e1848d46e..ffffb580518 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result @@ -55,6 +55,7 @@ connection slave; include/stop_slave.inc reset slave; reset master; +set @@global.gtid_slave_pos= ""; set @saved_slave_trans_retry_interval= @@GLOBAL.slave_transaction_retry_interval; set global slave_transaction_retry_interval=1; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result b/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result index 5c0002a911a..e193a7e1126 100644 --- a/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result +++ b/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result @@ -6,7 +6,7 @@ DROP TABLE t1; connection slave; ==== Check that we can understand the new format of relay-log.info ==== include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc # Read relay-log.info START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc diff --git a/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result b/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result index 217bc726e0e..151a00a514b 100644 --- a/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result +++ b/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result @@ -6,7 +6,7 @@ DROP TABLE t1; connection slave; ==== Check that we still understand the old format of relay-log.info ==== include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc # Read relay-log.info START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc diff --git a/mysql-test/suite/rpl/r/rpl_reset_slave_fail.result b/mysql-test/suite/rpl/r/rpl_reset_slave_fail.result index 34ce68cb079..ff2da0a900a 100644 --- a/mysql-test/suite/rpl/r/rpl_reset_slave_fail.result +++ b/mysql-test/suite/rpl/r/rpl_reset_slave_fail.result @@ -22,7 +22,7 @@ START SLAVE; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log START SLAVE; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log -RESET SLAVE; +include/reset_slave.inc DROP TABLE t1; START SLAVE UNTIL MASTER_LOG_FILE= 'MASTER_LOG_FILE', MASTER_LOG_POS= MASTER_LOG_POS;; include/wait_for_slave_sql_to_stop.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result index 976ac0996bf..926404d29be 100644 --- a/mysql-test/suite/rpl/r/rpl_row_001.result +++ b/mysql-test/suite/rpl/r/rpl_row_001.result @@ -6,7 +6,7 @@ connection master; RESET MASTER; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc connection master; SELECT COUNT(*) FROM t1; COUNT(*) diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 748d83a7f8e..dbfb9325f9c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -11,7 +11,7 @@ Warnings: Note 1051 Unknown table 'test.t1' connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc CREATE TABLE t1 (a DECIMAL(5,2)); connection master; CREATE TABLE t1 (a DECIMAL(20, 10)); @@ -25,7 +25,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -34,7 +36,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a DECIMAL(27, 9)); connection master; CREATE TABLE t1 (a DECIMAL(27, 18)); @@ -48,7 +52,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -57,7 +63,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a NUMERIC(5,2)); connection master; CREATE TABLE t1 (a NUMERIC(20, 10)); @@ -71,7 +79,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -81,7 +91,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a FLOAT(20)); connection master; CREATE TABLE t1 (a FLOAT(47)); @@ -95,7 +107,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -105,7 +119,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a BIT(5)); connection master; CREATE TABLE t1 (a BIT(64)); @@ -119,7 +135,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -128,7 +146,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a BIT(11)); connection master; CREATE TABLE t1 (a BIT(12)); @@ -142,7 +162,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -152,7 +174,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a SET('4')); connection master; CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9')); @@ -166,7 +190,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -176,7 +202,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a CHAR(10)); connection master; CREATE TABLE t1 (a CHAR(20)); @@ -190,7 +218,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -200,7 +230,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a ENUM('44','54')); connection master; CREATE TABLE t1 (a ENUM( @@ -245,7 +277,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -255,7 +289,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a VARCHAR(100)); connection master; CREATE TABLE t1 (a VARCHAR(2000)); @@ -269,7 +305,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -278,7 +316,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a VARCHAR(10)); connection master; CREATE TABLE t1 (a VARCHAR(200)); @@ -292,7 +332,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -301,7 +343,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a VARCHAR(1000)); connection master; CREATE TABLE t1 (a VARCHAR(2000)); @@ -315,7 +359,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; @@ -325,7 +371,9 @@ connection master; DROP TABLE IF EXISTS t1; connection slave; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' CREATE TABLE t1 (a TINYBLOB); connection master; CREATE TABLE t1 (a LONGBLOB); @@ -339,7 +387,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result index 660c736795b..8ce08e9d550 100644 --- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +change master to master_use_gtid=no; +include/start_slave.inc +connection master; create table t1 (a int) ENGINE=MyISAM; insert into t1 values (10); create table t2 (a int) ENGINE=MyISAM; diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result index 0704f5c69a1..bf63dc57c4b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result @@ -75,7 +75,9 @@ load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; connection slave; include/wait_for_slave_sql_error.inc [errno=1062] stop slave; -reset slave; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos include/check_slave_no_error.inc connection master; reset master; diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index baabcf65dc5..ce3ef0e6a3c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -91,7 +91,7 @@ include/wait_for_slave_to_stop.inc connection master; reset master; connection slave; -reset slave; +include/reset_slave.inc start slave; include/wait_for_slave_to_start.inc connection master; @@ -221,7 +221,7 @@ include/wait_for_slave_to_stop.inc connection master; reset master; connection slave; -reset slave; +include/reset_slave.inc start slave; include/wait_for_slave_to_start.inc connection master; @@ -356,7 +356,7 @@ include/wait_for_slave_to_stop.inc connection master; reset master; connection slave; -reset slave; +include/reset_slave.inc start slave; include/wait_for_slave_to_start.inc connection master; diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index b9e98d5a97d..5e595447e50 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -7,7 +7,7 @@ include/stop_slave.inc change master to master_user='test'; Master_User = 'test' Master_Host = '127.0.0.1' -reset slave; +include/reset_slave.inc Master_User = 'test' Master_Host = '127.0.0.1' change master to master_user='root'; @@ -15,13 +15,13 @@ include/start_slave.inc Master_User = 'root' Master_Host = '127.0.0.1' include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc connection master; create temporary table t1 (a int); connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value @@ -30,7 +30,7 @@ connection master; drop temporary table if exists t1; connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='impossible_user_name'; start slave; @@ -44,13 +44,14 @@ change master to master_user='impossible_user_name'; start slave; include/wait_for_slave_io_error.inc [errno=1045] include/stop_slave_sql.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='root'; -reset slave; +include/reset_slave.inc include/start_slave.inc include/stop_slave.inc reset slave all; +set @@global.gtid_slave_pos= ""; start slave; ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result index 82268ce72eb..8ef10bf47b5 100644 --- a/mysql-test/suite/rpl/r/rpl_row_until.result +++ b/mysql-test/suite/rpl/r/rpl_row_until.result @@ -10,7 +10,7 @@ INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; connection slave; include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT; connection slave; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1; @@ -52,7 +52,7 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; include/stop_slave.inc -RESET SLAVE; +include/reset_slave.inc include/start_slave.inc include/rpl_reset.inc connection master; diff --git a/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result b/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result index 4eeb863bb40..eeafd679187 100644 --- a/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result +++ b/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result @@ -2,6 +2,9 @@ include/master-slave.inc [connection master] connection slave; include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +include/stop_slave.inc SET @save_dbug= @@GLOBAL.debug_dbug; SET @@global.debug_dbug="+d,pause_sql_thread_on_fde"; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index d18bd1efda7..edd5e7748e0 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -6,16 +6,18 @@ call mtr.add_suppression("Read semi-sync reply"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); call mtr.add_suppression("mysqld: Got an error reading communication packets"); connection slave; +set sql_log_bin=0; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin=1; connection master; # # Uninstall semi-sync plugins on master and slave # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; @@ -310,7 +312,7 @@ Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc @@ -340,7 +342,7 @@ Rpl_semi_sync_master_yes_tx 3 # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc connection master; reset master; include/kill_binlog_dump_threads.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result index f2240817489..7341eb547f3 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result @@ -7,16 +7,18 @@ call mtr.add_suppression("Read semi-sync reply"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); call mtr.add_suppression("mysqld: Got an error reading communication packets"); connection slave; +set sql_log_bin=0; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin=1; connection master; # # Uninstall semi-sync plugins on master and slave # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; @@ -311,7 +313,7 @@ Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc @@ -341,7 +343,7 @@ Rpl_semi_sync_master_yes_tx 3 # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc connection master; reset master; include/kill_binlog_dump_threads.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result index fcced801d65..d75a3a2c9b7 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result @@ -7,16 +7,18 @@ call mtr.add_suppression("Read semi-sync reply"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); call mtr.add_suppression("mysqld: Got an error reading communication packets"); connection slave; +set sql_log_bin=0; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin=1; connection master; # # Uninstall semi-sync plugins on master and slave # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc set global rpl_semi_sync_master_enabled= 0; set global rpl_semi_sync_slave_enabled= 0; connection master; @@ -311,7 +313,7 @@ Variable_name Value Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc @@ -341,7 +343,7 @@ Rpl_semi_sync_master_yes_tx 3 # connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc connection master; reset master; include/kill_binlog_dump_threads.inc diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result index 74145645920..3d8eeb02ca6 100644 --- a/mysql-test/suite/rpl/r/rpl_server_id2.result +++ b/mysql-test/suite/rpl/r/rpl_server_id2.result @@ -1,6 +1,9 @@ include/master-slave.inc [connection master] connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc create table t1 (n int); reset master; stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result index 22f739d1ec0..3c7f2950d16 100644 --- a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result +++ b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result @@ -11,7 +11,7 @@ ignore server id list: change master to IGNORE_SERVER_IDS= (10, 100); *** must be 10, 100 *** ignore server id list: 10, 100 -reset slave; +include/reset_slave.inc *** must be empty due to reset slave *** ignore server id list: 10, 100 change master to IGNORE_SERVER_IDS= (10, 100); @@ -33,7 +33,7 @@ Tables_in_test *** allowing events from master *** stop slave; include/wait_for_slave_to_stop.inc -reset slave; +include/reset_slave.inc change master to IGNORE_SERVER_IDS= (10, 100); *** the list must remain (10, 100) after reset slave *** change master to IGNORE_SERVER_IDS= (); diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result index 59d5b50e5cc..96e0a30331d 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_replication.result +++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result @@ -1,6 +1,11 @@ include/master-slave.inc [connection master] connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; +connection slave; CREATE USER 'nonsuperuser'@'127.0.0.1'; GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE, SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1'; diff --git a/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result b/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result index 2a49e80075f..0ede17132df 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result +++ b/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result @@ -30,6 +30,7 @@ include/wait_for_slave_io_to_stop.inc include/wait_for_slave_sql_to_stop.inc "Command: RESET SLAVE ALL --> RESET REPLICA ALL" RESET REPLICA ALL; +set @@global.gtid_slave_pos= ""; connection master; RESET MASTER; CREATE TABLE t(f INT) ENGINE=INNODB; diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index b9fe6842a11..8896199f499 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -63,7 +63,7 @@ c d 3 27 STOP SLAVE; include/wait_for_slave_to_stop.inc -RESET SLAVE; +include/reset_slave.inc connection master; RESET MASTER; SET SESSION BINLOG_FORMAT=STATEMENT; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result index 97455c6af54..7f2d4730fe5 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result @@ -1,6 +1,10 @@ include/master-slave.inc [connection master] connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection slave; SET @old_debug_slave= @@global.debug; stop slave; SET GLOBAL slave_parallel_threads=4; diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result index 9ef2ca3bc53..5d6d61d175b 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -49,7 +49,7 @@ connection master; reset master; connection slave; stop slave; -reset slave; +include/reset_slave.inc connection master; connection slave; lock tables t1 read; diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index 388c8e67b68..fd33ec992f6 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result index 660c736795b..8ce08e9d550 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +change master to master_use_gtid=no; +include/start_slave.inc +connection master; create table t1 (a int) ENGINE=MyISAM; insert into t1 values (10); create table t2 (a int) ENGINE=MyISAM; diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result index f510eae74f8..a437b66dd78 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result @@ -74,7 +74,9 @@ load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; connection slave; include/wait_for_slave_sql_error.inc [errno=1062] stop slave; -reset slave; +include/reset_slave.inc +Warnings: +Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-14. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos include/check_slave_no_error.inc connection master; reset master; diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index 1ba2d1b624b..0a365b30b38 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -7,7 +7,7 @@ include/stop_slave.inc change master to master_user='test'; Master_User = 'test' Master_Host = '127.0.0.1' -reset slave; +include/reset_slave.inc Master_User = 'test' Master_Host = '127.0.0.1' change master to master_user='root'; @@ -15,13 +15,13 @@ include/start_slave.inc Master_User = 'root' Master_Host = '127.0.0.1' include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc connection master; create temporary table t1 (a int); connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value @@ -30,7 +30,7 @@ connection master; drop temporary table if exists t1; connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='impossible_user_name'; start slave; @@ -44,13 +44,14 @@ change master to master_user='impossible_user_name'; start slave; include/wait_for_slave_io_error.inc [errno=1045] include/stop_slave_sql.inc -reset slave; +include/reset_slave.inc include/check_slave_no_error.inc change master to master_user='root'; -reset slave; +include/reset_slave.inc include/start_slave.inc include/stop_slave.inc reset slave all; +set @@global.gtid_slave_pos= ""; start slave; ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 992e6c2181b..40910b8c1f2 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -104,13 +104,15 @@ connection master; RESET MASTER; connection slave; include/stop_slave.inc -CHANGE MASTER TO master_log_pos=MASTER_POS; +CHANGE MASTER TO master_log_pos=MASTER_POS, master_use_gtid=no; START SLAVE; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' include/stop_slave.inc RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; RESET MASTER; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index 65f188c11a0..b51e3d847e3 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -69,7 +69,9 @@ Note 1254 Slave is already running connection slave; include/stop_slave.inc drop table if exists t1; -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; connection master; drop table if exists t1; diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index a4dbf13290a..50a52d4d4b3 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -1,5 +1,10 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +connection master; # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends # diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result index 06d5a3c895f..f4f700ac477 100644 --- a/mysql-test/suite/rpl/r/rpl_trigger.result +++ b/mysql-test/suite/rpl/r/rpl_trigger.result @@ -1,5 +1,9 @@ include/master-slave.inc [connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc connection master; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; @@ -961,7 +965,9 @@ include/rpl_stop_server.inc [server_number=1] include/rpl_start_server.inc [server_number=1] --> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4 connection slave; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' START SLAVE; SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; MASTER_POS_WAIT('master-bin.000001', 513) >= 0 @@ -992,7 +998,9 @@ DROP TRIGGER trg1; DROP TABLE t1; DROP TABLE t2; STOP SLAVE; -RESET SLAVE; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection master; SHOW TABLES LIKE 't_'; Tables_in_test (t_) @@ -1083,7 +1091,12 @@ drop table t1; connection slave; connection master; include/rpl_reset.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc connection master; create table t1 ( f int ) engine = innodb; create table log ( r int ) engine = myisam; diff --git a/mysql-test/suite/rpl/r/rpl_using_gtid_default.result b/mysql-test/suite/rpl/r/rpl_using_gtid_default.result new file mode 100644 index 00000000000..c0e9b3add00 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_using_gtid_default.result @@ -0,0 +1,142 @@ +include/master-slave.inc +[connection master] +# +# Slave default configuration should be Slave_Pos +connection slave; +# +# Ensure that a slave configured with Using_Gtid=Slave_Pos will remain +# as Slave_Pos after RESET SLAVE +include/stop_slave.inc +RESET SLAVE; +# No warning should be given because Slave_Pos never changed +SHOW WARNINGS; +Level Code Message +include/start_slave.inc +# +# Ensure that a slave configured with Using_Gtid=No will revert to its +# default of Slave_Pos after RESET SLAVE for a master which supports +# GTIDs +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +include/start_slave.inc +include/stop_slave.inc +RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' +# A notification that Using_Gtid was reverted should exist +SHOW WARNINGS; +Level Code Message +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' +include/start_slave.inc +# Clear SHOW WARNINGS +# +# If the primary does not support GTIDs (version < 10), the replica +# should fall back to Using_Gtid=No on slave start, and should not +# revert Using_Gtid to Slave_Pos after RESET SLAVE +include/stop_slave.inc +RESET SLAVE ALL; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=1; +SET @saved_dbug= @@GLOBAL.debug_dbug; +set @@global.debug_dbug= "d,mock_mariadb_primary_v5_in_get_master_version"; +include/start_slave.inc +# Replica should detect at start that the primary does not support GTIDs +# and fall-back to Using_Gtid=No +# Replica should have an informational message stating it is falling +# back to Using_Gtid=No +FOUND 1 /Falling back to Using_Gtid=No because master does not support GTIDs/ in mysqld.2.err +include/stop_slave.inc +RESET SLAVE; +# Replica should know that the primary does not support GTIDs and +# preserve Using_Gtid=No +# 'No' was not reverted and therefore no note should be added +SHOW WARNINGS; +Level Code Message +set @@global.debug_dbug= @saved_dbug; +include/start_slave.inc +# +# Ensure that a slave configured with Using_Gtid=Current_Pos will revert +# to its default of Slave_Pos after RESET SLAVE. +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=Current_Pos; +include/start_slave.inc +include/stop_slave.inc +RESET SLAVE; +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' +# A notification that Using_Gtid was reverted should exist +SHOW WARNINGS; +Level Code Message +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' +include/start_slave.inc +# Clear SHOW WARNINGS +# The MTR include file rpl_change_topology.inc should implicitly set +# MASTER_USE_GTID=NO when provided with $rpl_master_log_file. Note that +# this will switch master and slave roles. +connection slave; +include/stop_slave.inc +include/rpl_change_topology.inc [new topology=2->1] +# connection 'master' is the slave in this comparison +connection master; +# Validating Using_Gtid=No.. +# ..success +include/rpl_change_topology.inc [new topology=1->2] +# connection 'slave' is back to slave role +connection slave; +# Validating Using_Gtid=Slave_Pos.. +# ..success +include/start_slave.inc +# +# The MTR include file reset_slave.inc should keep/delete GTID state +# when reset_slave_keep_gtid_state is set, respectively. +# +connection master; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +# Tagging gtid_slave_pos before reset_slave.inc as old_slave_pos +# Using reset_slave_keep_gtid_state=1 should preserve GTID state +include/reset_slave.inc +# Tagging gtid_slave_pos after reset_slave.inc as new_slave_pos +# Validating old_slave_pos == new_slave_pos.. +# ..success +# Using reset_slave_keep_gtid_state=0 should empty GTID state +include/reset_slave.inc +# Tagging gtid_slave_pos as new_slave_pos +# Validating new_slave_pos is empty.. +# ..success +set global gtid_slave_pos="old_slave_pos"; +include/start_slave.inc +# +# A replica issued CHANGE MASTER TO specified with log coordinates but +# not master_use_gtid=no should warn the user that Using_Gtid is being +# changed to No. +# +connection slave; +include/stop_slave.inc +CHANGE MASTER TO master_log_pos=io_log_pos, master_log_file='io_log_file'; +Warnings: +Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No' +include/start_slave.inc +# +# A replica issued CHANGE MASTER TO specified with log coordinates and +# master_use_gtid=Slave_Pos should warn the user that the log +# coordinates will be ignored. +# +connection slave; +include/stop_slave.inc +CHANGE MASTER TO master_log_pos=io_log_pos, master_log_file='io_log_file', master_use_gtid=Slave_Pos; +Warnings: +Note 1618 <MASTER_LOG_FILE> option ignored +Note 1618 <MASTER_LOG_POS> option ignored +CHANGE MASTER TO relay_log_pos=relay_log_pos, relay_log_file='relay_log_file', master_use_gtid=Slave_Pos; +Warnings: +Note 1618 <RELAY_LOG_FILE> option ignored +Note 1618 <RELAY_LOG_POS> option ignored +include/start_slave.inc +include/rpl_end.inc +# +# End of rpl_using_gtid_default.test diff --git a/mysql-test/suite/rpl/r/rpl_xa_gap_lock.result b/mysql-test/suite/rpl/r/rpl_xa_gap_lock.result index cb760abe2d2..97e8f2105c4 100644 --- a/mysql-test/suite/rpl/r/rpl_xa_gap_lock.result +++ b/mysql-test/suite/rpl/r/rpl_xa_gap_lock.result @@ -38,7 +38,7 @@ include/diff_tables.inc [master:test.t1, slave:test.t1] include/diff_tables.inc [master:test.t2, slave:test.t2] DROP TABLE t2, t1; connection slave; -CHANGE MASTER TO MASTER_LOG_FILE='LOG_FILE', MASTER_LOG_POS=LOG_POS; +CHANGE MASTER TO MASTER_LOG_FILE='LOG_FILE', MASTER_LOG_POS=LOG_POS, MASTER_USE_GTID=NO; SET @@GLOBAL.innodb_limit_optimistic_insert_debug = @saved_innodb_limit_optimistic_insert_debug; include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/semisync_future-7591.result b/mysql-test/suite/rpl/r/semisync_future-7591.result index 9dc0ee51e53..80414ac1f8d 100644 --- a/mysql-test/suite/rpl/r/semisync_future-7591.result +++ b/mysql-test/suite/rpl/r/semisync_future-7591.result @@ -6,7 +6,7 @@ set global rpl_semi_sync_master_enabled = ON; connection slave; include/stop_slave.inc set global rpl_semi_sync_slave_enabled = ON; -change master to master_log_file='master-bin.000002', master_log_pos = 320; +change master to master_log_file='master-bin.000002', master_log_pos = 320, master_use_gtid=no; start slave; include/wait_for_slave_io_error.inc [errno=1236] connection master; @@ -14,7 +14,9 @@ insert into t1 values (1); reset master; connection slave; include/stop_slave.inc -reset slave; +include/reset_slave.inc +Warnings: +Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' include/start_slave.inc set global rpl_semi_sync_slave_enabled = OFF; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_000010.test b/mysql-test/suite/rpl/t/rpl_000010.test index de6337dd723..9ff2d6c562d 100644 --- a/mysql-test/suite/rpl/t/rpl_000010.test +++ b/mysql-test/suite/rpl/t/rpl_000010.test @@ -3,6 +3,12 @@ source include/master-slave.inc; +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--connection master + create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test index d6f817af189..23c8bdc3e2d 100644 --- a/mysql-test/suite/rpl/t/rpl_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_colSize.test @@ -17,7 +17,7 @@ DROP TABLE IF EXISTS t1; sync_slave_with_master; STOP SLAVE; --source include/wait_for_slave_to_stop.inc -RESET SLAVE; +--source include/reset_slave.inc SET @saved_slave_type_conversions = @@slave_type_conversions; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; diff --git a/mysql-test/suite/rpl/t/rpl_delayed_slave.test b/mysql-test/suite/rpl/t/rpl_delayed_slave.test index 7dd7b9cf6d9..d00e796b66f 100644 --- a/mysql-test/suite/rpl/t/rpl_delayed_slave.test +++ b/mysql-test/suite/rpl/t/rpl_delayed_slave.test @@ -63,6 +63,9 @@ call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); --connection slave call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc --connection master @@ -371,7 +374,8 @@ CHANGE MASTER TO MASTER_DELAY = 71; --source include/rpl_assert.inc --source include/stop_slave.inc -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --echo [on master] --connection master RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test index f8e8642af28..76723e1d265 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev9033.test @@ -63,10 +63,10 @@ DROP TABLE t2; --connection server_2 STOP SLAVE; -CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = (); +CHANGE MASTER TO IGNORE_DOMAIN_IDS = (); --connection server_3 STOP SLAVE; -CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = (); +CHANGE MASTER TO IGNORE_DOMAIN_IDS = (); --echo # End of test. diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test index 100d75a8cdc..a7c93ff7ed5 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test @@ -54,7 +54,7 @@ START SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, - MASTER_LOG_FILE="master-bin.000003", MASTER_LOG_POS=4; + MASTER_LOG_FILE="master-bin.000003", MASTER_LOG_POS=4, MASTER_USE_GTID=NO; --source include/start_slave.inc --sync_with_master SELECT * FROM t1 ORDER BY a; @@ -185,7 +185,8 @@ SELECT * FROM t1 ORDER BY a; --echo *** Test that RESET SLAVE clears the Using_Gtid flag. *** --source include/stop_slave.inc -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --let $status_items= Using_Gtid --source include/show_slave_status.inc @@ -286,6 +287,7 @@ eval SELECT '$value' AS Gtid_Slave_Pos; --source include/stop_slave.inc DROP TABLE t1; RESET SLAVE ALL; +CHANGE MASTER TO MASTER_USE_GTID=NO; RESET MASTER; SET GLOBAL gtid_slave_pos= ""; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until.test b/mysql-test/suite/rpl/t/rpl_gtid_until.test index aa05ecf79ab..49baf7e68e6 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_until.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_until.test @@ -2,6 +2,11 @@ --let $rpl_topology=1->2 --source include/rpl_init.inc +--connection server_2 +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + --connection server_1 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; # Function to extract one GTID from a list. diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index 45b5d48c13b..d6d14e0278d 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -52,7 +52,7 @@ let $slave_net_timeout= query_get_value(SHOW VARIABLES LIKE 'slave_net_timeout', let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period', Value, 1); let $result= query_get_value(SELECT $slave_net_timeout/$slave_heartbeat_timeout AS Result, Result, 1); --echo slave_net_timeout/slave_heartbeat_timeout=$result -RESET SLAVE; +--source include/reset_slave.inc --echo # Reset slave set slave_heartbeat_timeout = slave_net_timeout/2 @@ -62,7 +62,7 @@ SET @@global.slave_net_timeout=30; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5; -RESET SLAVE; +--source include/reset_slave.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; --echo @@ -75,7 +75,7 @@ SET @@global.slave_net_timeout=50; eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SET @@global.slave_net_timeout=@restore_slave_net_timeout; -RESET SLAVE; +--source include/reset_slave.inc --echo # Set slave_net_timeout less than current value of slave_heartbeat_period @@ -320,8 +320,10 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL); --connection master INSERT INTO t1 VALUES (1, 'on master', NULL); --connection slave +set sql_log_bin= 0; call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set sql_log_bin= 1; let $slave_errno= ER_DUP_ENTRY --source include/wait_for_slave_sql_error.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); @@ -330,7 +332,9 @@ let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_hea let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1); --echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result --source include/stop_slave.inc +set sql_log_bin= 0; DROP TABLE t1; +set sql_log_bin= 1; --echo # Check received heartbeat events while master send events to slave @@ -346,7 +350,7 @@ CREATE EVENT e1 END| DELIMITER ;| --connection slave -RESET SLAVE; +--source include/reset_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5; --source include/start_slave.inc @@ -404,8 +408,10 @@ DROP EVENT e1; # Check received heartbeat events while logs flushed on slave --echo *** Flush logs on slave *** STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc +set sql_log_bin= 0; DROP TABLE t1; +set sql_log_bin= 1; --connection master DROP TABLE t1; RESET MASTER; @@ -435,7 +441,7 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b SET @@global.slave_compressed_protocol=1; --connection slave --source include/stop_slave.inc -RESET SLAVE; +--source include/reset_slave.inc SET @@global.slave_compressed_protocol=1; --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; @@ -455,7 +461,7 @@ SET @@global.slave_compressed_protocol=0; --echo *** Reset master *** --connection slave STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc @@ -474,7 +480,7 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b --echo *** Reload master *** --connection slave STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test index 810db4cc6f7..2c41fdeeca8 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test @@ -29,7 +29,8 @@ eval CHANGE MASTER TO MASTER_SSL=1, MASTER_SSL_CA='$MYSQL_TEST_DIR/std_data/cacert.pem', MASTER_SSL_CERT='$MYSQL_TEST_DIR/std_data/client-cert.pem', - MASTER_SSL_KEY='$MYSQL_TEST_DIR/std_data/client-key.pem'; + MASTER_SSL_KEY='$MYSQL_TEST_DIR/std_data/client-key.pem', + MASTER_USE_GTID=NO; --source include/start_slave.inc # Check SSL state of slave let $slave_ssl_status= query_get_value(SHOW SLAVE STATUS, Master_SSL_Allowed, 1); diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 4f63cd32916..1504cba0774 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -26,7 +26,7 @@ source include/stop_slave.inc; let $wrong_log_pos= `SELECT $read_pos+2`; --replace_result $wrong_log_pos MASTER_LOG_POS -eval change master to master_log_pos=$wrong_log_pos; +eval change master to master_log_pos=$wrong_log_pos, master_use_gtid=no; start slave; let $slave_io_errno= 1236; --let $show_slave_io_error= 1 @@ -45,7 +45,7 @@ insert into t1 values (1),(2),(3); save_master_pos; connection slave; --replace_result 4 MASTER_LOG_POS -change master to master_log_pos=4; +change master to master_log_pos=4, master_use_gtid=no; start slave; sync_with_master; select * from t1 ORDER BY n; diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 1c087c550d0..cd472f6eab6 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -1,5 +1,11 @@ source include/master-slave.inc; +connection slave; +source include/stop_slave.inc; +CHANGE MASTER TO MASTER_USE_GTID=NO; +source include/start_slave.inc; +connection master; + # # BUG#28421 Infinite loop on slave relay logs # diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test index 19f2db32cb7..d49851cc8ce 100644 --- a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test +++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test @@ -12,6 +12,12 @@ set @old_master_binlog_checksum= @@global.binlog_checksum; # # Test this by binlog rotation before we log any GTIDs. connection slave; + +# Need to stop/start the master without GTID before setting debug_dbug +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + --source include/stop_slave.inc --echo # Test slave with no capability gets dummy event, which is ignored. set @old_dbug= @@global.debug_dbug; diff --git a/mysql-test/suite/rpl/t/rpl_mdev6020.test b/mysql-test/suite/rpl/t/rpl_mdev6020.test index ec3fd92f817..06f03be1430 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev6020.test +++ b/mysql-test/suite/rpl/t/rpl_mdev6020.test @@ -29,7 +29,7 @@ SET GLOBAL default_storage_engine=InnoDB; SET @old_parallel= @@GLOBAL.slave_parallel_threads; SET GLOBAL slave_parallel_threads=12; --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 -eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; --source include/start_slave.inc --connection master diff --git a/mysql-test/suite/rpl/t/rpl_mdev_17614.test b/mysql-test/suite/rpl/t/rpl_mdev_17614.test index c11aad3305e..8d91944a8eb 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev_17614.test +++ b/mysql-test/suite/rpl/t/rpl_mdev_17614.test @@ -42,7 +42,7 @@ SELECT * FROM t1; # restart replication for the next testcase stop slave; --source include/wait_for_slave_to_stop.inc -reset slave; +--source include/reset_slave.inc connection master; reset master; drop table t1; @@ -161,7 +161,7 @@ SELECT * FROM t1; # restart replication for the next testcase stop slave; --source include/wait_for_slave_to_stop.inc -reset slave; +--source include/reset_slave.inc connection master; reset master; drop table t1; diff --git a/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test b/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test index 675b7db0603..34001382c93 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test +++ b/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test @@ -43,7 +43,7 @@ CREATE TABLE t1 (id SERIAL, a DATETIME(3)); --connection slave --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 -eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test b/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test index ad6df9d9993..551764ac220 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test +++ b/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test @@ -47,7 +47,7 @@ CREATE TABLE t1 (id SERIAL, a DATETIME(3)); --connection slave --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 -eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_old_master.test b/mysql-test/suite/rpl/t/rpl_old_master.test index 6ddc227fc14..6faa8212d66 100644 --- a/mysql-test/suite/rpl/t/rpl_old_master.test +++ b/mysql-test/suite/rpl/t/rpl_old_master.test @@ -26,7 +26,7 @@ SET @old_parallel= @@GLOBAL.slave_parallel_threads; SET GLOBAL slave_parallel_threads=10; --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 -eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4; +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4, master_use_gtid=no; # Block execution yet when the blocked query timestamp has been already accounted FLUSH TABLES WITH READ LOCK; diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test index d4f185812e0..44df3ca4ea7 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator.test @@ -212,6 +212,7 @@ reset master; --source include/stop_slave.inc reset slave; reset master; +set @@global.gtid_slave_pos= ""; set @saved_slave_trans_retry_interval= @@GLOBAL.slave_transaction_retry_interval; set global slave_transaction_retry_interval=1; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_read_new_relay_log_info.test b/mysql-test/suite/rpl/t/rpl_read_new_relay_log_info.test index 1e2c8ce2d9f..350071bf3dc 100644 --- a/mysql-test/suite/rpl/t/rpl_read_new_relay_log_info.test +++ b/mysql-test/suite/rpl/t/rpl_read_new_relay_log_info.test @@ -12,7 +12,8 @@ DROP TABLE t1; --echo ==== Check that we can understand the new format of relay-log.info ==== --source include/stop_slave.inc -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --let $MYSQLD_DATADIR= `select @@datadir` # the new version of relay_log.info comes in two versions: with path @@ -20,6 +21,10 @@ RESET SLAVE; if ($SYSTEM_PATH_SEPARATOR != /) { --let $file_suffix= -win } + +# MDEV-19801 changed the default Using_Gtid to Slave_Pos which doesn't +# automatically purge relay-log.info +--remove_file $MYSQLD_DATADIR/relay-log.info --copy_file $MYSQL_TEST_DIR/std_data/new-format-relay-log$file_suffix.info $MYSQLD_DATADIR/relay-log.info --echo # Read relay-log.info diff --git a/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test b/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test index ce345445c08..d2206b5bef7 100644 --- a/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test +++ b/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test @@ -13,7 +13,8 @@ DROP TABLE t1; --echo ==== Check that we still understand the old format of relay-log.info ==== --source include/stop_slave.inc -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --let $MYSQLD_DATADIR= `select @@datadir` # the old version of relay_log.info comes in two versions: with path @@ -21,6 +22,9 @@ RESET SLAVE; if ($SYSTEM_PATH_SEPARATOR != /) { --let $file_suffix= -win } +# MDEV-19801 changed the default Using_Gtid to Slave_Pos which doesn't +# automatically purge relay-log.info +--remove_file $MYSQLD_DATADIR/relay-log.info --copy_file $MYSQL_TEST_DIR/std_data/old-format-relay-log$file_suffix.info $MYSQLD_DATADIR/relay-log.info --echo # Read relay-log.info diff --git a/mysql-test/suite/rpl/t/rpl_reset_slave_fail.test b/mysql-test/suite/rpl/t/rpl_reset_slave_fail.test index 021dc76d50c..5c7e667695c 100644 --- a/mysql-test/suite/rpl/t/rpl_reset_slave_fail.test +++ b/mysql-test/suite/rpl/t/rpl_reset_slave_fail.test @@ -67,7 +67,7 @@ START SLAVE; # Disable "Warning 1612 Being purged log ./slave-relay-bin.0* was not found" # because it is different on Unix and Windows systems. --disable_warnings -RESET SLAVE; +--source include/reset_slave.inc --enable_warnings DROP TABLE t1; --replace_result $master_exec_file MASTER_LOG_FILE $master_exec_pos MASTER_LOG_POS diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test index f66c61ffb6e..887c0961a63 100644 --- a/mysql-test/suite/rpl/t/rpl_row_001.test +++ b/mysql-test/suite/rpl/t/rpl_row_001.test @@ -14,7 +14,7 @@ connection master; RESET MASTER; connection slave; STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc connection master; let $1=5000; diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test index a249043fa19..9e10aaa6216 100644 --- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test @@ -100,7 +100,7 @@ stop slave; connection master; reset master; connection slave; -reset slave; +--source include/reset_slave.inc start slave; --source include/wait_for_slave_to_start.inc connection master; @@ -167,7 +167,7 @@ stop slave; connection master; reset master; connection slave; -reset slave; +--source include/reset_slave.inc start slave; --source include/wait_for_slave_to_start.inc connection master; @@ -230,7 +230,7 @@ stop slave; connection master; reset master; connection slave; -reset slave; +--source include/reset_slave.inc start slave; --source include/wait_for_slave_to_start.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index 478c2206a5a..d318e0d7d26 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -38,7 +38,7 @@ sync_slave_with_master; --source include/stop_slave.inc # Reset slave. -RESET SLAVE; +--source include/reset_slave.inc --replace_result $MASTER_MYPORT MASTER_MYPORT eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT; @@ -102,7 +102,7 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; --source include/stop_slave.inc -RESET SLAVE; +--source include/reset_slave.inc --source include/start_slave.inc ############################################################################## diff --git a/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test b/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test index 31a9478f632..e39b7726fe4 100644 --- a/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test +++ b/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test @@ -24,6 +24,12 @@ --source include/master-slave.inc --connection slave + +# Using_Gtid needs to start as NO before updating debug_dbug +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + --source include/stop_slave.inc SET @save_dbug= @@GLOBAL.debug_dbug; SET @@global.debug_dbug="+d,pause_sql_thread_on_fde"; diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test index 6a8493ca278..6dc2f791954 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id2.test +++ b/mysql-test/suite/rpl/t/rpl_server_id2.test @@ -2,7 +2,12 @@ # from itself, if running with --replicate-same-server-id. source include/master-slave.inc; + connection slave; +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + create table t1 (n int); reset master; # replicate ourselves diff --git a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test index 537978f1701..dbe7544bbb1 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test +++ b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test @@ -38,7 +38,7 @@ change master to IGNORE_SERVER_IDS= (10, 100); --echo *** must be 10, 100 *** let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1); echo ignore server id list: $ignore_list; -reset slave; +--source include/reset_slave.inc --echo *** must be empty due to reset slave *** let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1); echo ignore server id list: $ignore_list; @@ -80,7 +80,7 @@ if (`select $slave_relay_pos1 - $slave_relay_pos0`) stop slave; source include/wait_for_slave_to_stop.inc; -reset slave; +--source include/reset_slave.inc change master to IGNORE_SERVER_IDS= (10, 100); --echo *** the list must remain (10, 100) after reset slave *** let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1); diff --git a/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test b/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test index 324821a325f..06cf12ab7a9 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test +++ b/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test @@ -65,6 +65,7 @@ STOP REPLICA SQL_THREAD; --source include/wait_for_slave_sql_to_stop.inc --echo "Command: RESET SLAVE ALL --> RESET REPLICA ALL" RESET REPLICA ALL; +set @@global.gtid_slave_pos= ""; --connection master RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index 2ec80758486..933e7d14f9b 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -55,7 +55,7 @@ SELECT * FROM t2; STOP SLAVE; --source include/wait_for_slave_to_stop.inc -RESET SLAVE; +--source include/reset_slave.inc connection master; RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test index 83e82bf9509..ee2ff9cbfee 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test @@ -9,6 +9,11 @@ --source include/have_debug.inc --connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + +--connection slave SET @old_debug_slave= @@global.debug; stop slave; --let $gtid_strict_mode= `select @@gtid_strict_mode` diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test index 62b5c5b1cd0..3851e61868b 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_000001.test +++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test @@ -53,7 +53,7 @@ connection master; reset master; connection slave; stop slave; -reset slave; +--source include/reset_slave.inc connection master; let $1=5000; diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index c9a922e44fa..ebfd355b299 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -19,6 +19,7 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc +--let $master_use_gtid_option= No -- source include/rpl_reset.inc # Test is dependent on binlog positions @@ -127,7 +128,7 @@ source include/stop_slave.inc; --disable_warnings drop table if exists t1; --enable_warnings -reset slave; +--source include/reset_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index 17efa7ade3b..14c6641f120 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -4,6 +4,12 @@ source include/have_debug_sync.inc; source include/have_binlog_format_mixed_or_statement.inc; source include/master-slave.inc; +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--connection master + --echo --echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends --echo # diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index f692816bf82..e442ed94d5a 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -5,6 +5,12 @@ --source include/have_binlog_format_mixed_or_statement.inc --source include/have_innodb.inc --source include/master-slave.inc + +connection slave; +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + connection master; disable_query_log; @@ -329,7 +335,8 @@ let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1); # Make the slave to replay the new binlog. connection slave; -RESET SLAVE; +--let $master_use_gtid_option= No +--source include/reset_slave.inc START SLAVE; SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; @@ -362,7 +369,7 @@ DROP TABLE t1; DROP TABLE t2; STOP SLAVE; -RESET SLAVE; +--source include/reset_slave.inc # The master should be clean. @@ -498,6 +505,10 @@ connection master; --source include/rpl_reset.inc connection slave; +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc + connection master; create table t1 ( f int ) engine = innodb; diff --git a/mysql-test/suite/rpl/t/rpl_using_gtid_default.test b/mysql-test/suite/rpl/t/rpl_using_gtid_default.test new file mode 100644 index 00000000000..eab5b4dd504 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_using_gtid_default.test @@ -0,0 +1,303 @@ +# +# Purpose: +# This test ensures that a replica's default value for Using_Gtid is set +# correctly. Specifically, it should default to 'Slave_Pos' unless the primary +# server does not support GTIDs (if its version is less than 10), in which case +# the replica should fall back to 'No'. +# +# Methodology: +# Validate the value of Using_Gtid on replica initialization and after +# RESET SLAVE commands. Specifically, we validate the following use cases: +# +# Case 1) A replica will initialize with Slave_Pos if the primary supports +# GTIDs +# Case 2) A replica configured with the Using_Gtid=Slave_Pos issued +# RESET SLAVE will preserve Using_Gtid without any informational +# messages. +# Case 3) A replica configured with Using_Gtid=No against a master which +# supports GTIDs will revert to Using_Gtid=Slave_Pos after issued +# RESET SLAVE and provide an informational note +# Case 4) A fresh replica targeting a primary which does not support GTIDs +# will fall back to Using_Gtid=No when starting. An informational +# message should be logged. +# Case 5) A replica connected to a primary which does not support GTIDs +# should preserve Using_Gtid=No when issued RESET SLAVE. No message +# should be provided to the user. +# Case 6) A replica configured with Using_Gtid=Current_Pos should revert +# to Slave_Pos when issued RESET SLAVE. An informational message +# should be provided to the user. +# Case 7) The MTR include file rpl_change_topology.inc should implicitly +# set MASTER_USE_GTID=NO when provided with $rpl_master_log_file +# Case 8) The MTR include file reset_slave.inc should keep/delete GTID state +# when reset_slave_keep_gtid_state is set, respectively. +# Case 9) A replica issued CHANGE MASTER TO specified with log coordinates +# but not master_use_gtid=No should warn the user that Using_Gtid is +# being changed to No. +# Case 10) A replica issued CHANGE MASTER TO specified with log coordinates +# and master_use_gtid=Slave_Pos should warn the user that the log +# coordinates will be ignored. +# +# References: +# MDEV-19801: Change defaults for CHANGE MASTER TO so that GTID-based +# replication is used by default if master supports it +# +--source include/have_debug.inc +--source include/master-slave.inc + +# Format independent test so just use one +--source include/have_binlog_format_mixed.inc + +--echo # +--echo # Slave default configuration should be Slave_Pos +--let $expected_default_using_gtid= Slave_Pos +--connection slave +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +if ($using_gtid != $expected_default_using_gtid) +{ + --die Using_Gtid had wrong default value of '$using_gtid' when it should have been '$expected_default_using_gtid' +} + +--echo # +--echo # Ensure that a slave configured with Using_Gtid=Slave_Pos will remain +--echo # as Slave_Pos after RESET SLAVE +--source include/stop_slave.inc +RESET SLAVE; +--echo # No warning should be given because Slave_Pos never changed +SHOW WARNINGS; +--source include/start_slave.inc +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +if ($using_gtid != $expected_default_using_gtid) +{ + --die Using_Gtid has wrong value of '$using_gtid' when it should be '$expected_default_using_gtid' +} + + +--echo # +--echo # Ensure that a slave configured with Using_Gtid=No will revert to its +--echo # default of Slave_Pos after RESET SLAVE for a master which supports +--echo # GTIDs + +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; +--source include/start_slave.inc +--source include/stop_slave.inc +RESET SLAVE; +--echo # A notification that Using_Gtid was reverted should exist +SHOW WARNINGS; +--source include/start_slave.inc +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +if ($using_gtid != $expected_default_using_gtid) +{ + --die Using_Gtid has wrong value of '$using_gtid' when it should be '$expected_default_using_gtid' +} + +--echo # Clear SHOW WARNINGS +--disable_query_log +set SQL_LOG_BIN=0; +CREATE TABLE t1 (a int); +DROP TABLE t1; +set SQL_LOG_BIN=1; +--enable_query_log + + +--echo # +--echo # If the primary does not support GTIDs (version < 10), the replica +--echo # should fall back to Using_Gtid=No on slave start, and should not +--echo # revert Using_Gtid to Slave_Pos after RESET SLAVE + +--source include/stop_slave.inc +RESET SLAVE ALL; + +--replace_result $MASTER_MYPORT MASTER_MYPORT +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=1 +SET @saved_dbug= @@GLOBAL.debug_dbug; +set @@global.debug_dbug= "d,mock_mariadb_primary_v5_in_get_master_version"; +--source include/start_slave.inc + +--echo # Replica should detect at start that the primary does not support GTIDs +--echo # and fall-back to Using_Gtid=No +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +if ($using_gtid != 'No') +{ + --die Using_Gtid has wrong value of '$using_gtid' when it should be 'No' +} + +--echo # Replica should have an informational message stating it is falling +--echo # back to Using_Gtid=No +let $log_error_= `SELECT @@GLOBAL.log_error`; +if(!$log_error_) +{ + # MySQL Server on windows is started with --console and thus + # does not know the location of its .err log, use default location + let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err; +} +--let SEARCH_FILE=$log_error_ +--let SEARCH_PATTERN=Falling back to Using_Gtid=No because master does not support GTIDs +--source include/search_pattern_in_file.inc + +--source include/stop_slave.inc +RESET SLAVE; + +--echo # Replica should know that the primary does not support GTIDs and +--echo # preserve Using_Gtid=No +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +if ($using_gtid != 'No') +{ + --die Using_Gtid has wrong value of '$using_gtid' when it should be 'No' +} +--echo # 'No' was not reverted and therefore no note should be added +SHOW WARNINGS; +set @@global.debug_dbug= @saved_dbug; +--source include/start_slave.inc + + +--echo # +--echo # Ensure that a slave configured with Using_Gtid=Current_Pos will revert +--echo # to its default of Slave_Pos after RESET SLAVE. + +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=Current_Pos; +--source include/start_slave.inc +--source include/stop_slave.inc +RESET SLAVE; +--echo # A notification that Using_Gtid was reverted should exist +SHOW WARNINGS; +--source include/start_slave.inc +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +if ($using_gtid != $expected_default_using_gtid) +{ + --die Using_Gtid has wrong value of '$using_gtid' when it should be '$expected_default_using_gtid' +} + +--echo # Clear SHOW WARNINGS +--disable_query_log +set SQL_LOG_BIN=0; +CREATE TABLE t1 (a int); +DROP TABLE t1; +set SQL_LOG_BIN=1; +--enable_query_log + +--echo # The MTR include file rpl_change_topology.inc should implicitly set +--echo # MASTER_USE_GTID=NO when provided with \$rpl_master_log_file. Note that +--echo # this will switch master and slave roles. +--connection slave +--source include/stop_slave.inc +--let $pos_c= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) +--let $file_c= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1) +--let $rpl_master_log_file= 2:$file_c +--let $rpl_master_log_pos= 2:$pos_c +--let $rpl_topology= 2->1 +--source include/rpl_change_topology.inc + +--echo # connection 'master' is the slave in this comparison +--connection master +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +--echo # Validating Using_Gtid=No.. +if (`SELECT strcmp("$using_gtid","No") != 0`) +{ + --die Using_Gtid should be No when calling rpl_change_topology with \$rpl_master_log_file set +} +--echo # ..success + +--let $rpl_master_log_file= +--let $rpl_topology= 1->2 +--source include/rpl_change_topology.inc + +--echo # connection 'slave' is back to slave role +--connection slave +--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1) +--echo # Validating Using_Gtid=$expected_default_using_gtid.. +if (`SELECT strcmp("$using_gtid","$expected_default_using_gtid")!= 0`) +{ + --die Using_Gtid should be back to $expected_default_using_gtid with empty \$rpl_master_log_file +} +--echo # ..success +--source include/start_slave.inc + +--echo # +--echo # The MTR include file reset_slave.inc should keep/delete GTID state +--echo # when reset_slave_keep_gtid_state is set, respectively. +--echo # +--connection master +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc + +--echo # Tagging gtid_slave_pos before reset_slave.inc as old_slave_pos +--let $old_slave_pos= `SELECT @@gtid_slave_pos` +if (`SELECT strcmp("$old_slave_pos","") = 0`) +{ + die gtid_slave_pos is empty but should not be; +} + +--echo # Using reset_slave_keep_gtid_state=1 should preserve GTID state +--let $master_use_gtid_option=Slave_Pos +--let $reset_slave_keep_gtid_state=1 +--source include/reset_slave.inc + +--echo # Tagging gtid_slave_pos after reset_slave.inc as new_slave_pos +--let $new_slave_pos= `SELECT @@gtid_slave_pos` +--echo # Validating old_slave_pos == new_slave_pos.. +if ($old_slave_pos != $new_slave_pos) +{ + die gtid_slave_pos unexpectedly changed after running reset_slave.inc; +} +--echo # ..success + +--echo # Using reset_slave_keep_gtid_state=0 should empty GTID state +--let $master_use_gtid_option=Slave_Pos +--let $reset_slave_keep_gtid_state=0 +--source include/reset_slave.inc + +--echo # Tagging gtid_slave_pos as new_slave_pos +--let $new_slave_pos= `SELECT @@gtid_slave_pos` +--echo # Validating new_slave_pos is empty.. +if (`SELECT strcmp("$new_slave_pos","") != 0`) +{ + die gtid_slave_pos should be empty after reset_slave.inc without keeping gtid state; +} +--echo # ..success +--replace_result $old_slave_pos old_slave_pos +eval set global gtid_slave_pos="$old_slave_pos"; +--source include/start_slave.inc + +--echo # +--echo # A replica issued CHANGE MASTER TO specified with log coordinates but +--echo # not master_use_gtid=no should warn the user that Using_Gtid is being +--echo # changed to No. +--echo # +--connection slave +--let $io_log_pos= query_get_value('SHOW SLAVE STATUS', Read_Master_Log_Pos, 1) +--let $io_log_file= query_get_value('SHOW SLAVE STATUS', Master_Log_File, 1) +--source include/stop_slave.inc +--replace_result $io_log_file io_log_file $io_log_pos io_log_pos +--eval CHANGE MASTER TO master_log_pos=$io_log_pos, master_log_file='$io_log_file' +--source include/start_slave.inc + + +--echo # +--echo # A replica issued CHANGE MASTER TO specified with log coordinates and +--echo # master_use_gtid=Slave_Pos should warn the user that the log +--echo # coordinates will be ignored. +--echo # +--connection slave +--let $io_log_pos= query_get_value('SHOW SLAVE STATUS', Read_Master_Log_Pos, 1) +--let $io_log_file= query_get_value('SHOW SLAVE STATUS', Master_Log_File, 1) +--let $relay_log_pos= 4 +--let $relay_log_file= slave-relay-bin.000001 +--source include/stop_slave.inc +--replace_result $io_log_file io_log_file $io_log_pos io_log_pos +--eval CHANGE MASTER TO master_log_pos=$io_log_pos, master_log_file='$io_log_file', master_use_gtid=Slave_Pos +--replace_result $relay_log_file relay_log_file $relay_log_pos relay_log_pos +--eval CHANGE MASTER TO relay_log_pos=$relay_log_pos, relay_log_file='$relay_log_file', master_use_gtid=Slave_Pos +--source include/start_slave.inc + +--source include/rpl_end.inc + +--echo # +--echo # End of rpl_using_gtid_default.test diff --git a/mysql-test/suite/rpl/t/rpl_xa_gap_lock.test b/mysql-test/suite/rpl/t/rpl_xa_gap_lock.test index 9c48891b889..29e883a19d6 100644 --- a/mysql-test/suite/rpl/t/rpl_xa_gap_lock.test +++ b/mysql-test/suite/rpl/t/rpl_xa_gap_lock.test @@ -129,7 +129,7 @@ DROP TABLE t2, t1; # --enable_query_log #} --replace_result $master_file LOG_FILE $master_pos LOG_POS ---eval CHANGE MASTER TO MASTER_LOG_FILE='$master_file', MASTER_LOG_POS=$master_pos +--eval CHANGE MASTER TO MASTER_LOG_FILE='$master_file', MASTER_LOG_POS=$master_pos, MASTER_USE_GTID=NO SET @@GLOBAL.innodb_limit_optimistic_insert_debug = @saved_innodb_limit_optimistic_insert_debug; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test index 866041d2579..793d8bccc18 100644 --- a/mysql-test/suite/rpl/t/semisync_future-7591.test +++ b/mysql-test/suite/rpl/t/semisync_future-7591.test @@ -8,7 +8,7 @@ set global rpl_semi_sync_master_enabled = ON; --connection slave --source include/stop_slave.inc set global rpl_semi_sync_slave_enabled = ON; -change master to master_log_file='master-bin.000002', master_log_pos = 320; +change master to master_log_file='master-bin.000002', master_log_pos = 320, master_use_gtid=no; start slave; --let $slave_io_errno=1236 @@ -20,7 +20,8 @@ reset master; --connection slave --source include/stop_slave.inc -reset slave; +--let $master_use_gtid_option= No +--source include/reset_slave.inc --source include/start_slave.inc set global rpl_semi_sync_slave_enabled = OFF; diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 2283f91ba02..b4331c9efc5 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -39,12 +39,12 @@ Master_info::Master_info(LEX_CSTRING *connection_name_arg, clock_diff_with_master(0), sync_counter(0), heartbeat_period(0), received_heartbeats(0), master_id(0), prev_master_id(0), - using_gtid(USE_GTID_NO), events_queued_since_last_gtid(0), + using_gtid(USE_GTID_SLAVE_POS), events_queued_since_last_gtid(0), gtid_reconnect_event_skip_count(0), gtid_event_seen(false), in_start_all_slaves(0), in_stop_all_slaves(0), in_flush_all_relay_logs(0), users(0), killed(0), total_ddl_groups(0), total_non_trans_groups(0), total_trans_groups(0), - is_shutdown(false) + is_shutdown(false), master_supports_gtid(true) { char *tmp; host[0] = 0; user[0] = 0; password[0] = 0; @@ -211,7 +211,10 @@ void init_master_log_pos(Master_info* mi) mi->master_log_name[0] = 0; mi->master_log_pos = BIN_LOG_HEADER_SIZE; // skip magic number - mi->using_gtid= Master_info::USE_GTID_NO; + if (mi->master_supports_gtid) + { + mi->using_gtid= Master_info::USE_GTID_SLAVE_POS; + } mi->gtid_current_pos.reset(); mi->events_queued_since_last_gtid= 0; mi->gtid_reconnect_event_skip_count= 0; diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index b8135b8b55f..fa3327873c4 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -361,6 +361,13 @@ class Master_info : public Slave_reporting_capability at time its alter info struct is about to be appened to the list. */ bool is_shutdown; + + /* + A replica will default to Slave_Pos for using Using_Gtid; however, we + first need to test if the master supports GTIDs. If not, fall back to 'No'. + Cache the value so future RESET SLAVE commands don't revert to Slave_Pos. + */ + bool master_supports_gtid; }; struct start_alter_thd_args diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index e20dcec3b9f..0c05167823b 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -10074,3 +10074,7 @@ ER_INCONSISTENT_SLAVE_TEMP_TABLE eng "Replicated query '%s' table `%s.%s` can not be temporary" ER_VERS_HIST_PART_FAILED eng "Versioned table %`s.%`s: adding HISTORY partition(s) failed" +WARN_OPTION_CHANGING + eng "%s is implicitly changing the value of '%s' from '%s' to '%s'" +ER_CM_OPTION_MISSING_REQUIREMENT + eng "CHANGE MASTER TO option '%s=%s' is missing requirement %s" diff --git a/sql/slave.cc b/sql/slave.cc index 5c746271cf5..616e1248738 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1775,6 +1775,9 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi) } else { + DBUG_EXECUTE_IF("mock_mariadb_primary_v5_in_get_master_version", + version= 5;); + /* Note the following switch will bug when we have MySQL branch 30 ;) */ @@ -2358,6 +2361,14 @@ past_checksum: after_set_capability: #endif + if (!(mi->master_supports_gtid= version >= 10)) + { + sql_print_information( + "Slave I/O thread: Falling back to Using_Gtid=No because " + "master does not support GTIDs"); + mi->using_gtid= Master_info::USE_GTID_NO; + } + if (mi->using_gtid != Master_info::USE_GTID_NO) { /* Request dump to start from slave replication GTID state. */ diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 90fdce1b56f..d4a455e9034 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -3420,6 +3420,16 @@ int reset_slave(THD *thd, Master_info* mi) goto err; } + if (mi->using_gtid != Master_info::USE_GTID_SLAVE_POS && + mi->master_supports_gtid) + { + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_NOTE, WARN_OPTION_CHANGING, + ER_THD(thd, WARN_OPTION_CHANGING), "RESET SLAVE", "Using_Gtid", + mi->using_gtid_astext(mi->using_gtid), + mi->using_gtid_astext(Master_info::USE_GTID_SLAVE_POS)); + } + /* Clear master's log coordinates and associated information */ mi->clear_in_memory_info(thd->lex->reset_slave_info.all); @@ -3816,7 +3826,41 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added) else if (lex_mi->use_gtid_opt == LEX_MASTER_INFO::LEX_GTID_NO || lex_mi->log_file_name || lex_mi->pos || lex_mi->relay_log_name || lex_mi->relay_log_pos) + { + if (lex_mi->use_gtid_opt != LEX_MASTER_INFO::LEX_GTID_NO) + { + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_NOTE, WARN_OPTION_CHANGING, + ER_THD(thd, WARN_OPTION_CHANGING), "CHANGE MASTER TO", "Using_Gtid", + mi->using_gtid_astext(mi->using_gtid), + mi->using_gtid_astext(Master_info::USE_GTID_NO)); + } mi->using_gtid= Master_info::USE_GTID_NO; + } + + /* + Warn about ignored options if there are GTID/log coordinate option + conflicts + */ + if (mi->using_gtid != Master_info::USE_GTID_NO) + { + if (lex_mi->log_file_name) + push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, + WARN_OPTION_IGNORED, + ER_THD(thd, WARN_OPTION_IGNORED), "MASTER_LOG_FILE"); + if (lex_mi->pos) + push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, + WARN_OPTION_IGNORED, + ER_THD(thd, WARN_OPTION_IGNORED), "MASTER_LOG_POS"); + if (lex_mi->relay_log_name) + push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, + WARN_OPTION_IGNORED, + ER_THD(thd, WARN_OPTION_IGNORED), "RELAY_LOG_FILE"); + if (lex_mi->relay_log_pos) + push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, + WARN_OPTION_IGNORED, + ER_THD(thd, WARN_OPTION_IGNORED), "RELAY_LOG_POS"); + } do_ids= ((lex_mi->repl_do_domain_ids_opt == LEX_MASTER_INFO::LEX_MI_ENABLE) ? |