summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-05-28 15:39:56 +0200
committerunknown <knielsen@knielsen-hq.org>2013-05-28 15:39:56 +0200
commita0fd7382bc1e4a8ba0affd27d3034f445a4bb453 (patch)
treec8b4b1dabddbc47829a890d74025f7889e692425 /mysql-test
parent08ce9bfe057b6cd31e7fbca4e4e9e48edde242fb (diff)
parentee2b7db3f88f6882022a8aa71b30043ed8b40792 (diff)
downloadmariadb-git-a0fd7382bc1e4a8ba0affd27d3034f445a4bb453.tar.gz
Merge 10.0-base -> 10.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/check-testcase.test2
-rw-r--r--mysql-test/include/mtr_check.sql2
-rw-r--r--mysql-test/include/rpl_init.inc1
-rw-r--r--mysql-test/r/1st.result2
-rw-r--r--mysql-test/r/connect.result6
-rw-r--r--mysql-test/r/information_schema.result2
-rw-r--r--mysql-test/r/log_tables_upgrade.result2
-rw-r--r--mysql-test/r/myisam.result4
-rw-r--r--mysql-test/r/mysql_upgrade.result14
-rw-r--r--mysql-test/r/mysql_upgrade_ssl.result2
-rw-r--r--mysql-test/r/mysqlcheck.result8
-rw-r--r--mysql-test/r/mysqld--help.result7
-rw-r--r--mysql-test/r/mysqldump-max.result8
-rw-r--r--mysql-test/r/repair.result4
-rw-r--r--mysql-test/r/stat_tables_rbr.result24
-rw-r--r--mysql-test/r/system_mysql_db.result2
-rw-r--r--mysql-test/r/system_mysql_db_fix40123.result2
-rw-r--r--mysql-test/r/system_mysql_db_fix50030.result2
-rw-r--r--mysql-test/r/system_mysql_db_fix50117.result2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test24
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result16
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result16
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result46
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result92
-rw-r--r--mysql-test/suite/innodb/r/binlog_consistent.result68
-rw-r--r--mysql-test/suite/innodb/r/group_commit_binlog_pos.result2
-rw-r--r--mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result2
-rw-r--r--mysql-test/suite/maria/maria.result62
-rw-r--r--mysql-test/suite/maria/maria.test46
-rw-r--r--mysql-test/suite/maria/maria3.result2
-rw-r--r--mysql-test/suite/multi_source/gtid.result18
-rw-r--r--mysql-test/suite/multi_source/gtid.test6
-rw-r--r--mysql-test/suite/multi_source/info_logs.result12
-rw-r--r--mysql-test/suite/multi_source/multisource.result68
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.result12
-rw-r--r--mysql-test/suite/multi_source/reset_master_slave.inc2
-rw-r--r--mysql-test/suite/multi_source/reset_slave.result4
-rw-r--r--mysql-test/suite/multi_source/simple.result30
-rw-r--r--mysql-test/suite/multi_source/syntax.result2
-rw-r--r--mysql-test/suite/perfschema/r/digest_table_full.result2
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest.result44
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_consumers.result44
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_long_query.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_basic.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result53
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_master_promote.result367
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result63
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_startpos.result69
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_stop_start.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_strict.result182
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_until.result225
-rw-r--r--mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result87
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_basic.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_crash.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test47
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_master_promote.cnf35
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_master_promote.test267
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4474.cnf11
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test76
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_startpos.test61
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_stop_start.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_strict.test178
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_until.test234
-rw-r--r--mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test2
-rw-r--r--mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_pos_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result29
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_pos_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test4
-rw-r--r--mysql-test/t/myisam.test2
-rw-r--r--mysql-test/t/repair.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix40123.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix50030.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix50117.test2
96 files changed, 2521 insertions, 619 deletions
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 75fd3347e81..c7a9bba0a66 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 0
+ --echo Using_Gtid No
}
if (!$tmp) {
# Note: after WL#5177, fields 13-18 shall not be filtered-out.
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index c66a7fea938..467a3f973c7 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -31,7 +31,7 @@ BEGIN
AND variable_name not like "Last_IO_Err*"
AND variable_name != 'INNODB_IBUF_MAX_SIZE'
AND variable_name != 'INNODB_USE_NATIVE_AIO'
- AND variable_name != 'GTID_POS'
+ AND variable_name not like 'GTID%POS'
ORDER BY variable_name;
-- Dump all databases, there should be none
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
index e608a1223a5..dbe93adbec3 100644
--- a/mysql-test/include/rpl_init.inc
+++ b/mysql-test/include/rpl_init.inc
@@ -177,6 +177,7 @@ while ($_rpl_server)
if (!$rpl_skip_reset_master_and_slave)
{
RESET MASTER;
+ SET GLOBAL gtid_slave_pos= "";
RESET SLAVE;
}
eval SET auto_increment_increment= $rpl_server_count;
diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result
index 36500302579..7e4ab09b09d 100644
--- a/mysql-test/r/1st.result
+++ b/mysql-test/r/1st.result
@@ -13,6 +13,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -26,7 +27,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 94c68324149..3fcc5b5d2c1 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -7,6 +7,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -20,7 +21,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
@@ -50,6 +50,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -63,7 +64,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
@@ -101,6 +101,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -114,7 +115,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 8e1d4856645..ce962a96f29 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -88,6 +88,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -98,7 +99,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slow_log
t1
diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result
index 5afe4cf6ec2..5732b94a90c 100644
--- a/mysql-test/r/log_tables_upgrade.result
+++ b/mysql-test/r/log_tables_upgrade.result
@@ -24,6 +24,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -38,7 +39,6 @@ mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.renamed_general_log OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 2530182ea67..267110be487 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -2355,7 +2355,7 @@ Warnings:
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4'
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair error myisam_sort_buffer_size is too small
+test.t1 repair error myisam_sort_buffer_size is too small. X
test.t1 repair warning Number of rows changed from 0 to 7168
test.t1 repair status OK
SET myisam_repair_threads=2;
@@ -2424,7 +2424,7 @@ INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0');
Warnings:
-Error 1034 myisam_sort_buffer_size is too small
+Error 1034 myisam_sort_buffer_size is too small. X
Error 1034 Number of rows changed from 0 to 157
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
INSERT INTO t1 VALUES('1');
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 25065ffae30..3921d6c9627 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -12,6 +12,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -25,7 +26,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -58,6 +58,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -71,7 +72,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -104,6 +104,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -117,7 +118,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -153,6 +153,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -166,7 +167,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -205,6 +205,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -218,7 +219,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -260,6 +260,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -273,7 +274,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -318,6 +318,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -331,7 +332,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result
index 166dd428da1..60bf427cef6 100644
--- a/mysql-test/r/mysql_upgrade_ssl.result
+++ b/mysql-test/r/mysql_upgrade_ssl.result
@@ -14,6 +14,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -27,7 +28,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 4d2657bdfb6..17dc9ad9a35 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -8,6 +8,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -21,7 +22,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -41,6 +41,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -58,7 +59,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -76,6 +76,7 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
+mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -89,7 +90,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
-mysql.rpl_slave_state OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
@@ -107,6 +107,7 @@ mysql.columns_priv Table is already up to date
mysql.db Table is already up to date
mysql.event Table is already up to date
mysql.func Table is already up to date
+mysql.gtid_slave_pos Table is already up to date
mysql.help_category Table is already up to date
mysql.help_keyword Table is already up to date
mysql.help_relation Table is already up to date
@@ -124,7 +125,6 @@ mysql.plugin Table is already up to date
mysql.proc Table is already up to date
mysql.procs_priv Table is already up to date
mysql.proxies_priv Table is already up to date
-mysql.rpl_slave_state Table is already up to date
mysql.servers Table is already up to date
mysql.slave_master_info Table is already up to date
mysql.slave_relay_log_info Table is already up to date
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index d7074d140b3..51dfc3123a4 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -205,6 +205,10 @@ The following options may be given as the first argument:
multiple masters), each independent source server must
use a distinct domain_id. For simple tree-shaped
replication topologies, it can be left at its default, 0.
+ --gtid-strict-mode Enforce strict seq_no ordering of events in the binary
+ log. Slave stops with an error if it encounters an event
+ that would cause it to generate an out-of-order binlog if
+ executed.
-?, --help Display this help and exit.
--histogram-size=# Number of bytes used for a histogram. If set to 0, no
histograms are created by ANALYZE.
@@ -1039,6 +1043,7 @@ gdb FALSE
general-log FALSE
group-concat-max-len 1024
gtid-domain-id 0
+gtid-strict-mode FALSE
help TRUE
histogram-size 0
histogram-type SINGLE_PREC_HB
@@ -1118,7 +1123,7 @@ myisam-max-sort-file-size 9223372036853727232
myisam-mmap-size 18446744073709551615
myisam-recover-options DEFAULT
myisam-repair-threads 1
-myisam-sort-buffer-size 8388608
+myisam-sort-buffer-size 134216704
myisam-stats-method nulls_unequal
myisam-use-mmap FALSE
net-buffer-length 16384
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index 2164b513335..8d5ab551bee 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -334,10 +334,10 @@ DROP TABLE t1;
DROP TABLE t2;
SHOW BINLOG EVENTS LIMIT 7,3;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 591 Xid 1 618 COMMIT /* XID */
-master-bin.000001 618 Gtid 1 656 GTID 0-1-3
-master-bin.000001 656 Query 1 775 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
--- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=937;
+master-bin.000001 593 Xid 1 620 COMMIT /* XID */
+master-bin.000001 620 Gtid 1 658 GTID 0-1-3
+master-bin.000001 658 Query 1 777 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=939;
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index 1a98f2f0f36..241c32b4b40 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -77,12 +77,12 @@ INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0');
Warnings:
-Error 1034 myisam_sort_buffer_size is too small
+Error 1034 myisam_sort_buffer_size is too small. X
Error 1034 Number of rows changed from 0 to 157
SET myisam_repair_threads=2;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair error myisam_sort_buffer_size is too small
+test.t1 repair error myisam_sort_buffer_size is too small. X
test.t1 repair warning Number of rows changed from 0 to 157
test.t1 repair status OK
SET myisam_repair_threads=@@global.myisam_repair_threads;
diff --git a/mysql-test/r/stat_tables_rbr.result b/mysql-test/r/stat_tables_rbr.result
index 27c326265f1..0c941bcb248 100644
--- a/mysql-test/r/stat_tables_rbr.result
+++ b/mysql-test/r/stat_tables_rbr.result
@@ -16,17 +16,17 @@ test.t1 analyze status OK
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: #
-master-bin.000001 248 Gtid_list 1 271 []
-master-bin.000001 271 Binlog_checkpoint 1 311 master-bin.000001
-master-bin.000001 311 Gtid 1 349 GTID 0-1-1
-master-bin.000001 349 Query 1 449 use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB
-master-bin.000001 449 Gtid 1 487 GTID 0-1-2
-master-bin.000001 487 Query 1 566 use `test`; ANALYZE TABLE t1
-master-bin.000001 566 Gtid 1 604 GTID 0-1-3
-master-bin.000001 604 Query 1 708 use `test`; DROP TABLE `t1` /* generated by server */
-master-bin.000001 708 Gtid 1 746 GTID 0-1-4
-master-bin.000001 746 Query 1 882 use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
-master-bin.000001 882 Gtid 1 920 GTID 0-1-5
-master-bin.000001 920 Query 1 1018 use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
+master-bin.000001 248 Gtid_list 1 273 []
+master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001
+master-bin.000001 313 Gtid 1 351 GTID 0-1-1
+master-bin.000001 351 Query 1 451 use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB
+master-bin.000001 451 Gtid 1 489 GTID 0-1-2
+master-bin.000001 489 Query 1 568 use `test`; ANALYZE TABLE t1
+master-bin.000001 568 Gtid 1 606 GTID 0-1-3
+master-bin.000001 606 Query 1 710 use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001 710 Gtid 1 748 GTID 0-1-4
+master-bin.000001 748 Query 1 884 use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
+master-bin.000001 884 Gtid 1 922 GTID 0-1-5
+master-bin.000001 922 Query 1 1020 use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
SET use_stat_tables = DEFAULT;
DROP TABLE t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index f481f981aba..08c17b1afd5 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -6,6 +6,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -19,7 +20,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
diff --git a/mysql-test/r/system_mysql_db_fix40123.result b/mysql-test/r/system_mysql_db_fix40123.result
index 7ccc3d40746..2f76ee654c8 100644
--- a/mysql-test/r/system_mysql_db_fix40123.result
+++ b/mysql-test/r/system_mysql_db_fix40123.result
@@ -6,6 +6,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -19,7 +20,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
diff --git a/mysql-test/r/system_mysql_db_fix50030.result b/mysql-test/r/system_mysql_db_fix50030.result
index 7ccc3d40746..2f76ee654c8 100644
--- a/mysql-test/r/system_mysql_db_fix50030.result
+++ b/mysql-test/r/system_mysql_db_fix50030.result
@@ -6,6 +6,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -19,7 +20,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
diff --git a/mysql-test/r/system_mysql_db_fix50117.result b/mysql-test/r/system_mysql_db_fix50117.result
index 7ccc3d40746..2f76ee654c8 100644
--- a/mysql-test/r/system_mysql_db_fix50117.result
+++ b/mysql-test/r/system_mysql_db_fix50117.result
@@ -6,6 +6,7 @@ db
event
func
general_log
+gtid_slave_pos
help_category
help_keyword
help_relation
@@ -19,7 +20,6 @@ plugin
proc
procs_priv
proxies_priv
-rpl_slave_state
servers
slave_master_info
slave_relay_log_info
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
index 0289ef6161b..367314d9643 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
@@ -54,18 +54,18 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
-let $start_pos= `select @binlog_start_pos + 694`;
+let $start_pos= `select @binlog_start_pos + 696`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
-let $stop_pos= `select @binlog_start_pos + 694`;
+let $stop_pos= `select @binlog_start_pos + 696`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
-let $start_pos= `select @binlog_start_pos + 694`;
-let $stop_pos= `select @binlog_start_pos + 855`;
+let $start_pos= `select @binlog_start_pos + 696`;
+let $stop_pos= `select @binlog_start_pos + 857`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
@@ -92,12 +92,12 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
-let $start_pos= `select @binlog_start_pos + 694`;
+let $start_pos= `select @binlog_start_pos + 696`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
-let $stop_pos= `select @binlog_start_pos + 132`;
+let $stop_pos= `select @binlog_start_pos + 134`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
@@ -121,18 +121,18 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
-let $start_pos= `select @binlog_start_pos + 694`;
+let $start_pos= `select @binlog_start_pos + 696`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
-let $stop_pos= `select @binlog_start_pos + 694`;
+let $stop_pos= `select @binlog_start_pos + 696`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
-let $start_pos= `select @binlog_start_pos + 694`;
-let $stop_pos= `select @binlog_start_pos + 810`;
+let $start_pos= `select @binlog_start_pos + 696`;
+let $stop_pos= `select @binlog_start_pos + 812`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
@@ -156,12 +156,12 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
-let $start_pos= `select @binlog_start_pos + 694`;
+let $start_pos= `select @binlog_start_pos + 696`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
-let $stop_pos= `select @binlog_start_pos + 107`;
+let $stop_pos= `select @binlog_start_pos + 109`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index e8782890e0c..c49312e4a53 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -74,6 +74,10 @@ def mysql general_log event_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL N
def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
def mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
+def mysql gtid_slave_pos domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql gtid_slave_pos seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql gtid_slave_pos server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references
def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI select,insert,update,references
def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references
@@ -157,10 +161,6 @@ def mysql proxies_priv Proxied_user 4 NO char 16 48 NULL NULL NULL utf8 utf8_bi
def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql proxies_priv User 2 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references
-def mysql rpl_slave_state domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references
-def mysql rpl_slave_state seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
-def mysql rpl_slave_state server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
-def mysql rpl_slave_state sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references
def mysql servers Db 3 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
def mysql servers Host 2 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
def mysql servers Owner 9 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
@@ -438,6 +438,10 @@ NULL mysql general_log thread_id int NULL NULL NULL NULL int(11)
NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned
3.0000 mysql general_log command_type varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 mysql general_log argument mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
+NULL mysql gtid_slave_pos domain_id int NULL NULL NULL NULL int(10) unsigned
+NULL mysql gtid_slave_pos sub_id bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql gtid_slave_pos server_id int NULL NULL NULL NULL int(10) unsigned
+NULL mysql gtid_slave_pos seq_no bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64)
NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
@@ -521,10 +525,6 @@ NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
NULL mysql proxies_priv With_grant tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql proxies_priv Grantor char 77 231 utf8 utf8_bin char(77)
NULL mysql proxies_priv Timestamp timestamp NULL NULL NULL NULL timestamp
-NULL mysql rpl_slave_state domain_id int NULL NULL NULL NULL int(10) unsigned
-NULL mysql rpl_slave_state sub_id bigint NULL NULL NULL NULL bigint(20) unsigned
-NULL mysql rpl_slave_state server_id int NULL NULL NULL NULL int(10) unsigned
-NULL mysql rpl_slave_state seq_no bigint NULL NULL NULL NULL bigint(20) unsigned
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
index c3d718ea7d6..1b3bb575b61 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
@@ -74,6 +74,10 @@ def mysql general_log event_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL N
def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned
def mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext
+def mysql gtid_slave_pos domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI
+def mysql gtid_slave_pos seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned
+def mysql gtid_slave_pos server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned
+def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI
def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI
def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI
def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned
@@ -157,10 +161,6 @@ def mysql proxies_priv Proxied_user 4 NO char 16 48 NULL NULL NULL utf8 utf8_bi
def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql proxies_priv User 2 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI
def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1)
-def mysql rpl_slave_state domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI
-def mysql rpl_slave_state seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned
-def mysql rpl_slave_state server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned
-def mysql rpl_slave_state sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI
def mysql servers Db 3 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64)
def mysql servers Host 2 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64)
def mysql servers Owner 9 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64)
@@ -438,6 +438,10 @@ NULL mysql general_log thread_id int NULL NULL NULL NULL int(11)
NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned
3.0000 mysql general_log command_type varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 mysql general_log argument mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
+NULL mysql gtid_slave_pos domain_id int NULL NULL NULL NULL int(10) unsigned
+NULL mysql gtid_slave_pos sub_id bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql gtid_slave_pos server_id int NULL NULL NULL NULL int(10) unsigned
+NULL mysql gtid_slave_pos seq_no bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64)
NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
@@ -521,10 +525,6 @@ NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
NULL mysql proxies_priv With_grant tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql proxies_priv Grantor char 77 231 utf8 utf8_bin char(77)
NULL mysql proxies_priv Timestamp timestamp NULL NULL NULL NULL timestamp
-NULL mysql rpl_slave_state domain_id int NULL NULL NULL NULL int(10) unsigned
-NULL mysql rpl_slave_state sub_id bigint NULL NULL NULL NULL bigint(20) unsigned
-NULL mysql rpl_slave_state server_id int NULL NULL NULL NULL int(10) unsigned
-NULL mysql rpl_slave_state seq_no bigint NULL NULL NULL NULL bigint(20) unsigned
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
index 5ed4ddf9dd1..66967267202 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
@@ -89,6 +89,8 @@ def mysql PRIMARY def mysql db User
def mysql PRIMARY def mysql event db
def mysql PRIMARY def mysql event name
def mysql PRIMARY def mysql func name
+def mysql PRIMARY def mysql gtid_slave_pos domain_id
+def mysql PRIMARY def mysql gtid_slave_pos sub_id
def mysql PRIMARY def mysql help_category help_category_id
def mysql name def mysql help_category name
def mysql PRIMARY def mysql help_keyword help_keyword_id
@@ -125,8 +127,6 @@ def mysql PRIMARY def mysql proxies_priv Host
def mysql PRIMARY def mysql proxies_priv User
def mysql PRIMARY def mysql proxies_priv Proxied_host
def mysql PRIMARY def mysql proxies_priv Proxied_user
-def mysql PRIMARY def mysql rpl_slave_state domain_id
-def mysql PRIMARY def mysql rpl_slave_state sub_id
def mysql PRIMARY def mysql servers Server_name
def mysql PRIMARY def mysql slave_master_info Master_id
def mysql PRIMARY def mysql slave_relay_log_info Master_id
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index bd3f9992391..73407fa0a5a 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -100,6 +100,8 @@ def mysql db mysql User
def mysql event mysql PRIMARY
def mysql event mysql PRIMARY
def mysql func mysql PRIMARY
+def mysql gtid_slave_pos mysql PRIMARY
+def mysql gtid_slave_pos mysql PRIMARY
def mysql help_category mysql PRIMARY
def mysql help_category mysql name
def mysql help_keyword mysql PRIMARY
@@ -130,8 +132,6 @@ def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql Grantor
-def mysql rpl_slave_state mysql PRIMARY
-def mysql rpl_slave_state mysql PRIMARY
def mysql servers mysql PRIMARY
def mysql slave_master_info mysql PRIMARY
def mysql slave_relay_log_info mysql PRIMARY
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
index 02a2a24639a..1bee7c44cb1 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
@@ -22,6 +22,8 @@ def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql gtid_slave_pos 0 mysql PRIMARY 1 domain_id A #CARD# NULL NULL BTREE
+def mysql gtid_slave_pos 0 mysql PRIMARY 2 sub_id A #CARD# NULL NULL BTREE
def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
@@ -58,8 +60,6 @@ def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
-def mysql rpl_slave_state 0 mysql PRIMARY 1 domain_id A #CARD# NULL NULL BTREE
-def mysql rpl_slave_state 0 mysql PRIMARY 2 sub_id A #CARD# NULL NULL BTREE
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
def mysql slave_master_info 0 mysql PRIMARY 1 Master_id A #CARD# NULL NULL BTREE
def mysql slave_relay_log_info 0 mysql PRIMARY 1 Master_id A #CARD# NULL NULL BTREE
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
index 57fb22e7aaf..3414581e969 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
@@ -22,6 +22,8 @@ def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql gtid_slave_pos 0 mysql PRIMARY 1 domain_id A #CARD# NULL NULL BTREE
+def mysql gtid_slave_pos 0 mysql PRIMARY 2 sub_id A #CARD# NULL NULL BTREE
def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
@@ -58,8 +60,6 @@ def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
-def mysql rpl_slave_state 0 mysql PRIMARY 1 domain_id A #CARD# NULL NULL BTREE
-def mysql rpl_slave_state 0 mysql PRIMARY 2 sub_id A #CARD# NULL NULL BTREE
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
def mysql slave_master_info 0 mysql PRIMARY 1 Master_id A #CARD# NULL NULL BTREE
def mysql slave_relay_log_info 0 mysql PRIMARY 1 Master_id A #CARD# NULL NULL BTREE
@@ -101,6 +101,8 @@ def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql gtid_slave_pos 0 mysql PRIMARY 1 domain_id A #CARD# NULL NULL BTREE
+def mysql gtid_slave_pos 0 mysql PRIMARY 2 sub_id A #CARD# NULL NULL BTREE
def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
@@ -137,8 +139,6 @@ def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
-def mysql rpl_slave_state 0 mysql PRIMARY 1 domain_id A #CARD# NULL NULL BTREE
-def mysql rpl_slave_state 0 mysql PRIMARY 2 sub_id A #CARD# NULL NULL BTREE
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
def mysql slave_master_info 0 mysql PRIMARY 1 Master_id A #CARD# NULL NULL BTREE
def mysql slave_relay_log_info 0 mysql PRIMARY 1 Master_id A #CARD# NULL NULL BTREE
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index d51d2f08853..fb62c16ec1e 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -62,6 +62,7 @@ def mysql PRIMARY mysql columns_priv
def mysql PRIMARY mysql db
def mysql PRIMARY mysql event
def mysql PRIMARY mysql func
+def mysql PRIMARY mysql gtid_slave_pos
def mysql PRIMARY mysql help_category
def mysql name mysql help_category
def mysql PRIMARY mysql help_keyword
@@ -79,7 +80,6 @@ def mysql PRIMARY mysql plugin
def mysql PRIMARY mysql proc
def mysql PRIMARY mysql procs_priv
def mysql PRIMARY mysql proxies_priv
-def mysql PRIMARY mysql rpl_slave_state
def mysql PRIMARY mysql servers
def mysql PRIMARY mysql slave_master_info
def mysql PRIMARY mysql slave_relay_log_info
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
index bc1f43a6749..4a51fe66f1f 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
@@ -12,6 +12,7 @@ def mysql PRIMARY mysql column_stats PRIMARY KEY
def mysql PRIMARY mysql db PRIMARY KEY
def mysql PRIMARY mysql event PRIMARY KEY
def mysql PRIMARY mysql func PRIMARY KEY
+def mysql PRIMARY mysql gtid_slave_pos PRIMARY KEY
def mysql name mysql help_category UNIQUE
def mysql PRIMARY mysql help_category PRIMARY KEY
def mysql name mysql help_keyword UNIQUE
@@ -29,7 +30,6 @@ def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
def mysql PRIMARY mysql proxies_priv PRIMARY KEY
-def mysql PRIMARY mysql rpl_slave_state PRIMARY KEY
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql slave_master_info PRIMARY KEY
def mysql PRIMARY mysql slave_relay_log_info PRIMARY KEY
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
index 688379ee090..0e1076f5b41 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
@@ -12,6 +12,7 @@ def mysql PRIMARY mysql column_stats PRIMARY KEY
def mysql PRIMARY mysql db PRIMARY KEY
def mysql PRIMARY mysql event PRIMARY KEY
def mysql PRIMARY mysql func PRIMARY KEY
+def mysql PRIMARY mysql gtid_slave_pos PRIMARY KEY
def mysql name mysql help_category UNIQUE
def mysql PRIMARY mysql help_category PRIMARY KEY
def mysql name mysql help_keyword UNIQUE
@@ -29,7 +30,6 @@ def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
def mysql PRIMARY mysql proxies_priv PRIMARY KEY
-def mysql PRIMARY mysql rpl_slave_state PRIMARY KEY
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql slave_master_info PRIMARY KEY
def mysql PRIMARY mysql slave_relay_log_info PRIMARY KEY
@@ -52,6 +52,7 @@ def mysql PRIMARY mysql column_stats PRIMARY KEY
def mysql PRIMARY mysql db PRIMARY KEY
def mysql PRIMARY mysql event PRIMARY KEY
def mysql PRIMARY mysql func PRIMARY KEY
+def mysql PRIMARY mysql gtid_slave_pos PRIMARY KEY
def mysql name mysql help_category UNIQUE
def mysql PRIMARY mysql help_category PRIMARY KEY
def mysql name mysql help_keyword UNIQUE
@@ -69,7 +70,6 @@ def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
def mysql PRIMARY mysql proxies_priv PRIMARY KEY
-def mysql PRIMARY mysql rpl_slave_state PRIMARY KEY
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql slave_master_info PRIMARY KEY
def mysql PRIMARY mysql slave_relay_log_info PRIMARY KEY
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index b9a72214905..39102037a40 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -152,6 +152,29 @@ user_comment General log
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME gtid_slave_pos
+TABLE_TYPE BASE TABLE
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION latin1_swedish_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment Replication slave GTID state
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME help_category
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -451,29 +474,6 @@ user_comment User proxy privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
-TABLE_NAME rpl_slave_state
-TABLE_TYPE BASE TABLE
-ENGINE MYISAM_OR_MARIA
-VERSION 10
-ROW_FORMAT Fixed
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment Replication slave GTID state
-Separator -----------------------------------------------------
-TABLE_CATALOG def
-TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index b14abceea1b..40508c02abe 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -152,6 +152,29 @@ user_comment General log
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME gtid_slave_pos
+TABLE_TYPE BASE TABLE
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION latin1_swedish_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment Replication slave GTID state
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME help_category
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -451,29 +474,6 @@ user_comment User proxy privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
-TABLE_NAME rpl_slave_state
-TABLE_TYPE BASE TABLE
-ENGINE MYISAM_OR_MARIA
-VERSION 10
-ROW_FORMAT Fixed
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment Replication slave GTID state
-Separator -----------------------------------------------------
-TABLE_CATALOG def
-TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -927,6 +927,29 @@ user_comment General log
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME gtid_slave_pos
+TABLE_TYPE BASE TABLE
+ENGINE MYISAM_OR_MARIA
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION latin1_swedish_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment Replication slave GTID state
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME help_category
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -1226,29 +1249,6 @@ user_comment User proxy privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
-TABLE_NAME rpl_slave_state
-TABLE_TYPE BASE TABLE
-ENGINE MYISAM_OR_MARIA
-VERSION 10
-ROW_FORMAT Fixed
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment Replication slave GTID state
-Separator -----------------------------------------------------
-TABLE_CATALOG def
-TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result
index aabdefa5ee3..edfa5947eb8 100644
--- a/mysql-test/suite/innodb/r/binlog_consistent.result
+++ b/mysql-test/suite/innodb/r/binlog_consistent.result
@@ -3,11 +3,11 @@ RESET MASTER;
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 484
+master-bin.000001 486
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
-Binlog_snapshot_position 484
+Binlog_snapshot_position 486
BEGIN;
INSERT INTO t1 VALUES (0, "");
# Connection con1
@@ -38,10 +38,10 @@ a b
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
-Binlog_snapshot_position 986
+Binlog_snapshot_position 988
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 1338
+master-bin.000001 1340
SELECT * FROM t2 ORDER BY a;
a
2
@@ -60,7 +60,7 @@ a b
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
-Binlog_snapshot_position 986
+Binlog_snapshot_position 988
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 367
@@ -75,33 +75,33 @@ master-bin.000002 367
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: #
-master-bin.000001 248 Gtid_list 1 271 []
-master-bin.000001 271 Binlog_checkpoint 1 311 master-bin.000001
-master-bin.000001 311 Gtid 1 349 GTID 0-1-1
-master-bin.000001 349 Query 1 484 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
-master-bin.000001 484 Gtid 1 522 GTID 0-1-2
-master-bin.000001 522 Query 1 634 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
-master-bin.000001 634 Gtid 1 672 BEGIN GTID 0-1-3
-master-bin.000001 672 Query 1 760 use `test`; INSERT INTO t2 VALUES (2)
-master-bin.000001 760 Query 1 829 COMMIT
-master-bin.000001 829 Gtid 1 867 BEGIN GTID 0-1-4
-master-bin.000001 867 Query 1 959 use `test`; INSERT INTO t1 VALUES (0, "")
-master-bin.000001 959 Xid 1 986 COMMIT /* XID */
-master-bin.000001 986 Gtid 1 1024 BEGIN GTID 0-1-5
-master-bin.000001 1024 Query 1 1112 use `test`; INSERT INTO t2 VALUES (3)
-master-bin.000001 1112 Query 1 1181 COMMIT
-master-bin.000001 1181 Gtid 1 1219 BEGIN GTID 0-1-6
-master-bin.000001 1219 Query 1 1311 use `test`; INSERT INTO t1 VALUES (4, "")
-master-bin.000001 1311 Xid 1 1338 COMMIT /* XID */
-master-bin.000001 1338 Gtid 1 1376 BEGIN GTID 0-1-7
-master-bin.000001 1376 Query 1 1468 use `test`; INSERT INTO t1 VALUES (1, "")
-master-bin.000001 1468 Xid 1 1495 COMMIT /* XID */
-master-bin.000001 1495 Gtid 1 1533 BEGIN GTID 0-1-8
-master-bin.000001 1533 Query 1 1630 use `test`; INSERT INTO t1 VALUES (2, "first")
-master-bin.000001 1630 Query 1 1728 use `test`; INSERT INTO t1 VALUES (2, "second")
-master-bin.000001 1728 Xid 1 1755 COMMIT /* XID */
-master-bin.000001 1755 Gtid 1 1793 BEGIN GTID 0-1-9
-master-bin.000001 1793 Query 1 1885 use `test`; INSERT INTO t1 VALUES (3, "")
-master-bin.000001 1885 Xid 1 1912 COMMIT /* XID */
-master-bin.000001 1912 Rotate 1 1956 master-bin.000002;pos=4
+master-bin.000001 248 Gtid_list 1 273 []
+master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001
+master-bin.000001 313 Gtid 1 351 GTID 0-1-1
+master-bin.000001 351 Query 1 486 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
+master-bin.000001 486 Gtid 1 524 GTID 0-1-2
+master-bin.000001 524 Query 1 636 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
+master-bin.000001 636 Gtid 1 674 BEGIN GTID 0-1-3
+master-bin.000001 674 Query 1 762 use `test`; INSERT INTO t2 VALUES (2)
+master-bin.000001 762 Query 1 831 COMMIT
+master-bin.000001 831 Gtid 1 869 BEGIN GTID 0-1-4
+master-bin.000001 869 Query 1 961 use `test`; INSERT INTO t1 VALUES (0, "")
+master-bin.000001 961 Xid 1 988 COMMIT /* XID */
+master-bin.000001 988 Gtid 1 1026 BEGIN GTID 0-1-5
+master-bin.000001 1026 Query 1 1114 use `test`; INSERT INTO t2 VALUES (3)
+master-bin.000001 1114 Query 1 1183 COMMIT
+master-bin.000001 1183 Gtid 1 1221 BEGIN GTID 0-1-6
+master-bin.000001 1221 Query 1 1313 use `test`; INSERT INTO t1 VALUES (4, "")
+master-bin.000001 1313 Xid 1 1340 COMMIT /* XID */
+master-bin.000001 1340 Gtid 1 1378 BEGIN GTID 0-1-7
+master-bin.000001 1378 Query 1 1470 use `test`; INSERT INTO t1 VALUES (1, "")
+master-bin.000001 1470 Xid 1 1497 COMMIT /* XID */
+master-bin.000001 1497 Gtid 1 1535 BEGIN GTID 0-1-8
+master-bin.000001 1535 Query 1 1632 use `test`; INSERT INTO t1 VALUES (2, "first")
+master-bin.000001 1632 Query 1 1730 use `test`; INSERT INTO t1 VALUES (2, "second")
+master-bin.000001 1730 Xid 1 1757 COMMIT /* XID */
+master-bin.000001 1757 Gtid 1 1795 BEGIN GTID 0-1-9
+master-bin.000001 1795 Query 1 1887 use `test`; INSERT INTO t1 VALUES (3, "")
+master-bin.000001 1887 Xid 1 1914 COMMIT /* XID */
+master-bin.000001 1914 Rotate 1 1958 master-bin.000002;pos=4
DROP TABLE t1,t2;
diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
index 26a636c02ef..c8b80a037a7 100644
--- a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
+++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
@@ -31,6 +31,6 @@ a
1
2
3
-InnoDB: Last MySQL binlog file position 0 920, file name ./master-bin.000001
+InnoDB: Last MySQL binlog file position 0 922, file name ./master-bin.000001
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
index d88da625e79..090b574a962 100644
--- a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
@@ -32,6 +32,6 @@ a
1
2
3
-InnoDB: Last MySQL binlog file position 0 920, file name ./master-bin.000001
+InnoDB: Last MySQL binlog file position 0 922, file name ./master-bin.000001
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index ddd0adade57..914c9568ea4 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -2679,3 +2679,65 @@ select count(*) from t1;
count(*)
13
drop table t1;
+#
+# BUG#47444 - --myisam_repair_threads > 1 can result in all index
+# cardinalities=1
+#
+SET aria_repair_threads=2;
+SET aria_sort_buffer_size=8192;
+CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a));
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3);
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+CARDINALITY
+14
+14
+14
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET aria_sort_buffer_size=@@global.aria_sort_buffer_size;
+SET aria_repair_threads=@@global.aria_repair_threads;
+#
+# BUG#47073 - valgrind errs, corruption,failed repair of partition,
+# low myisam_sort_buffer_size
+#
+CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b));
+INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
+(6,'0'),(7,'0');
+INSERT INTO t1 SELECT a+10,b FROM t1;
+INSERT INTO t1 SELECT a+20,b FROM t1;
+INSERT INTO t1 SELECT a+40,b FROM t1;
+INSERT INTO t1 SELECT a+80,b FROM t1;
+INSERT INTO t1 SELECT a+160,b FROM t1;
+INSERT INTO t1 SELECT a+320,b FROM t1;
+INSERT INTO t1 SELECT a+640,b FROM t1;
+INSERT INTO t1 SELECT a+1280,b FROM t1;
+INSERT INTO t1 SELECT a+2560,b FROM t1;
+INSERT INTO t1 SELECT a+5120,b FROM t1;
+SET aria_sort_buffer_size=4096;
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair error aria_sort_buffer_size is too small. X
+test.t1 repair error Create index by sort failed
+test.t1 repair info Retrying repair with keycache
+test.t1 repair status OK
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SET aria_repair_threads=2;
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair error aria_sort_buffer_size is too small. X
+test.t1 repair error Create index by sort failed
+test.t1 repair info Retrying repair with keycache
+test.t1 repair status OK
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SET aria_repair_threads=@@global.aria_repair_threads;
+SET aria_sort_buffer_size=@@global.aria_sort_buffer_size;
+DROP TABLE t1;
diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test
index 3fa7d755fe4..7ecf1e33061 100644
--- a/mysql-test/suite/maria/maria.test
+++ b/mysql-test/suite/maria/maria.test
@@ -1963,6 +1963,52 @@ unlock tables;
select count(*) from t1;
drop table t1;
+--echo #
+--echo # BUG#47444 - --myisam_repair_threads > 1 can result in all index
+--echo # cardinalities=1
+--echo #
+SET aria_repair_threads=2;
+SET aria_sort_buffer_size=8192;
+CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a));
+INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3);
+--replace_regex /Current aria_sort_buffer_size.*/X/
+REPAIR TABLE t1;
+SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+CHECK TABLE t1;
+DROP TABLE t1;
+SET aria_sort_buffer_size=@@global.aria_sort_buffer_size;
+SET aria_repair_threads=@@global.aria_repair_threads;
+
+--echo #
+--echo # BUG#47073 - valgrind errs, corruption,failed repair of partition,
+--echo # low myisam_sort_buffer_size
+--echo #
+CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b));
+INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
+ (6,'0'),(7,'0');
+INSERT INTO t1 SELECT a+10,b FROM t1;
+INSERT INTO t1 SELECT a+20,b FROM t1;
+INSERT INTO t1 SELECT a+40,b FROM t1;
+INSERT INTO t1 SELECT a+80,b FROM t1;
+INSERT INTO t1 SELECT a+160,b FROM t1;
+INSERT INTO t1 SELECT a+320,b FROM t1;
+INSERT INTO t1 SELECT a+640,b FROM t1;
+INSERT INTO t1 SELECT a+1280,b FROM t1;
+INSERT INTO t1 SELECT a+2560,b FROM t1;
+INSERT INTO t1 SELECT a+5120,b FROM t1;
+SET aria_sort_buffer_size=4096;
+--replace_regex /Current aria_sort_buffer_size.*/X/
+REPAIR TABLE t1;
+CHECK TABLE t1;
+SET aria_repair_threads=2;
+# May report different values depending on threads activity.
+--replace_regex /Current aria_sort_buffer_size.*/X/
+REPAIR TABLE t1;
+CHECK TABLE t1;
+SET aria_repair_threads=@@global.aria_repair_threads;
+SET aria_sort_buffer_size=@@global.aria_sort_buffer_size;
+DROP TABLE t1;
+
#
# End of test
#
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index b502d71e772..189329fe5c8 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -317,7 +317,7 @@ aria_pagecache_division_limit 100
aria_page_checksum OFF
aria_recover NORMAL
aria_repair_threads 1
-aria_sort_buffer_size 134217728
+aria_sort_buffer_size 268434432
aria_stats_method nulls_unequal
aria_sync_log_dir NEWFILE
show status like 'aria%';
diff --git a/mysql-test/suite/multi_source/gtid.result b/mysql-test/suite/multi_source/gtid.result
index 310df7e6d62..c6adbe31806 100644
--- a/mysql-test/suite/multi_source/gtid.result
+++ b/mysql-test/suite/multi_source/gtid.result
@@ -35,9 +35,9 @@ Master_User root
Master_Port MYPORT_3
Connect_Retry 60
Master_Log_File server3-bin.000001
-Read_Master_Log_Pos 1499
+Read_Master_Log_Pos 1501
Relay_Log_File mysqld-relay-bin.000002
-Relay_Log_Pos 1788
+Relay_Log_Pos 1790
Relay_Master_Log_File server3-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
@@ -50,8 +50,8 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 1499
-Relay_Log_Space 2086
+Exec_Master_Log_Pos 1501
+Relay_Log_Space 2088
Until_Condition None
Until_Log_File
Until_Log_Pos 0
@@ -71,13 +71,13 @@ Replicate_Ignore_Server_Ids
Master_Server_Id 3
Master_SSL_Crl
Master_SSL_Crlpath
-Using_Gtid 0
+Using_Gtid No
Retried_transactions 0
Max_relay_log_size 1073741824
Executed_log_entries 25
Slave_received_heartbeats 0
Slave_heartbeat_period 60.000
-Gtid_Pos 1-1-4,2-2-3
+Gtid_Slave_Pos 1-1-4,2-2-3
*** Now move slave2 to replicate from both master1 and master2 instead of just slave1 ***
STOP ALL SLAVES;
Warnings:
@@ -86,8 +86,8 @@ INSERT INTO t1 VALUES (2, "switch1");
INSERT INTO t3 VALUES (102, "switch1 a");
INSERT INTO t2 VALUES (2, "switch1");
INSERT INTO t3 VALUES (202, "switch1 b");
-CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
-CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
+CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
SET default_master_connection = 'slave1';
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -104,7 +104,7 @@ INSERT INTO t3 VALUES (203, "switch 2 b");
STOP SLAVE 'slave2';
INSERT INTO t2 VALUES (4, "switch 3");
INSERT INTO t3 VALUES (204, "switch 3 b");
-CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
+CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b
diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test
index d6b84fb7f3e..0ab486b1f41 100644
--- a/mysql-test/suite/multi_source/gtid.test
+++ b/mysql-test/suite/multi_source/gtid.test
@@ -75,9 +75,9 @@ INSERT INTO t3 VALUES (202, "switch1 b");
--connection slave2
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
+eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
+eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
SET default_master_connection = 'slave1';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -118,7 +118,7 @@ INSERT INTO t3 VALUES (204, "switch 3 b");
--connection slave1
--replace_result $SERVER_MYPORT_4 MYPORT_4
-eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
+eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
START SLAVE;
--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=3 AND (SELECT COUNT(*) FROM t2)=4 AND (SELECT COUNT(*) FROM t3)=7
--source include/wait_condition.inc
diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result
index d80bf0e8e5c..d506a822822 100644
--- a/mysql-test/suite/multi_source/info_logs.result
+++ b/mysql-test/suite/multi_source/info_logs.result
@@ -84,17 +84,17 @@ MASTER 2.2
# EOF
#
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 relay.000002 599 master-bin.000001 Yes Yes 0 0 311 886 None 0 No 0 No 0 0 1 0 0 1073741824 7 0 60.000
-MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 relay-master@00202@002e2.000002 599 master-bin.000001 Yes Yes 0 0 311 905 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+ Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000002 601 master-bin.000001 Yes Yes 0 0 313 888 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
+MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
include/wait_for_slave_to_start.inc
set default_master_connection = 'MASTER 2.2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 relay.000004 536 master-bin.000001 Yes Yes 0 0 311 823 None 0 No 0 No 0 0 1 0 0 1073741824 6 0 60.000
-MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 relay-master@00202@002e2.000004 536 master-bin.000001 Yes Yes 0 0 311 842 None 0 No 0 No 0 0 2 0 0 1073741824 6 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+ Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000004 536 master-bin.000001 Yes Yes 0 0 313 823 None 0 No 0 No 0 0 1 No 0 1073741824 6 0 60.000
+MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000004 536 master-bin.000001 Yes Yes 0 0 313 842 None 0 No 0 No 0 0 2 No 0 1073741824 6 0 60.000
#
# List of files matching '*info*' pattern
# after slave server restart
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index 60523bc0a0e..f3a99a4ea5e 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -11,13 +11,13 @@ set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
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
-Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 mysqld-relay-bin-master1.000002 599 master-bin.000001 Yes Yes 0 0 311 905 None 0 No 0 No 0 0 1 0
+Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No
show slave 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
-Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 mysqld-relay-bin-master1.000002 599 master-bin.000001 Yes Yes 0 0 311 905 None 0 No 0 No 0 0 1 0
+Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 mysqld-relay-bin-master1.000002 599 master-bin.000001 Yes Yes 0 0 311 905 None 0 No 0 No 0 0 1 0 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
drop database if exists db1;
create database db1;
use db1;
@@ -40,18 +40,18 @@ Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version
mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4
mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version
-mysqld-relay-bin-master1.000002 536 Gtid_list 1 271 []
-mysqld-relay-bin-master1.000002 559 Binlog_checkpoint 1 311 master-bin.000001
-mysqld-relay-bin-master1.000002 599 Gtid 1 349 GTID 0-1-1
-mysqld-relay-bin-master1.000002 637 Query 1 438 drop database if exists db1
-mysqld-relay-bin-master1.000002 726 Gtid 1 476 GTID 0-1-2
-mysqld-relay-bin-master1.000002 764 Query 1 557 create database db1
-mysqld-relay-bin-master1.000002 845 Gtid 1 595 GTID 0-1-3
-mysqld-relay-bin-master1.000002 883 Query 1 748 use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
-mysqld-relay-bin-master1.000002 1036 Gtid 1 786 BEGIN GTID 0-1-4
-mysqld-relay-bin-master1.000002 1074 Intvar 1 814 INSERT_ID=1
-mysqld-relay-bin-master1.000002 1102 Query 1 918 use `db1`; insert into t1 (f1) values ('one'),('two')
-mysqld-relay-bin-master1.000002 1206 Query 1 986 COMMIT
+mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 []
+mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001
+mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1
+mysqld-relay-bin-master1.000002 639 Query 1 440 drop database if exists db1
+mysqld-relay-bin-master1.000002 728 Gtid 1 478 GTID 0-1-2
+mysqld-relay-bin-master1.000002 766 Query 1 559 create database db1
+mysqld-relay-bin-master1.000002 847 Gtid 1 597 GTID 0-1-3
+mysqld-relay-bin-master1.000002 885 Query 1 750 use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
+mysqld-relay-bin-master1.000002 1038 Gtid 1 788 BEGIN GTID 0-1-4
+mysqld-relay-bin-master1.000002 1076 Intvar 1 816 INSERT_ID=1
+mysqld-relay-bin-master1.000002 1104 Query 1 920 use `db1`; insert into t1 (f1) values ('one'),('two')
+mysqld-relay-bin-master1.000002 1208 Query 1 988 COMMIT
change master 'master1' to
master_port=MYPORT_2,
master_host='127.0.0.1',
@@ -75,9 +75,9 @@ master_user='root';
start slave;
include/wait_for_slave_to_start.inc
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin.000002 599 master-bin.000001 Yes Yes 0 0 311 897 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 0-1-4
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 986 mysqld-relay-bin-master1.000002 1274 master-bin.000001 Yes Yes 0 0 986 1580 None 0 No 0 No 0 0 1 0 0 1073741824 17 0 60.000 0-1-4
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+ Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin.000002 601 master-bin.000001 Yes Yes 0 0 313 899 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000 0-1-4
+master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 988 mysqld-relay-bin-master1.000002 1276 master-bin.000001 Yes Yes 0 0 988 1582 None 0 No 0 No 0 0 1 No 0 1073741824 17 0 60.000 0-1-4
insert into t1 (f1) values ('three');
drop database if exists db2;
create database db2;
@@ -105,9 +105,9 @@ master-bin.000002 367
insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB;
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 919 mysqld-relay-bin.000002 1207 master-bin.000001 Yes Yes 0 0 919 1505 None 0 No 0 No 0 0 2 0 0 1073741824 17 0 60.000 0-1-7
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 740 mysqld-relay-bin-master1.000004 1028 master-bin.000002 Yes Yes 0 0 740 1378 None 0 No 0 No 0 0 1 0 0 1073741824 37 0 60.000 0-1-7
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+ Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 921 mysqld-relay-bin.000002 1209 master-bin.000001 Yes Yes 0 0 921 1507 None 0 No 0 No 0 0 2 No 0 1073741824 17 0 60.000 0-1-7
+master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 740 mysqld-relay-bin-master1.000004 1028 master-bin.000002 Yes Yes 0 0 740 1378 None 0 No 0 No 0 0 1 No 0 1073741824 37 0 60.000 0-1-7
select * from db1.t1;
i f1
1 one
@@ -123,18 +123,18 @@ Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin.000002 4 Format_desc 3 248 Server version
mysqld-relay-bin.000002 248 Rotate 2 0 master-bin.000001;pos=4
mysqld-relay-bin.000002 292 Format_desc 2 248 Server version
-mysqld-relay-bin.000002 536 Gtid_list 2 271 []
-mysqld-relay-bin.000002 559 Binlog_checkpoint 2 311 master-bin.000001
-mysqld-relay-bin.000002 599 Gtid 2 349 GTID 0-2-1
-mysqld-relay-bin.000002 637 Query 2 438 drop database if exists db2
-mysqld-relay-bin.000002 726 Gtid 2 476 GTID 0-2-2
-mysqld-relay-bin.000002 764 Query 2 557 create database db2
-mysqld-relay-bin.000002 845 Gtid 2 595 GTID 0-2-3
-mysqld-relay-bin.000002 883 Query 2 730 use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
-mysqld-relay-bin.000002 1018 Gtid 2 768 BEGIN GTID 0-2-4
-mysqld-relay-bin.000002 1056 Intvar 2 796 INSERT_ID=1
-mysqld-relay-bin.000002 1084 Query 2 892 use `db2`; insert into t1 (f1) values (1),(2)
-mysqld-relay-bin.000002 1180 Xid 2 919 COMMIT /* xid=<num> */
+mysqld-relay-bin.000002 536 Gtid_list 2 273 []
+mysqld-relay-bin.000002 561 Binlog_checkpoint 2 313 master-bin.000001
+mysqld-relay-bin.000002 601 Gtid 2 351 GTID 0-2-1
+mysqld-relay-bin.000002 639 Query 2 440 drop database if exists db2
+mysqld-relay-bin.000002 728 Gtid 2 478 GTID 0-2-2
+mysqld-relay-bin.000002 766 Query 2 559 create database db2
+mysqld-relay-bin.000002 847 Gtid 2 597 GTID 0-2-3
+mysqld-relay-bin.000002 885 Query 2 732 use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
+mysqld-relay-bin.000002 1020 Gtid 2 770 BEGIN GTID 0-2-4
+mysqld-relay-bin.000002 1058 Intvar 2 798 INSERT_ID=1
+mysqld-relay-bin.000002 1086 Query 2 894 use `db2`; insert into t1 (f1) values (1),(2)
+mysqld-relay-bin.000002 1182 Xid 2 921 COMMIT /* xid=<num> */
stop slave io_thread;
show status like 'Slave_running';
Variable_name Value
diff --git a/mysql-test/suite/multi_source/relaylog_events.result b/mysql-test/suite/multi_source/relaylog_events.result
index 6b452e65176..970d7d20438 100644
--- a/mysql-test/suite/multi_source/relaylog_events.result
+++ b/mysql-test/suite/multi_source/relaylog_events.result
@@ -15,12 +15,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version
mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4
mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version
-mysqld-relay-bin-master1.000002 536 Gtid_list 1 271 []
-mysqld-relay-bin-master1.000002 559 Binlog_checkpoint 1 311 master-bin.000001
-mysqld-relay-bin-master1.000002 599 Gtid 1 349 GTID 0-1-1
-mysqld-relay-bin-master1.000002 637 Query 1 463 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
-mysqld-relay-bin-master1.000002 751 Gtid 1 501 GTID 0-1-2
-mysqld-relay-bin-master1.000002 789 Query 1 601 use `test`; create table t1 (i int) engine=MyISAM
+mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 []
+mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001
+mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1
+mysqld-relay-bin-master1.000002 639 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+mysqld-relay-bin-master1.000002 753 Gtid 1 503 GTID 0-1-2
+mysqld-relay-bin-master1.000002 791 Query 1 603 use `test`; create table t1 (i int) engine=MyISAM
show relaylog events;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version
diff --git a/mysql-test/suite/multi_source/reset_master_slave.inc b/mysql-test/suite/multi_source/reset_master_slave.inc
index 84634de8ff3..af66da2bb8b 100644
--- a/mysql-test/suite/multi_source/reset_master_slave.inc
+++ b/mysql-test/suite/multi_source/reset_master_slave.inc
@@ -23,7 +23,7 @@ while ($con_name != 'No such row')
--error 0,ER_FLUSH_MASTER_BINLOG_CLOSED
reset master;
-set global gtid_pos='';
+set global gtid_slave_pos='';
eval set default_master_connection = '$default_master';
--source include/end_include_file.inc
diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result
index ebf38789e2b..0e0bd7b9d2e 100644
--- a/mysql-test/suite/multi_source/reset_slave.result
+++ b/mysql-test/suite/multi_source/reset_slave.result
@@ -11,14 +11,14 @@ insert into t1 values (1),(2);
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
- 127.0.0.1 root MYPORT_1 60 master-bin.000001 800 mysqld-relay-bin-master1.000002 1088 master-bin.000001 No No 0 0 800 1394 None 0 No NULL No 0 0 1 0
+ 127.0.0.1 root MYPORT_1 60 master-bin.000001 802 mysqld-relay-bin-master1.000002 1090 master-bin.000001 No No 0 0 802 1396 None 0 No NULL No 0 0 1 No
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
- 127.0.0.1 root MYPORT_1 60 4 1088 No No 0 0 0 1394 None 0 No NULL No 0 0 1 0
+ 127.0.0.1 root MYPORT_1 60 4 1090 No No 0 0 0 1396 None 0 No NULL No 0 0 1 No
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 e2caa911ec0..bc7a2e3c732 100644
--- a/mysql-test/suite/multi_source/simple.result
+++ b/mysql-test/suite/multi_source/simple.result
@@ -10,9 +10,9 @@ Note 1937 SLAVE 'slave2' started
include/wait_for_slave_to_start.inc
set default_master_connection = '';
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
-slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 mysqld-relay-bin-slave1.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 1 0 0 1073741824 7 0 60.000
-slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-slave1.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
+slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
start all slaves;
stop slave 'slave1';
show slave 'slave1' status;
@@ -22,9 +22,9 @@ Master_User root
Master_Port MYPORT_1
Connect_Retry 60
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 311
+Read_Master_Log_Pos 313
Relay_Log_File mysqld-relay-bin-slave1.000002
-Relay_Log_Pos 599
+Relay_Log_Pos 601
Relay_Master_Log_File master-bin.000001
Slave_IO_Running No
Slave_SQL_Running No
@@ -37,8 +37,8 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 311
-Relay_Log_Space 904
+Exec_Master_Log_Pos 313
+Relay_Log_Space 906
Until_Condition None
Until_Log_File
Until_Log_Pos 0
@@ -58,22 +58,22 @@ Replicate_Ignore_Server_Ids
Master_Server_Id 1
Master_SSL_Crl
Master_SSL_Crlpath
-Using_Gtid 0
+Using_Gtid No
reset slave 'slave1';
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
-slave1 127.0.0.1 root MYPORT_1 60 4 599 No No 0 0 0 904 None 0 No NULL No 0 0 1 0 0 1073741824 7 0 60.000
-slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave1 127.0.0.1 root MYPORT_1 60 4 601 No No 0 0 0 906 None 0 No NULL No 0 0 1 No 0 1073741824 7 0 60.000
+slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
reset slave 'slave1' all;
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
-slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000
stop all slaves;
Warnings:
Note 1938 SLAVE 'slave2' stopped
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
-slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 No No 0 0 311 904 None 0 No NULL No 0 0 2 0 0 1073741824 7 0 60.000
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
+slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 No No 0 0 313 906 None 0 No NULL No 0 0 2 No 0 1073741824 7 0 60.000
stop all slaves;
include/reset_master_slave.inc
include/reset_master_slave.inc
diff --git a/mysql-test/suite/multi_source/syntax.result b/mysql-test/suite/multi_source/syntax.result
index 3b041b7165c..9d84250a5f8 100644
--- a/mysql-test/suite/multi_source/syntax.result
+++ b/mysql-test/suite/multi_source/syntax.result
@@ -5,7 +5,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
show slave '' 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
show all slaves status;
-Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos
+Connection_name Slave_SQL_State 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 Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
#
# Check error handling
#
diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result
index 4e3d4ed9fec..d595d736fa1 100644
--- a/mysql-test/suite/perfschema/r/digest_table_full.result
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result
@@ -76,7 +76,7 @@ SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
NULL NULL 29 21 1 2
-1345c0660fc7999e9588e49fe5456711 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+3225531460dd440befd77236e5120ed8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
SHOW VARIABLES LIKE "performance_schema_digests_size";
Variable_name Value
performance_schema_digests_size 2
diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result
index e429d01362b..d57c6e065a7 100644
--- a/mysql-test/suite/perfschema/r/statement_digest.result
+++ b/mysql-test/suite/perfschema/r/statement_digest.result
@@ -75,28 +75,28 @@ Warning 1265 Data truncated for column 'c' at row 1
SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
-1345c0660fc7999e9588e49fe5456711 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
-0dd22e92bd19e14ec9436f6bddd6f4d1 SELECT ? FROM t1 1 0 0 0
-40f5ec773a6bece3bca080832527d73b SELECT ? FROM `t1` 1 0 0 0
-375bb0987d1daa174b7042fefb56e2bd SELECT ?, ... FROM t1 2 0 0 0
-8f7eaa63479a90e06b3a2242bef10386 SELECT ? FROM t2 1 0 0 0
-48a82c6f45fbd68ffbd7112ed10f4085 SELECT ?, ... FROM t2 2 0 0 0
-de7eb041a491e8f63ac3405e3963d7c1 INSERT INTO t1 VALUES (?) 1 1 0 0
-c439296cdd4fb9bb34a42c555aa1481f INSERT INTO t2 VALUES (?) 1 1 0 0
-c9bf536c0ba561e4c7b38274f7c1534c INSERT INTO t3 VALUES (...) 1 1 0 0
-59c827a34e5c6913eb755edc291025c9 INSERT INTO t4 VALUES (...) 1 1 0 0
-704def15f83d1105e9eb187372a3efa9 INSERT INTO t5 VALUES (...) 1 1 0 0
-7758084b2b5a2a0ae575e157b65b2091 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
-a52faa6f6b1dcdffb21e630b29a666e1 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
-c588d07f8bd087f22e4b7c8e27059cc2 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
-58573cec0a4b3b41c8f46e5f912273af SELECT ? + ? 3 0 0 0
-683eaa9acc65b7f7639adb5c17fdf709 SELECT ? 1 0 0 0
-bce3f7384ae2ab78354b031184fde12d CREATE SCHEMA statements_digest_temp 2 2 0 0
-2a0e36afeaac85dc117c3856388a4fae DROP SCHEMA statements_digest_temp 2 0 0 0
-cd033c038277926fad0abd82b7809a5c SELECT ? FROM t11 1 0 0 1
-5fb3873770503f16185ec7152f668242 CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1
-ab7b7093829991bf6cd4bd2a39a194b0 INSERT INTO t11 VALUES (?) 1 1 1 0
-3c9678195704d4d50b4d2fac4332acbe SHOW WARNINGS 1 0 0 0
+3225531460dd440befd77236e5120ed8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+ee68ed554a5635c7150bf4145bf7b407 SELECT ? FROM t1 1 0 0 0
+df8387c347acdee7c6921a9f4d6dd4c3 SELECT ? FROM `t1` 1 0 0 0
+315c9ba9f900acbd481c410f8682a177 SELECT ?, ... FROM t1 2 0 0 0
+690e9ae778d8139380037b23982a2751 SELECT ? FROM t2 1 0 0 0
+11a7796987200437c70b279b724de1c5 SELECT ?, ... FROM t2 2 0 0 0
+6cf57914c95f7c1b7002add9dfba500a INSERT INTO t1 VALUES (?) 1 1 0 0
+b1d63656e88d49ad8f35cde60ed237ac INSERT INTO t2 VALUES (?) 1 1 0 0
+c9ef4f55c1b2d510c45b06a957b03528 INSERT INTO t3 VALUES (...) 1 1 0 0
+1ca36bb6072d28969691835393f05613 INSERT INTO t4 VALUES (...) 1 1 0 0
+0e34bd5feaa44dcac28546af0b44d483 INSERT INTO t5 VALUES (...) 1 1 0 0
+4b4847b65054d2a7e0bfd628f5c4c1f8 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
+a3864a3b53830547b589fc1e645ae9e0 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
+531decf5f8240256654fc7833c79d25d INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
+8f4b0e89ea4a410f4681ea667496292d SELECT ? + ? 3 0 0 0
+2cfaf59d6b5a2bdd331188ed37fd8d91 SELECT ? 1 0 0 0
+85d2000611635c9cbffba908d1fd0ae9 CREATE SCHEMA statements_digest_temp 2 2 0 0
+a33623d6bc003da1a327b8ae10456f84 DROP SCHEMA statements_digest_temp 2 0 0 0
+ff47f3960b7118240c57d8646d016d7f SELECT ? FROM t11 1 0 0 1
+c728d9b6c1b79b9dac451c685899cb59 CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1
+34e7c0331037e3bf580d4a35005fca34 INSERT INTO t11 VALUES (?) 1 1 1 0
+e527c909da8f650bee03c420345342dc SHOW WARNINGS 1 0 0 0
####################################
# CLEANUP
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
index 2499c3f7292..30a72b39f8c 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
@@ -88,28 +88,28 @@ Warning 1265 Data truncated for column 'c' at row 1
####################################
SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
digest digest_text count_star
-1345c0660fc7999e9588e49fe5456711 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
-0dd22e92bd19e14ec9436f6bddd6f4d1 SELECT ? FROM t1 1
-40f5ec773a6bece3bca080832527d73b SELECT ? FROM `t1` 1
-375bb0987d1daa174b7042fefb56e2bd SELECT ?, ... FROM t1 2
-8f7eaa63479a90e06b3a2242bef10386 SELECT ? FROM t2 1
-48a82c6f45fbd68ffbd7112ed10f4085 SELECT ?, ... FROM t2 2
-de7eb041a491e8f63ac3405e3963d7c1 INSERT INTO t1 VALUES (?) 1
-c439296cdd4fb9bb34a42c555aa1481f INSERT INTO t2 VALUES (?) 1
-c9bf536c0ba561e4c7b38274f7c1534c INSERT INTO t3 VALUES (...) 1
-59c827a34e5c6913eb755edc291025c9 INSERT INTO t4 VALUES (...) 1
-704def15f83d1105e9eb187372a3efa9 INSERT INTO t5 VALUES (...) 1
-7758084b2b5a2a0ae575e157b65b2091 INSERT INTO t1 VALUES (?) /* , ... */ 2
-a52faa6f6b1dcdffb21e630b29a666e1 INSERT INTO t3 VALUES (...) /* , ... */ 1
-c588d07f8bd087f22e4b7c8e27059cc2 INSERT INTO t5 VALUES (...) /* , ... */ 1
-58573cec0a4b3b41c8f46e5f912273af SELECT ? + ? 3
-683eaa9acc65b7f7639adb5c17fdf709 SELECT ? 1
-bce3f7384ae2ab78354b031184fde12d CREATE SCHEMA statements_digest_temp 2
-2a0e36afeaac85dc117c3856388a4fae DROP SCHEMA statements_digest_temp 2
-cd033c038277926fad0abd82b7809a5c SELECT ? FROM t11 1
-5fb3873770503f16185ec7152f668242 CREATE TABLE t11 ( c CHARACTER (?) ) 2
-ab7b7093829991bf6cd4bd2a39a194b0 INSERT INTO t11 VALUES (?) 1
-3c9678195704d4d50b4d2fac4332acbe SHOW WARNINGS 1
+3225531460dd440befd77236e5120ed8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
+ee68ed554a5635c7150bf4145bf7b407 SELECT ? FROM t1 1
+df8387c347acdee7c6921a9f4d6dd4c3 SELECT ? FROM `t1` 1
+315c9ba9f900acbd481c410f8682a177 SELECT ?, ... FROM t1 2
+690e9ae778d8139380037b23982a2751 SELECT ? FROM t2 1
+11a7796987200437c70b279b724de1c5 SELECT ?, ... FROM t2 2
+6cf57914c95f7c1b7002add9dfba500a INSERT INTO t1 VALUES (?) 1
+b1d63656e88d49ad8f35cde60ed237ac INSERT INTO t2 VALUES (?) 1
+c9ef4f55c1b2d510c45b06a957b03528 INSERT INTO t3 VALUES (...) 1
+1ca36bb6072d28969691835393f05613 INSERT INTO t4 VALUES (...) 1
+0e34bd5feaa44dcac28546af0b44d483 INSERT INTO t5 VALUES (...) 1
+4b4847b65054d2a7e0bfd628f5c4c1f8 INSERT INTO t1 VALUES (?) /* , ... */ 2
+a3864a3b53830547b589fc1e645ae9e0 INSERT INTO t3 VALUES (...) /* , ... */ 1
+531decf5f8240256654fc7833c79d25d INSERT INTO t5 VALUES (...) /* , ... */ 1
+8f4b0e89ea4a410f4681ea667496292d SELECT ? + ? 3
+2cfaf59d6b5a2bdd331188ed37fd8d91 SELECT ? 1
+85d2000611635c9cbffba908d1fd0ae9 CREATE SCHEMA statements_digest_temp 2
+a33623d6bc003da1a327b8ae10456f84 DROP SCHEMA statements_digest_temp 2
+ff47f3960b7118240c57d8646d016d7f SELECT ? FROM t11 1
+c728d9b6c1b79b9dac451c685899cb59 CREATE TABLE t11 ( c CHARACTER (?) ) 2
+34e7c0331037e3bf580d4a35005fca34 INSERT INTO t11 VALUES (?) 1
+e527c909da8f650bee03c420345342dc SHOW WARNINGS 1
SELECT digest, digest_text FROM performance_schema.events_statements_current;
digest digest_text
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
index b6561323980..8e134ef2e6c 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
####################################
SELECT digest, digest_text, count_star FROM events_statements_summary_by_digest;
digest digest_text count_star
-ba54a23522084a7742629193cd6d6349 TRUNCATE TABLE events_statements_summary_by_digest 1
-5d9a2f95653d8ca9d9cea3eefff7e361 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1
+0eaad5973ec42fa6663598cbe4db6536 TRUNCATE TABLE events_statements_summary_by_digest 1
+f17895a2b6f270dbd4dc21b313d7f647 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
index bbe59ee69ae..f98a3bf322d 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
@@ -49,7 +49,7 @@ include/stop_slave.inc
INSERT INTO t1 VALUES (5, "m1a");
INSERT INTO t2 VALUES (5, "i1a");
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a b
@@ -68,7 +68,7 @@ a b
*** Now move B to D (C is still replicating from B) ***
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
UPDATE t2 SET b="j1a" WHERE a=5;
SELECT * FROM t1 ORDER BY a;
@@ -92,7 +92,7 @@ INSERT INTO t2 VALUES (6, "i6b");
INSERT INTO t2 VALUES (7, "i7b");
COMMIT;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
SELECT * FROM t2 ORDER BY a;
a b
@@ -107,6 +107,7 @@ a b
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_MYPORT;
include/start_slave.inc
+include/wait_for_slave_to_start.inc
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_MYPORT;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
index 70cf7fe49d4..c92dd8bb737 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
@@ -4,12 +4,12 @@ call mtr.add_suppression("Checking table:");
call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
flush tables;
-ALTER TABLE mysql.rpl_slave_state ENGINE=InnoDB;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
include/start_slave.inc
@@ -21,7 +21,7 @@ DROP TABLE t1;
*** Test crashing the master mysqld and check that binlog state is recovered. ***
include/stop_slave.inc
RESET MASTER;
-SET GLOBAL gtid_pos='';
+SET GLOBAL gtid_slave_pos='';
RESET MASTER;
SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -42,7 +42,7 @@ master-bin.000002 #
master-bin.000003 #
SHOW BINLOG EVENTS IN 'master-bin.000003' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000003 # Gtid_list # # [1-1-3,2-1-4,0-1-1]
+master-bin.000003 # Gtid_list # # [1-1-2,2-1-1,0-1-1]
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
@@ -54,7 +54,7 @@ master-bin.000003 #
master-bin.000004 #
SHOW BINLOG EVENTS IN 'master-bin.000004' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000004 # Gtid_list # # [1-1-3,0-1-1,2-1-4]
+master-bin.000004 # Gtid_list # # [1-1-2,0-1-1,2-1-1]
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
index 0882f8e1872..59f288d4afd 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
@@ -1,30 +1,30 @@
include/master-slave.inc
[connection master]
-*** Test that we check against incorrect table definition for mysql.rpl_slave_state ***
+*** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state CHANGE seq_no seq_no VARCHAR(20);
+ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no VARCHAR(20);
START SLAVE;
INSERT INTO t1 VALUES (1);
-CALL mtr.add_suppression("Slave: Failed to open mysql.rpl_slave_state");
+CALL mtr.add_suppression("Slave: Failed to open mysql.gtid_slave_pos");
include/wait_for_slave_sql_error.inc [errno=1942]
include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
-ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
-ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (sub_id, domain_id);
+ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
+ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
+ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id, domain_id);
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1942]
include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
+ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1942]
include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (sub_id);
+ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id);
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1942]
include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
-ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (domain_id, sub_id);
+ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
+ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (domain_id, sub_id);
include/start_slave.inc
SELECT * FROM t1;
a
@@ -38,13 +38,28 @@ SET sql_log_bin = 0;
INSERT INTO t1 VALUES (2);
SET sql_log_bin = 1;
INSERT INTO t1 VALUES (3);
-CHANGE MASTER TO master_use_gtid=1;
-SET GLOBAL gtid_pos = "0-1-1";
-ERROR HY000: Requested GTID_POS 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. To use the requested GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog
-SET GLOBAL gtid_pos = "";
-ERROR HY000: Requested GTID_POS contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. To use the requested GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog
+CHANGE MASTER TO master_use_gtid=current_pos;
+BEGIN;
+SET GLOBAL gtid_slave_pos = "100-100-100";
+ERROR 25000: You are not allowed to execute this command in a transaction
+INSERT INTO t1 VALUES (100);
+SET GLOBAL gtid_slave_pos = "100-100-100";
+ERROR 25000: You are not allowed to execute this command in a transaction
+ROLLBACK;
+SET GLOBAL gtid_strict_mode= 1;
+SET GLOBAL gtid_slave_pos = "0-1-1";
+ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos.
+SET GLOBAL gtid_slave_pos = "";
+ERROR HY000: 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.
+SET GLOBAL gtid_strict_mode= 0;
+SET GLOBAL gtid_slave_pos = "0-1-1";
+Warnings:
+Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_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-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos.
RESET MASTER;
-SET GLOBAL gtid_pos = "0-1-1";
+SET GLOBAL gtid_slave_pos = "0-1-1";
START SLAVE;
SELECT * FROM t1 ORDER BY a;
a
@@ -54,7 +69,7 @@ a
4
*** Test slave requesting a GTID that is not present in the master's binlog ***
include/stop_slave.inc
-SET GLOBAL gtid_pos = "0-1-3";
+SET GLOBAL gtid_slave_pos = "0-1-3";
START SLAVE;
SET sql_log_bin=0;
CALL mtr.add_suppression("Got fatal error .* from master when reading data from binary log: 'Error: connecting slave requested to start from GTID .*, which is not in the master's binlog'");
@@ -63,9 +78,9 @@ include/wait_for_slave_io_error.inc [errno=1236]
Slave_IO_State = ''
Last_IO_Errno = '1236'
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 0-1-3, which is not in the master's binlog''
-Using_Gtid = '1'
+Using_Gtid = 'Current_Pos'
include/stop_slave.inc
-SET GLOBAL gtid_pos = "0-1-2";
+SET GLOBAL gtid_slave_pos = "0-1-2";
START SLAVE;
include/wait_for_slave_to_start.inc
INSERT INTO t1 VALUES (5);
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
new file mode 100644
index 00000000000..132c01f5f55
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
@@ -0,0 +1,367 @@
+include/rpl_init.inc [topology=1->2, 1->3, 1->4, 1->5]
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t4 (a INT, b INT, PRIMARY KEY (a,b)) Engine=InnoDB;
+CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100))
+RETURNS VARCHAR(100) DETERMINISTIC
+BEGIN
+SET s= CONCAT(",", s, ",");
+SET s= SUBSTR(s FROM LOCATE(CONCAT(",", d, "-"), s) + 1);
+SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
+RETURN s;
+END|
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+SET gtid_domain_id= 1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t4 VALUES (1, 1);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t4 VALUES (1, 3);
+SET gtid_domain_id= 2;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+INSERT INTO t4 VALUES (2, 1);
+INSERT INTO t2 VALUES (3);
+INSERT INTO t2 VALUES (4);
+INSERT INTO t4 VALUES (2, 3);
+SET gtid_domain_id= 3;
+CREATE TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (1);
+INSERT INTO t3 VALUES (2);
+INSERT INTO t4 VALUES (3, 1);
+INSERT INTO t3 VALUES (3);
+INSERT INTO t3 VALUES (4);
+INSERT INTO t4 VALUES (3, 3);
+START SLAVE UNTIL master_gtid_pos= "1-1-4,2-1-4,3-1-4";
+START SLAVE UNTIL master_gtid_pos= "1-1-1,2-1-4,3-1-7";
+START SLAVE UNTIL master_gtid_pos= "2-1-1,3-1-4,1-1-7";
+START SLAVE UNTIL master_gtid_pos= "3-1-1,1-1-4,2-1-7";
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+2 1
+3 1
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t4 ORDER BY a,b;
+a b
+2 1
+3 1
+3 3
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t2 ORDER BY a;
+a
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+3 1
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t3 ORDER BY a;
+a
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+2 1
+2 3
+*** Now replicate all extra changes from 3,4,5 to 2, in preparation for making 2 the new master. ***
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
+START SLAVE UNTIL master_gtid_pos = "1-1-1,0-1-3,3-1-7,2-1-4";
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+2 1
+3 1
+3 3
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4;
+START SLAVE UNTIL master_gtid_pos = "1-1-7,0-1-3,3-1-4,2-1-1";
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+2 1
+3 1
+3 3
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_5;
+START SLAVE UNTIL master_gtid_pos = "1-1-4,0-1-3,3-1-1,2-1-7";
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+2 1
+2 3
+3 1
+3 3
+*** Now make 2 master and point 3,4,5 to the new master 2
+SET gtid_domain_id= 1;
+INSERT INTO t1 values (5);
+INSERT INTO t4 values (1,5);
+SET gtid_domain_id= 2;
+INSERT INTO t2 values (5);
+INSERT INTO t4 values (2,5);
+SET gtid_domain_id= 3;
+INSERT INTO t3 values (5);
+INSERT INTO t4 values (3,5);
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2;
+include/start_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2;
+include/start_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2;
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+1 5
+2 1
+2 3
+2 5
+3 1
+3 3
+3 5
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+1 5
+2 1
+2 3
+2 5
+3 1
+3 3
+3 5
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+1 5
+2 1
+2 3
+2 5
+3 1
+3 3
+3 5
+*** Now let the old master join up as slave. ***
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
+master_user = "root", master_use_gtid = current_pos;
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t4 ORDER BY a,b;
+a b
+1 1
+1 3
+1 5
+2 1
+2 3
+2 5
+3 1
+3 3
+3 5
+*** Finally move things back and clean up. ***
+include/stop_slave.inc
+RESET SLAVE ALL;
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
+include/start_slave.inc
+SET gtid_domain_id = 0;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+DROP FUNCTION extract_gtid;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
index de8e84bb801..f983262d3a9 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
@@ -8,7 +8,7 @@ include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset slave all;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
-master_user='root', MASTER_USE_GTID=1;
+master_user='root', MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
include/wait_for_slave_to_start.inc
flush logs;
@@ -16,7 +16,7 @@ insert into t1 values (3);
insert into t1 values (4);
flush logs;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
select * from t1 order by n;
n
@@ -47,11 +47,11 @@ include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset slave all;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
-master_user = 'root', MASTER_USE_GTID=1;
+master_user = 'root', MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result
new file mode 100644
index 00000000000..e7500a57a13
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result
@@ -0,0 +1,63 @@
+include/rpl_init.inc [topology=1->2->1]
+#
+# For now we'll only have 1->2 running
+#
+# Server 1
+# Stop replication 2->1
+include/stop_slave.inc
+#
+# Server 2
+# Use GTID for replication 1->2
+include/stop_slave.inc
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+#
+# Create some 0-1-* and 0-2-* events in binlog of server 2
+connection server_1;
+create table t1 (i int) engine=InnoDB;
+insert into t1 values (1);
+connection server_2;
+create table t2 (i int) engine=InnoDB;
+connection server_1;
+insert into t1 values (2);
+connection server_2;
+insert into t2 values (1);
+#
+# All events are present in the binlog of server 2
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; create table t1 (i int) engine=InnoDB
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into t1 values (1)
+slave-bin.000001 # Xid # # COMMIT /* XID */
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; create table t2 (i int) engine=InnoDB
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into t1 values (2)
+slave-bin.000001 # Xid # # COMMIT /* XID */
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into t2 values (1)
+slave-bin.000001 # Xid # # COMMIT /* XID */
+#
+# Server 1
+# Start replication 2->1 using GTID,
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+select * from t1 order by i;
+i
+1
+2
+select * from t2 order by i;
+i
+1
+select * from t1 order by i;
+i
+1
+2
+select * from t2 order by i;
+i
+1
+drop table t1;
+drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
index 7b1189cfd9b..824fe8d879f 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
@@ -24,7 +24,7 @@ slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, 2)
slave-bin.000001 # Query # # COMMIT
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
-master_user = 'root', master_use_gtid = 1;
+master_user = 'root', master_use_gtid = current_pos;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b
@@ -37,7 +37,7 @@ RESET SLAVE;
INSERT INTO t1 VALUES (5, 1);
INSERT INTO t1 VALUES (6, 1);
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
-master_use_gtid = 1;
+master_use_gtid = current_pos;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
index 4530542f080..d226ffa68f7 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
@@ -6,9 +6,9 @@ RESET SLAVE;
RESET MASTER;
FLUSH LOGS;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
SELECT * FROM t1;
a
@@ -24,9 +24,9 @@ include/wait_for_purge.inc "master-bin.000003"
show binary logs;
Log_name File_size
master-bin.000003 #
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1236]
include/stop_slave.inc
@@ -40,12 +40,12 @@ a
SET sql_log_bin=0;
call mtr.add_suppression('Could not find GTID state requested by slave in any binlog files');
SET sql_log_bin=1;
-*** Test that we give error when explict @@gtid_pos=xxx that conflicts with what is in our binary log ***
+*** Test that we give warning when explict @@gtid_slave_pos=xxx that conflicts with what is in our binary log ***
include/stop_slave.inc
INSERT INTO t1 VALUES(3);
-SET GLOBAL gtid_pos='0-1-3';
+SET GLOBAL gtid_slave_pos='0-1-3';
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
-MASTER_USE_GTID=1;
+MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
SELECT * FROM t1 ORDER by a;
a
@@ -56,10 +56,11 @@ include/stop_slave.inc
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (10);
DELETE FROM t1 WHERE a=10;
-SET GLOBAL gtid_pos='0-1-4';
-ERROR HY000: Requested GTID_POS 0-1-4 conflicts with the binary log which contains a more recent GTID 0-2-6. To use the requested GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog
+SET GLOBAL gtid_slave_pos='0-1-4';
+Warnings:
+Warning 1947 Specified GTID 0-1-4 conflicts with the binary log which contains a more recent GTID 0-2-6. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos.
RESET MASTER;
-SET GLOBAL gtid_pos='0-1-4';
+SET GLOBAL gtid_slave_pos='0-1-4';
START SLAVE;
SELECT * FROM t1 ORDER by a;
a
@@ -73,8 +74,8 @@ include/stop_slave.inc
RESET SLAVE ALL;
RESET MASTER;
RESET MASTER;
-SET GLOBAL gtid_pos='';
-CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=1;
+SET GLOBAL gtid_slave_pos='';
+CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=current_pos;
include/start_slave.inc
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
@@ -89,14 +90,15 @@ SELECT * FROM t1 ORDER BY a;
a
1
2
-*** MDEV-4329: GTID_POS='' is not checked for conflicts with binlog ***
+*** MDEV-4329: GTID_SLAVE_POS='' is not checked for conflicts with binlog ***
include/stop_slave.inc
DROP TABLE t1;
RESET SLAVE;
-SET GLOBAL gtid_pos="";
-ERROR HY000: Requested GTID_POS contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-4. To use the requested GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog
+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.
RESET MASTER;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -107,7 +109,7 @@ SET SQL_LOG_BIN=0;
DROP TABLE t1;
SET SQL_LOG_BIN=1;
RESET SLAVE;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -116,11 +118,11 @@ a
*** Test that RESET SLAVE clears the Using_Gtid flag. ***
include/stop_slave.inc
RESET SLAVE;
-Using_Gtid = '0'
+Using_Gtid = 'No'
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1050]
STOP SLAVE IO_THREAD;
-CHANGE MASTER TO MASTER_USE_GTID=1;
+CHANGE MASTER TO MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
INSERT INTO t1 VALUES(3);
SELECT * FROM t1 ORDER BY a;
@@ -154,7 +156,7 @@ a
*** Test modifying binlog on slave and the effect on GTID state. ***
include/stop_slave.inc
RESET MASTER;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
RESET MASTER;
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (10);
@@ -162,28 +164,29 @@ include/start_slave.inc
SELECT * FROM t1;
a
10
-SELECT '1' AS Using_Gtid;
+SELECT 'Current_Pos' AS Using_Gtid;
Using_Gtid
-1
-SELECT '0-1-2' AS Gtid_Pos;
-Gtid_Pos
+Current_Pos
+SELECT '0-1-2' AS Gtid_Slave_Pos;
+Gtid_Slave_Pos
0-1-2
UPDATE t1 SET a=9 WHERE a=10;
UPDATE t1 SET a=10 WHERE a=9;
-SELECT '0-2-4' AS Gtid_Pos;
-Gtid_Pos
+SELECT '0-2-4' AS Gtid_Slave_Pos;
+Gtid_Slave_Pos
0-2-4
include/stop_slave.inc
-SET GLOBAL gtid_pos='0-1-2';
-ERROR HY000: Requested GTID_POS 0-1-2 conflicts with the binary log which contains a more recent GTID 0-2-4. To use the requested GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog
+SET GLOBAL gtid_slave_pos='0-1-2';
+Warnings:
+Warning 1947 Specified GTID 0-1-2 conflicts with the binary log which contains a more recent GTID 0-2-4. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos.
RESET MASTER;
-SELECT '0-1-2' AS Gtid_Pos;
-Gtid_Pos
+SELECT '0-1-2' AS Gtid_Slave_Pos;
+Gtid_Slave_Pos
0-1-2
-SET GLOBAL gtid_pos='0-1-2';
+SET GLOBAL gtid_slave_pos='0-1-2';
include/start_slave.inc
-SELECT '0-1-2' AS Gtid_Pos;
-Gtid_Pos
+SELECT '0-1-2' AS Gtid_Slave_Pos;
+Gtid_Slave_Pos
0-1-2
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
index 0bb963cc2ab..dcfdc567736 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
@@ -4,8 +4,8 @@ CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
include/stop_slave.inc
Master_Log_File = 'master-bin.000001'
-Using_Gtid = '0'
-CHANGE MASTER TO master_use_gtid=1;
+Using_Gtid = 'No'
+CHANGE MASTER TO master_use_gtid=current_pos;
FLUSH LOGS;
include/wait_for_purge.inc "master-bin.000002"
show binary logs;
@@ -32,10 +32,10 @@ master-bin.000003 # Gtid_list # # [0-1-3]
FLUSH LOGS;
SHOW BINLOG EVENTS IN 'master-bin.000004' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000004 # Gtid_list # # [1-1-5,0-1-4]
+master-bin.000004 # Gtid_list # # [1-1-1,0-1-4]
SHOW BINLOG EVENTS IN 'master-bin.000005' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000005 # Gtid_list # # [1-1-5,0-1-4]
+master-bin.000005 # Gtid_list # # [1-1-1,0-1-4]
show binary logs;
Log_name File_size
master-bin.000002 #
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_strict.result b/mysql-test/suite/rpl/r/rpl_gtid_strict.result
new file mode 100644
index 00000000000..150ea000ff2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_strict.result
@@ -0,0 +1,182 @@
+include/rpl_init.inc [topology=1->2]
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+SET sql_log_bin= 0;
+call mtr.add_suppression("Error writing file .*errno: 1950");
+SET sql_log_bin= 1;
+SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= 1;
+include/stop_slave.inc
+SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode=1;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+include/start_slave.inc
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+SET server_id= 3;
+SET gtid_seq_no= 3;
+ERROR HY000: An attempt was made to binlog GTID 0-3-3 which would create an out-of-order sequence number with existing GTID 0-1-3, and gtid strict mode is enabled.
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 3;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+INSERT INTO t1 VALUES (2);
+ERROR HY000: An attempt was made to binlog GTID 0-3-3 which would create an out-of-order sequence number with existing GTID 0-1-3, and gtid strict mode is enabled.
+SET gtid_seq_no= 2;
+ERROR HY000: An attempt was made to binlog GTID 0-3-2 which would create an out-of-order sequence number with existing GTID 0-1-3, and gtid strict mode is enabled.
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 2;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+INSERT INTO t1 VALUES (3);
+ERROR HY000: An attempt was made to binlog GTID 0-3-2 which would create an out-of-order sequence number with existing GTID 0-1-3, and gtid strict mode is enabled.
+SET server_id= 1;
+SET gtid_seq_no= 4;
+INSERT INTO t1 VALUES (4);
+SELECT * FROM t1 ORDER BY 1;
+a
+1
+4
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+master-bin.000001 # Xid # # COMMIT /* XID */
+*** Test non-transactional GTID error (cannot be rolled back). ***
+SET server_id= 3;
+SET gtid_seq_no= 1;
+ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-1-4, and gtid strict mode is enabled.
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 1;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM;
+ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-1-4, and gtid strict mode is enabled.
+SET sql_log_bin= 0;
+DROP TABLE t2;
+SET sql_log_bin= 1;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM;
+SET gtid_seq_no= 1;
+ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-3-5, and gtid strict mode is enabled.
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 1;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+INSERT INTO t2 VALUES (1);
+ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-3-5, and gtid strict mode is enabled.
+SET server_id= 1;
+SET gtid_seq_no= 6;
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (2)
+master-bin.000001 # Query # # COMMIT
+*** Test that slave stops if it tries to apply a GTID that would create out-of-order binlog GTID sequence numbers. ***
+SELECT * FROM t1 ORDER BY a;
+a
+1
+4
+SELECT * FROM t2 ORDER BY a;
+a
+2
+SET sql_log_bin= 0;
+call mtr.add_suppression("An attempt was made to binlog GTID .* which would create an out-of-order sequence number with existing GTID .*, and gtid strict mode is enabled");
+call mtr.add_suppression("The binlog on the master is missing the GTID [-0-9]+ requested by the slave");
+SET sql_log_bin= 1;
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+include/wait_for_slave_sql_error.inc [errno=1950]
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_strict_mode=0;
+include/start_slave.inc
+SET GLOBAL gtid_strict_mode=1;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+4
+5
+6
+INSERT INTO t1 VALUES (7);
+CREATE TABLE t3 (a INT PRIMARY KEY);
+include/wait_for_slave_sql_error.inc [errno=1950]
+SHOW CREATE TABLE t3;
+ERROR 42S02: Table 'test.t3' doesn't exist
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_strict_mode=0;
+include/start_slave.inc
+SET GLOBAL gtid_strict_mode=1;
+SHOW CREATE TABLE t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (8);
+INSERT INTO t2 VALUES (3);
+include/wait_for_slave_sql_error.inc [errno=1950]
+SELECT * FROM t2 ORDER BY a;
+a
+2
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_strict_mode=0;
+include/start_slave.inc
+SET GLOBAL gtid_strict_mode=1;
+SELECT * FROM t2 ORDER BY a;
+a
+2
+3
+*** Check slave requests starting from a hole on the master. ***
+include/stop_slave.inc
+INSERT INTO t1 VALUES (10);
+SET gtid_seq_no= 100;
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+SET GLOBAL gtid_slave_pos= "0-1-50";
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1236]
+STOP SLAVE SQL_THREAD;
+SET GLOBAL gtid_strict_mode= 0;
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+4
+5
+6
+7
+8
+11
+12
+SET GLOBAL gtid_strict_mode= 1;
+DROP TABLE t1, t2, t3;
+SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result
new file mode 100644
index 00000000000..53100af4c71
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result
@@ -0,0 +1,225 @@
+include/rpl_init.inc [topology=1->2]
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100))
+RETURNS VARCHAR(100) DETERMINISTIC
+BEGIN
+SET s= CONCAT(",", s, ",");
+SET s= SUBSTR(s FROM LOCATE(CONCAT(",", d, "-"), s) + 1);
+SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
+RETURN s;
+END|
+START SLAVE UNTIL master_gtid_pos = "";
+ERROR HY000: Slave is already running
+include/stop_slave_io.inc
+START SLAVE UNTIL master_gtid_pos = "";
+ERROR HY000: Slave is already running
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+include/stop_slave_sql.inc
+START SLAVE UNTIL master_gtid_pos = "";
+ERROR HY000: Slave is already running
+include/stop_slave_io.inc
+START SLAVE UNTIL master_gtid_pos = "";
+ERROR HY000: START SLAVE UNTIL master_gtid_pos requires that slave is using GTID
+CHANGE MASTER TO master_use_gtid=current_pos;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+START SLAVE UNTIL master_gtid_pos = "0-1-100,1-1-100,2-2-200,1-3-100,4-4-400";
+ERROR HY000: GTID 1-3-100 and 1-1-100 conflict (duplicate domain id 1)
+START SLAVE UNTIL master_log_file = "master-bin.000001", master_log_pos = 4, master_gtid_pos = "";
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos = ""' at line 1
+START SLAVE IO_THREAD UNTIL master_gtid_pos = "";
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+START SLAVE SQL_THREAD UNTIL master_gtid_pos = "";
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+START SLAVE UNTIL master_gtid_pos = '0-1-4';
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1;
+a
+1
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+include/stop_slave.inc
+START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200";
+include/wait_for_slave_to_start.inc
+Using_Gtid = 'Current_Pos'
+Until_Condition = 'Gtid'
+include/stop_slave.inc
+include/start_slave.inc
+*** Test UNTIL condition in an earlier binlog than the start GTID. ***
+include/stop_slave.inc
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (3);
+SET gtid_domain_id = 2;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (3);
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (4);
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (4);
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (5);
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (5);
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (6);
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (6);
+SET gtid_domain_id = 0;
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+master-bin.000004 #
+START SLAVE UNTIL master_gtid_pos='1-1-3,2-1-4';
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+3
+4
+5
+START SLAVE UNTIL master_gtid_pos='1-1-4,2-1-2';
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+3
+4
+5
+START SLAVE UNTIL master_gtid_pos='1-1-3';
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+3
+4
+5
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+3
+4
+5
+6
+*** Test when the UNTIL position is right at the end of the binlog file prior to the starting position ***
+include/stop_slave.inc
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (7);
+SET gtid_domain_id = 0;
+START SLAVE UNTIL master_gtid_pos='1-1-4';
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+*** Test when UNTIL condition is after a stand-alone event (not a transaction). ***
+include/stop_slave.inc
+CREATE TABLE t3 (a INT);
+DROP TABLE t3;
+START SLAVE UNTIL master_gtid_pos='1-1-5,2-1-5,0-1-6';
+include/wait_for_slave_to_stop.inc
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+include/start_slave.inc
+*** Test UNTIL condition that has not yet been logged. ***
+include/stop_slave.inc
+RESET SLAVE ALL;
+RESET MASTER;
+SET GLOBAL gtid_slave_pos='';
+RESET MASTER;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+DELETE FROM t1 WHERE a >= 10;
+RESET MASTER;
+INSERT INTO t1 VALUES (10);
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
+master_user = "root", master_use_gtid = current_pos;
+START SLAVE UNTIL master_gtid_pos = '0-1-2';
+include/wait_for_slave_to_start.inc
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+10
+11
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+10
+11
+12
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION extract_gtid;
+include/rpl_end.inc
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 bdcff0d464d..22636e4172b 100644
--- a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
+++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
@@ -2,43 +2,44 @@ include/master-slave.inc
[connection master]
set @old_master_binlog_checksum= @@global.binlog_checksum;
set @old_slave_dbug= @@global.debug_dbug;
-CREATE TABLE t1 (a INT PRIMARY KEY);
-INSERT INTO t1 VALUES (0);
-# Test slave with no capability gets dummy event, which is ignored.
include/stop_slave.inc
+# Test slave with no capability gets dummy event, which is ignored.
SET @@global.debug_dbug='+d,simulate_slave_capability_none';
include/start_slave.inc
+FLUSH LOGS;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (0);
ALTER TABLE t1 ORDER BY a;
SET SESSION binlog_annotate_row_events = ON;
DELETE FROM t1;
INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1);
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # DELETE FROM t1
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1)
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Annotate_rows # # DELETE FROM t1
+master-bin.000002 # Table_map # # table_id: # (test.t1)
+master-bin.000002 # Delete_rows # # table_id: # flags: STMT_END_F
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Annotate_rows # # INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1)
+master-bin.000002 # Table_map # # table_id: # (test.t1)
+master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000002 # Query # # COMMIT
SELECT * FROM t1;
a
1
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # User var # # @`!dummyvar`=NULL
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Delete_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # # Dummy event replacing event type 160 that slave cannot handle.
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000005 # Query # # BEGIN
+slave-relay-bin.000005 # User var # # @`!dummyvar`=NULL
+slave-relay-bin.000005 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000005 # Delete_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000005 # Query # # COMMIT
+slave-relay-bin.000005 # Query # # BEGIN
+slave-relay-bin.000005 # Query # # # Dummy event replacing event type 160 that slave cannot handle.
+slave-relay-bin.000005 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000005 # Query # # COMMIT
set @@global.debug_dbug= @old_slave_dbug;
# Test dummy event is checksummed correctly.
set @@global.binlog_checksum = CRC32;
@@ -46,21 +47,21 @@ TRUNCATE t1;
INSERT INTO t1 VALUES(2);
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Gtid # # BEGIN GTID #-#-#
-master-bin.000002 # Annotate_rows # # INSERT INTO t1 VALUES(2)
-master-bin.000002 # Table_map # # table_id: # (test.t1)
-master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000002 # Query # # COMMIT
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Annotate_rows # # INSERT INTO t1 VALUES(2)
+master-bin.000003 # Table_map # # table_id: # (test.t1)
+master-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000003 # Query # # COMMIT
SELECT * FROM t1;
a
2
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Query # # BEGIN
-slave-relay-bin.000005 # Query # # # Dummy ev
-slave-relay-bin.000005 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000005 # Query # # COMMIT
+slave-relay-bin.000007 # Query # # BEGIN
+slave-relay-bin.000007 # Query # # # Dummy ev
+slave-relay-bin.000007 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000007 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000007 # Query # # COMMIT
# Test that slave which cannot tolerate holes in binlog stream but
# knows the event does not get dummy event
include/stop_slave.inc
@@ -70,21 +71,21 @@ ALTER TABLE t1 ORDER BY a;
UPDATE t1 SET a = 3;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Gtid # # BEGIN GTID #-#-#
-master-bin.000002 # Annotate_rows # # UPDATE t1 SET a = 3
-master-bin.000002 # Table_map # # table_id: # (test.t1)
-master-bin.000002 # Update_rows # # table_id: # flags: STMT_END_F
-master-bin.000002 # Query # # COMMIT
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Annotate_rows # # UPDATE t1 SET a = 3
+master-bin.000003 # Table_map # # table_id: # (test.t1)
+master-bin.000003 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000003 # Query # # COMMIT
SELECT * FROM t1;
a
3
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Query # # BEGIN
-slave-relay-bin.000006 # Annotate_rows # # UPDATE t1 SET a = 3
-slave-relay-bin.000006 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000006 # Update_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000006 # Query # # COMMIT
+slave-relay-bin.000008 # Query # # BEGIN
+slave-relay-bin.000008 # Annotate_rows # # UPDATE t1 SET a = 3
+slave-relay-bin.000008 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000008 # Update_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000008 # Query # # COMMIT
select @@global.log_slave_updates;
@@global.log_slave_updates
1
diff --git a/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-test/suite/rpl/r/rpl_sync.result
index 3e825a111aa..84c100970e4 100644
--- a/mysql-test/suite/rpl/r/rpl_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_sync.result
@@ -3,7 +3,7 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
-ALTER TABLE mysql.rpl_slave_state ENGINE=InnoDB;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
flush tables;
CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
insert into t1(a) values(1);
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
index becb284c0c2..070e0daa403 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -49,7 +49,7 @@ save_master_pos;
connection server_4;
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
--source include/start_slave.inc
sync_with_master;
SELECT * FROM t1 ORDER BY a;
@@ -60,7 +60,7 @@ connection server_2;
--source include/stop_slave.inc
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
--source include/start_slave.inc
connection server_4;
@@ -85,7 +85,7 @@ COMMIT;
connection server_3;
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
--source include/start_slave.inc
# This time, let's sync up without reference to binlog on D.
--let $wait_condition= SELECT COUNT(*) = 7 FROM t2
@@ -93,14 +93,18 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
SELECT * FROM t2 ORDER BY a;
--echo *** Now change everything back to what it was, to make rpl_end.inc happy
-# Also check that MASTER_USE_GTID=1 is still enabled.
+# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
connection server_2;
+# We need to sync up server_2 before switching. If it happened to have reached
+# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
+# server_1, which is (deliberately) missing that transaction.
+--let $wait_condition= SELECT COUNT(*) = 7 FROM t2
+--source include/wait_condition.inc
--source include/stop_slave.inc
--replace_result $MASTER_MYPORT MASTER_MYPORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
--source include/start_slave.inc
---let $wait_condition= SELECT COUNT(*) = 7 FROM t2
---source include/wait_condition.inc
+--source include/wait_for_slave_to_start.inc
connection server_3;
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
index 19fe20d0d56..2a9e0ef232a 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
@@ -14,7 +14,7 @@ call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
flush tables;
-ALTER TABLE mysql.rpl_slave_state ENGINE=InnoDB;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
--save_master_pos
@@ -24,7 +24,7 @@ INSERT INTO t1 VALUES (1, 0);
--source include/stop_slave.inc
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
--connection server_1
INSERT INTO t1 VALUES (2,1);
@@ -80,7 +80,7 @@ DROP TABLE t1;
--sync_with_master
--source include/stop_slave.inc
RESET MASTER;
-SET GLOBAL gtid_pos='';
+SET GLOBAL gtid_slave_pos='';
--connection server_1
RESET MASTER;
@@ -131,7 +131,7 @@ SELECT * FROM t1 ORDER BY a;
--echo *** Test crashing slave at various points and check that it recovers crash-safe. ***
-# Crash the slave just before updating mysql.rpl_slave_state table.
+# Crash the slave just before updating mysql.gtid_slave_pos table.
--source include/stop_slave.inc
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
wait
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
index 98b9e8373d5..f36f7fa8010 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
@@ -2,47 +2,47 @@
--source include/have_debug.inc
--source include/master-slave.inc
---echo *** Test that we check against incorrect table definition for mysql.rpl_slave_state ***
+--echo *** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
--connection master
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
--sync_slave_with_master
--connection slave
--source include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state CHANGE seq_no seq_no VARCHAR(20);
+ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no VARCHAR(20);
START SLAVE;
--connection master
INSERT INTO t1 VALUES (1);
--connection slave
-CALL mtr.add_suppression("Slave: Failed to open mysql.rpl_slave_state");
+CALL mtr.add_suppression("Slave: Failed to open mysql.gtid_slave_pos");
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
-ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
-ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (sub_id, domain_id);
+ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
+ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
+ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id, domain_id);
START SLAVE;
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
+ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
START SLAVE;
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (sub_id);
+ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id);
START SLAVE;
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
-ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
-ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (domain_id, sub_id);
+ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
+ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (domain_id, sub_id);
--source include/start_slave.inc
--connection master
@@ -69,13 +69,28 @@ INSERT INTO t1 VALUES (2);
SET sql_log_bin = 1;
INSERT INTO t1 VALUES (3);
-CHANGE MASTER TO master_use_gtid=1;
+CHANGE MASTER TO master_use_gtid=current_pos;
+# Most not change @@GLOBAL.gtid_slave_pos in the middle of a transaction.
+BEGIN;
+--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION
+SET GLOBAL gtid_slave_pos = "100-100-100";
+INSERT INTO t1 VALUES (100);
+--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION
+SET GLOBAL gtid_slave_pos = "100-100-100";
+ROLLBACK;
+
+# In gtid non-strict mode, we get warnings for setting @@gtid_slave_pos back
+# to earlier than what is in the binlog. In strict mode, we get an error.
+SET GLOBAL gtid_strict_mode= 1;
--error ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG
-SET GLOBAL gtid_pos = "0-1-1";
+SET GLOBAL gtid_slave_pos = "0-1-1";
--error ER_MASTER_GTID_POS_MISSING_DOMAIN
-SET GLOBAL gtid_pos = "";
+SET GLOBAL gtid_slave_pos = "";
+SET GLOBAL gtid_strict_mode= 0;
+SET GLOBAL gtid_slave_pos = "0-1-1";
+SET GLOBAL gtid_slave_pos = "";
RESET MASTER;
-SET GLOBAL gtid_pos = "0-1-1";
+SET GLOBAL gtid_slave_pos = "0-1-1";
START SLAVE;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
@@ -85,7 +100,7 @@ SELECT * FROM t1 ORDER BY a;
--echo *** Test slave requesting a GTID that is not present in the master's binlog ***
--source include/stop_slave.inc
-SET GLOBAL gtid_pos = "0-1-3";
+SET GLOBAL gtid_slave_pos = "0-1-3";
START SLAVE;
SET sql_log_bin=0;
@@ -98,7 +113,7 @@ SET sql_log_bin=1;
--let $rpl_only_running_threads= 1
--source include/stop_slave.inc
-SET GLOBAL gtid_pos = "0-1-2";
+SET GLOBAL gtid_slave_pos = "0-1-2";
START SLAVE;
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_master_promote.cnf b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.cnf
new file mode 100644
index 00000000000..4eafa897501
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.cnf
@@ -0,0 +1,35 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+loose-innodb
+
+[mysqld.2]
+log-slave-updates
+skip-slave-start
+loose-innodb
+
+[mysqld.3]
+log-slave-updates
+skip-slave-start
+loose-innodb
+
+[mysqld.4]
+log-slave-updates
+skip-slave-start
+loose-innodb
+
+[mysqld.5]
+log-slave-updates
+skip-slave-start
+loose-innodb
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
+
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYSOCK_4= @mysqld.4.socket
+
+SERVER_MYPORT_5= @mysqld.5.port
+SERVER_MYSOCK_5= @mysqld.5.socket
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test
new file mode 100644
index 00000000000..f3cc4aca135
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test
@@ -0,0 +1,267 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2, 1->3, 1->4, 1->5
+--source include/rpl_init.inc
+
+# Set up a topology with one master and 4 slaves.
+#
+# Replicate some events leaving the four slaves at different points
+# in different domains.
+#
+# Then promote one slave as new master, bringing it ahead of all others
+# using START SLAVE UNTIL master_gtid_pos.
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t4 (a INT, b INT, PRIMARY KEY (a,b)) Engine=InnoDB;
+
+# Function to extract one GTID from a list.
+delimiter |;
+CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100))
+ RETURNS VARCHAR(100) DETERMINISTIC
+BEGIN
+ SET s= CONCAT(",", s, ",");
+ SET s= SUBSTR(s FROM LOCATE(CONCAT(",", d, "-"), s) + 1);
+ SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
+ RETURN s;
+END|
+delimiter ;|
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+--connection server_3
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+--connection server_4
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+--connection server_5
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+
+# Create three separate replication streams on master server_1.
+#
+# Then use START SLAVE UNTIL to get the different streams interleaved
+# differently spread over multiple binlogs on the different slaves, to
+# test that new master promotion is able to deal with this.
+
+--connection server_1
+
+SET gtid_domain_id= 1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+--let $d1_begin= `SELECT extract_gtid("1", @@GLOBAL.gtid_binlog_pos)`
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t4 VALUES (1, 1);
+--let $d1_mid= `SELECT extract_gtid("1", @@GLOBAL.gtid_binlog_pos)`
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t4 VALUES (1, 3);
+--let $d1_end= `SELECT extract_gtid("1", @@GLOBAL.gtid_binlog_pos)`
+
+SET gtid_domain_id= 2;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+--let $d2_begin= `SELECT extract_gtid("2", @@GLOBAL.gtid_binlog_pos)`
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+INSERT INTO t4 VALUES (2, 1);
+--let $d2_mid= `SELECT extract_gtid("2", @@GLOBAL.gtid_binlog_pos)`
+INSERT INTO t2 VALUES (3);
+INSERT INTO t2 VALUES (4);
+INSERT INTO t4 VALUES (2, 3);
+--let $d2_end= `SELECT extract_gtid("2", @@GLOBAL.gtid_binlog_pos)`
+
+SET gtid_domain_id= 3;
+CREATE TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB;
+--let $d3_begin= `SELECT extract_gtid("3", @@GLOBAL.gtid_binlog_pos)`
+INSERT INTO t3 VALUES (1);
+INSERT INTO t3 VALUES (2);
+INSERT INTO t4 VALUES (3, 1);
+--let $d3_mid= `SELECT extract_gtid("3", @@GLOBAL.gtid_binlog_pos)`
+INSERT INTO t3 VALUES (3);
+INSERT INTO t3 VALUES (4);
+INSERT INTO t4 VALUES (3, 3);
+--let $d3_end= `SELECT extract_gtid("3", @@GLOBAL.gtid_binlog_pos)`
+
+
+# Slave server_2 (that will be promoted to master) is in the middle
+# of each stream.
+--connection server_2
+eval START SLAVE UNTIL master_gtid_pos= "$d1_mid,$d2_mid,$d3_mid";
+
+# The remaining slaves sit at different points each in different domains.
+--connection server_3
+eval START SLAVE UNTIL master_gtid_pos= "$d1_begin,$d2_mid,$d3_end";
+--connection server_4
+eval START SLAVE UNTIL master_gtid_pos= "$d2_begin,$d3_mid,$d1_end";
+--connection server_5
+eval START SLAVE UNTIL master_gtid_pos= "$d3_begin,$d1_mid,$d2_end";
+--connection server_2
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+--connection server_3
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+--connection server_4
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+--connection server_5
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+
+
+--echo *** Now replicate all extra changes from 3,4,5 to 2, in preparation for making 2 the new master. ***
+
+--connection server_3
+--let $server3_pos= `SELECT @@GLOBAL.gtid_slave_pos`
+--connection server_2
+--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
+eval START SLAVE UNTIL master_gtid_pos = "$server3_pos";
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+
+--connection server_4
+--let $server4_pos= `SELECT @@GLOBAL.gtid_slave_pos`
+--connection server_2
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4;
+eval START SLAVE UNTIL master_gtid_pos = "$server4_pos";
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+
+--connection server_5
+--let $server5_pos= `SELECT @@GLOBAL.gtid_slave_pos`
+--connection server_2
+--replace_result $SERVER_MYPORT_5 SERVER_MYPORT_5
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_5;
+eval START SLAVE UNTIL master_gtid_pos = "$server5_pos";
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+
+--echo *** Now make 2 master and point 3,4,5 to the new master 2
+--connection server_2
+SET gtid_domain_id= 1;
+INSERT INTO t1 values (5);
+INSERT INTO t4 values (1,5);
+SET gtid_domain_id= 2;
+INSERT INTO t2 values (5);
+INSERT INTO t4 values (2,5);
+SET gtid_domain_id= 3;
+INSERT INTO t3 values (5);
+INSERT INTO t4 values (3,5);
+
+--connection server_3
+--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2;
+--source include/start_slave.inc
+--connection server_4
+--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2;
+--source include/start_slave.inc
+--connection server_5
+--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2;
+--source include/start_slave.inc
+
+--connection server_2
+--save_master_pos
+
+--connection server_3
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+--connection server_5
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+--connection server_5
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+
+
+--echo *** Now let the old master join up as slave. ***
+--connection server_1
+--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
+ master_user = "root", master_use_gtid = current_pos;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a,b;
+
+
+--echo *** Finally move things back and clean up. ***
+--connection server_1
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+
+--connection server_2
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1;
+--source include/start_slave.inc
+--connection server_3
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1;
+--source include/start_slave.inc
+--connection server_4
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1;
+--source include/start_slave.inc
+--connection server_5
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1;
+--source include/start_slave.inc
+
+--connection server_1
+SET gtid_domain_id = 0;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+DROP FUNCTION extract_gtid;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test
index 549d11e9d1c..01259eb5765 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test
@@ -24,7 +24,7 @@ reset slave all;
connection server_1;
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
- master_user='root', MASTER_USE_GTID=1;
+ master_user='root', MASTER_USE_GTID=CURRENT_POS;
source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
@@ -38,7 +38,7 @@ save_master_pos;
connection server_3;
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
source include/start_slave.inc;
sync_with_master;
@@ -48,6 +48,7 @@ let $binlog_file=LAST;
source include/show_binlog_events.inc;
connection server_1;
+--sync_with_master
source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
reset slave all;
@@ -55,14 +56,14 @@ reset slave all;
connection server_2;
--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_USE_GTID=1;
+ master_user = 'root', MASTER_USE_GTID=CURRENT_POS;
source include/start_slave.inc;
connection server_3;
source include/stop_slave.inc;
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
source include/start_slave.inc;
connection server_1;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.cnf b/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.cnf
new file mode 100644
index 00000000000..2b9e70c59bc
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.cnf
@@ -0,0 +1,11 @@
+!include suite/rpl/rpl_1slave_base.cnf
+!include include/default_client.cnf
+
+
+[mysqld.1]
+log-slave-updates
+loose-innodb
+
+[mysqld.2]
+log-slave-updates
+loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test
new file mode 100644
index 00000000000..e6016b17717
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test
@@ -0,0 +1,76 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed_or_statement.inc
+--let $rpl_topology=1->2->1
+--source include/rpl_init.inc
+
+--echo #
+--echo # For now we'll only have 1->2 running
+
+--echo #
+--echo # Server 1
+--echo # Stop replication 2->1
+--connection server_1
+--source include/stop_slave.inc
+
+--echo #
+--echo # Server 2
+--echo # Use GTID for replication 1->2
+--connection server_2
+--source include/stop_slave.inc
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--echo #
+--echo # Create some 0-1-* and 0-2-* events in binlog of server 2
+
+--enable_connect_log
+
+--connection server_1
+create table t1 (i int) engine=InnoDB;
+insert into t1 values (1);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+create table t2 (i int) engine=InnoDB;
+--save_master_pos
+
+--connection server_1
+insert into t1 values (2);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+insert into t2 values (1);
+--save_master_pos
+
+--disable_connect_log
+
+--echo #
+--echo # All events are present in the binlog of server 2
+
+--source include/show_binlog_events.inc
+
+--echo #
+--echo # Server 1
+--echo # Start replication 2->1 using GTID,
+
+--connection server_1
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+--sync_with_master
+
+select * from t1 order by i;
+select * from t2 order by i;
+
+--connection server_2
+select * from t1 order by i;
+select * from t2 order by i;
+
+--connection server_1
+drop table t1;
+
+--connection server_2
+drop table t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
index d8073e19fb0..9c9c8090eba 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
@@ -26,7 +26,7 @@ INSERT INTO t1 VALUES (4, 2);
--connection server_1
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
- master_user = 'root', master_use_gtid = 1;
+ master_user = 'root', master_use_gtid = current_pos;
START SLAVE;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
--source include/wait_condition.inc
@@ -41,7 +41,7 @@ INSERT INTO t1 VALUES (6, 1);
--connection server_2
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- master_use_gtid = 1;
+ master_use_gtid = current_pos;
START SLAVE;
--let $wait_condition= SELECT COUNT(*) = 6 FROM t1
--source include/wait_condition.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
index c4390d3fccc..8dfb60b1b56 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
@@ -16,10 +16,10 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
--save_master_pos
--connection server_2
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
--source include/start_slave.inc
--sync_with_master
SELECT * FROM t1;
@@ -43,10 +43,10 @@ INSERT INTO t1 VALUES (2);
--source include/show_binary_logs.inc
--connection server_2
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
START SLAVE;
--let $slave_io_errno= 1236
--source include/wait_for_slave_io_error.inc
@@ -62,17 +62,17 @@ SET sql_log_bin=0;
call mtr.add_suppression('Could not find GTID state requested by slave in any binlog files');
SET sql_log_bin=1;
---echo *** Test that we give error when explict @@gtid_pos=xxx that conflicts with what is in our binary log ***
+--echo *** Test that we give warning when explict @@gtid_slave_pos=xxx that conflicts with what is in our binary log ***
--source include/stop_slave.inc
--connection server_1
INSERT INTO t1 VALUES(3);
--connection server_2
-SET GLOBAL gtid_pos='0-1-3';
+SET GLOBAL gtid_slave_pos='0-1-3';
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=1;
+ MASTER_USE_GTID=CURRENT_POS;
--source include/start_slave.inc
--let $wait_condition= SELECT COUNT(*) = 3 FROM t1
--source include/wait_condition.inc
@@ -84,15 +84,14 @@ INSERT INTO t1 VALUES (4);
--connection server_2
# Now add some local transactions that conflict with the GTID position
-# being set for GTID_POS.
+# being set for @@gtid_slave_pos.
INSERT INTO t1 VALUES (10);
DELETE FROM t1 WHERE a=10;
---error ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG
-SET GLOBAL gtid_pos='0-1-4';
+SET GLOBAL gtid_slave_pos='0-1-4';
# Try again after RESET MASTER to remove the conflicting binlog.
RESET MASTER;
-SET GLOBAL gtid_pos='0-1-4';
+SET GLOBAL gtid_slave_pos='0-1-4';
START SLAVE;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
--source include/wait_condition.inc
@@ -117,9 +116,9 @@ RESET MASTER;
RESET MASTER;
--connection server_2
-SET GLOBAL gtid_pos='';
+SET GLOBAL gtid_slave_pos='';
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root', master_use_gtid=1;
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root', master_use_gtid=current_pos;
--source include/start_slave.inc
--connection server_1
@@ -145,22 +144,21 @@ INSERT INTO t1 VALUES (2);
SELECT * FROM t1 ORDER BY a;
---echo *** MDEV-4329: GTID_POS='' is not checked for conflicts with binlog ***
+--echo *** MDEV-4329: GTID_SLAVE_POS='' is not checked for conflicts with binlog ***
# Test starting the slave completely from scratch, deleting all tables and
# replicating from the start of the master's binlog. This requires RESET
# MASTER is run on the slave to avoid old junk in the binlog. The bug was
# that the code did not catch the error of missing RESET MASTER when an
-# empty GTID_POS='' was specified.
+# empty GTID_SLAVE_POS='' was specified.
--connection server_2
--source include/stop_slave.inc
DROP TABLE t1;
RESET SLAVE;
---error ER_MASTER_GTID_POS_MISSING_DOMAIN
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
RESET MASTER;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
--source include/start_slave.inc
--sync_with_master
@@ -176,7 +174,7 @@ SET SQL_LOG_BIN=0;
DROP TABLE t1;
SET SQL_LOG_BIN=1;
RESET SLAVE;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
--source include/start_slave.inc
--sync_with_master
@@ -197,7 +195,7 @@ START SLAVE;
# Going back to using GTID should fix things.
STOP SLAVE IO_THREAD;
-CHANGE MASTER TO MASTER_USE_GTID=1;
+CHANGE MASTER TO MASTER_USE_GTID=CURRENT_POS;
--source include/start_slave.inc
--connection server_1
@@ -245,7 +243,7 @@ SELECT * FROM t1 ORDER BY a;
--connection server_2
--source include/stop_slave.inc
RESET MASTER;
-SET GLOBAL gtid_pos="";
+SET GLOBAL gtid_slave_pos="";
--connection server_1
RESET MASTER;
@@ -260,25 +258,24 @@ INSERT INTO t1 VALUES (10); # Will be GTID 0-1-2
SELECT * FROM t1;
--let $value= query_get_value(SHOW SLAVE STATUS, "Using_Gtid", 1)
eval SELECT '$value' AS Using_Gtid;
---let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
-eval SELECT '$value' AS Gtid_Pos;
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Slave_Pos", 1)
+eval SELECT '$value' AS Gtid_Slave_Pos;
UPDATE t1 SET a=9 WHERE a=10;
UPDATE t1 SET a=10 WHERE a=9;
---let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
-eval SELECT '$value' AS Gtid_Pos;
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Slave_Pos", 1)
+eval SELECT '$value' AS Gtid_Slave_Pos;
--source include/stop_slave.inc
---error ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG
-SET GLOBAL gtid_pos='0-1-2';
+SET GLOBAL gtid_slave_pos='0-1-2';
RESET MASTER;
---let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
-eval SELECT '$value' AS Gtid_Pos;
-SET GLOBAL gtid_pos='0-1-2';
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Slave_Pos", 1)
+eval SELECT '$value' AS Gtid_Slave_Pos;
+SET GLOBAL gtid_slave_pos='0-1-2';
--source include/start_slave.inc
---let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
-eval SELECT '$value' AS Gtid_Pos;
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Slave_Pos", 1)
+eval SELECT '$value' AS Gtid_Slave_Pos;
# Clean up.
--connection server_1
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
index 262d86a294e..0833dfe1224 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -15,7 +15,7 @@ INSERT INTO t1 VALUES (1);
--let $status_items= Master_Log_File,Using_Gtid
--source include/show_slave_status.inc
-CHANGE MASTER TO master_use_gtid=1;
+CHANGE MASTER TO master_use_gtid=current_pos;
# Now try to restart the slave mysqld server without starting the slave first
# threads after the CHANGE MASTER.
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_strict.test b/mysql-test/suite/rpl/t/rpl_gtid_strict.test
new file mode 100644
index 00000000000..afcb179da78
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_strict.test
@@ -0,0 +1,178 @@
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+SET sql_log_bin= 0;
+call mtr.add_suppression("Error writing file .*errno: 1950");
+
+SET sql_log_bin= 1;
+
+SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= 1;
+--connection server_2
+--source include/stop_slave.inc
+SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode=1;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--connection server_1
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--source include/show_binlog_events.inc
+
+SET server_id= 3;
+--error ER_GTID_STRICT_OUT_OF_ORDER
+SET gtid_seq_no= 3;
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 3;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+--error ER_GTID_STRICT_OUT_OF_ORDER
+INSERT INTO t1 VALUES (2);
+
+--error ER_GTID_STRICT_OUT_OF_ORDER
+SET gtid_seq_no= 2;
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 2;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+--error ER_GTID_STRICT_OUT_OF_ORDER
+INSERT INTO t1 VALUES (3);
+SET server_id= 1;
+SET gtid_seq_no= 4;
+INSERT INTO t1 VALUES (4);
+SELECT * FROM t1 ORDER BY 1;
+--source include/show_binlog_events.inc
+
+--echo *** Test non-transactional GTID error (cannot be rolled back). ***
+SET server_id= 3;
+--error ER_GTID_STRICT_OUT_OF_ORDER
+SET gtid_seq_no= 1;
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 1;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+--error ER_GTID_STRICT_OUT_OF_ORDER
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM;
+# The table is still created, DDL cannot be rolled back.
+# Fix it up for replication.
+SET sql_log_bin= 0;
+DROP TABLE t2;
+SET sql_log_bin= 1;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM;
+
+--error ER_GTID_STRICT_OUT_OF_ORDER
+SET gtid_seq_no= 1;
+SET SESSION debug_dbug="+d,ignore_set_gtid_seq_no_check";
+SET gtid_seq_no= 1;
+SET SESSION debug_dbug="-d,ignore_set_gtid_seq_no_check";
+--error ER_GTID_STRICT_OUT_OF_ORDER
+INSERT INTO t2 VALUES (1);
+# The value is still inserted, cannot be rolled back.
+SET server_id= 1;
+SET gtid_seq_no= 6;
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t2 ORDER BY a;
+--source include/show_binlog_events.inc
+
+
+--echo *** Test that slave stops if it tries to apply a GTID that would create out-of-order binlog GTID sequence numbers. ***
+
+--save_master_pos
+--connection server_2
+--sync_with_master
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SET sql_log_bin= 0;
+call mtr.add_suppression("An attempt was made to binlog GTID .* which would create an out-of-order sequence number with existing GTID .*, and gtid strict mode is enabled");
+call mtr.add_suppression("The binlog on the master is missing the GTID [-0-9]+ requested by the slave");
+SET sql_log_bin= 1;
+
+# Create some out-of-order stuff on slave.
+INSERT INTO t1 VALUES (5);
+
+--connection server_1
+INSERT INTO t1 VALUES (6);
+--save_master_pos
+
+--connection server_2
+--let $slave_sql_errno=1950
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_strict_mode=0;
+--source include/start_slave.inc
+--sync_with_master
+SET GLOBAL gtid_strict_mode=1;
+SELECT * FROM t1 ORDER BY a;
+
+INSERT INTO t1 VALUES (7);
+--connection server_1
+CREATE TABLE t3 (a INT PRIMARY KEY);
+--save_master_pos
+
+--connection server_2
+--let $slave_sql_errno=1950
+--source include/wait_for_slave_sql_error.inc
+--error ER_NO_SUCH_TABLE
+--query_vertical SHOW CREATE TABLE t3
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_strict_mode=0;
+--source include/start_slave.inc
+--sync_with_master
+SET GLOBAL gtid_strict_mode=1;
+--query_vertical SHOW CREATE TABLE t3
+
+INSERT INTO t1 VALUES (8);
+--connection server_1
+INSERT INTO t2 VALUES (3);
+--save_master_pos
+
+--connection server_2
+--let $slave_sql_errno=1950
+--source include/wait_for_slave_sql_error.inc
+SELECT * FROM t2 ORDER BY a;
+STOP SLAVE IO_THREAD;
+SET GLOBAL gtid_strict_mode=0;
+--source include/start_slave.inc
+--sync_with_master
+SET GLOBAL gtid_strict_mode=1;
+SELECT * FROM t2 ORDER BY a;
+
+
+--echo *** Check slave requests starting from a hole on the master. ***
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (10);
+SET gtid_seq_no= 100;
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+--save_master_pos
+
+--connection server_2
+SET GLOBAL gtid_slave_pos= "0-1-50";
+START SLAVE;
+--let $slave_io_errno=1236
+--source include/wait_for_slave_io_error.inc
+STOP SLAVE SQL_THREAD;
+SET GLOBAL gtid_strict_mode= 0;
+--source include/start_slave.inc
+--sync_with_master
+
+SELECT * FROM t1 ORDER BY a;
+SET GLOBAL gtid_strict_mode= 1;
+
+
+# Clean up.
+--connection server_1
+DROP TABLE t1, t2, t3;
+SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
+--connection server_2
+SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until.test b/mysql-test/suite/rpl/t/rpl_gtid_until.test
new file mode 100644
index 00000000000..68ebd464fd1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_until.test
@@ -0,0 +1,234 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+# Function to extract one GTID from a list.
+delimiter |;
+CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100))
+ RETURNS VARCHAR(100) DETERMINISTIC
+BEGIN
+ SET s= CONCAT(",", s, ",");
+ SET s= SUBSTR(s FROM LOCATE(CONCAT(",", d, "-"), s) + 1);
+ SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
+ RETURN s;
+END|
+delimiter ;|
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+# Both replication threads must be stopped for UNTIL master_gtid_pos.
+--error ER_SLAVE_WAS_RUNNING
+START SLAVE UNTIL master_gtid_pos = "";
+--source include/stop_slave_io.inc
+--error ER_SLAVE_WAS_RUNNING
+START SLAVE UNTIL master_gtid_pos = "";
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+--source include/stop_slave_sql.inc
+--error ER_SLAVE_WAS_RUNNING
+START SLAVE UNTIL master_gtid_pos = "";
+--source include/stop_slave_io.inc
+# UNTIL master_gtid_pos only valid if GTID is used.
+
+--error ER_UNTIL_REQUIRES_USING_GTID
+START SLAVE UNTIL master_gtid_pos = "";
+
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+--connection server_1
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+--let $gtid_pos=`SELECT @@GLOBAL.gtid_binlog_pos`
+INSERT INTO t1 VALUES(2);
+
+--connection server_2
+
+# Test various incorrect syntax for UNTIL master_gtid_pos.
+--error ER_DUPLICATE_GTID_DOMAIN
+START SLAVE UNTIL master_gtid_pos = "0-1-100,1-1-100,2-2-200,1-3-100,4-4-400";
+--error ER_PARSE_ERROR
+START SLAVE UNTIL master_log_file = "master-bin.000001", master_log_pos = 4, master_gtid_pos = "";
+--error ER_BAD_SLAVE_UNTIL_COND
+START SLAVE IO_THREAD UNTIL master_gtid_pos = "";
+--error ER_BAD_SLAVE_UNTIL_COND
+START SLAVE SQL_THREAD UNTIL master_gtid_pos = "";
+
+eval START SLAVE UNTIL master_gtid_pos = '$gtid_pos';
+
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1;
+
+--source include/start_slave.inc
+
+--connection server_1
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+# Test showing the UNTIL condition in SHOW SLAVE STATUS.
+--source include/stop_slave.inc
+START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200";
+--source include/wait_for_slave_to_start.inc
+--let $status_items= Using_Gtid,Until_Condition
+--source include/show_slave_status.inc
+
+# Clear the UNTIL condition.
+--source include/stop_slave.inc
+--source include/start_slave.inc
+
+
+--echo *** Test UNTIL condition in an earlier binlog than the start GTID. ***
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (3);
+SET gtid_domain_id = 2;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (3);
+--let $d1_point1= `SELECT extract_gtid("1", @@GLOBAL.gtid_binlog_pos)`
+--let $d2_point1= `SELECT extract_gtid("2", @@GLOBAL.gtid_binlog_pos)`
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (4);
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (4);
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (5);
+--let $d1_point2= `SELECT extract_gtid("1", @@GLOBAL.gtid_binlog_pos)`
+--let $d2_point2= `SELECT extract_gtid("2", @@GLOBAL.gtid_binlog_pos)`
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (5);
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (6);
+--let $d1_point3= `SELECT extract_gtid("1", @@GLOBAL.gtid_binlog_pos)`
+--let $d2_point3= `SELECT extract_gtid("2", @@GLOBAL.gtid_binlog_pos)`
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (6);
+SET gtid_domain_id = 0;
+--source include/show_binary_logs.inc
+--save_master_pos
+
+--connection server_2
+# Let the slave reach an middle point in domain 1 and a late point in domain 2.
+eval START SLAVE UNTIL master_gtid_pos='$d1_point2,$d2_point3';
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+# Now test starting at a middle point in the binlogs when the stop position in
+# one domain (domain 2) is early.
+eval START SLAVE UNTIL master_gtid_pos='$d1_point3,$d2_point1';
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+# Test that one UNTIL domain empty means stop that domain immediately.
+eval START SLAVE UNTIL master_gtid_pos='$d1_point2';
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Test when the UNTIL position is right at the end of the binlog file prior to the starting position ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+FLUSH LOGS;
+SET gtid_domain_id = 1;
+INSERT INTO t1 VALUES (7);
+SET gtid_domain_id = 0;
+--save_master_pos
+
+--connection server_2
+eval START SLAVE UNTIL master_gtid_pos='$d1_point3';
+--source include/wait_for_slave_to_stop.inc
+# This should not show row 7, as we requested stop just before it.
+SELECT * FROM t1 ORDER BY a;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+
+--echo *** Test when UNTIL condition is after a stand-alone event (not a transaction). ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+CREATE TABLE t3 (a INT);
+--let $until_condition=`SELECT @@GLOBAL.gtid_binlog_pos`
+DROP TABLE t3;
+--save_master_pos
+
+--connection server_2
+eval START SLAVE UNTIL master_gtid_pos='$until_condition';
+--source include/wait_for_slave_to_stop.inc
+SHOW CREATE TABLE t3;
+--source include/start_slave.inc
+--sync_with_master
+
+--echo *** Test UNTIL condition that has not yet been logged. ***
+
+--connection server_2
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+RESET MASTER;
+SET GLOBAL gtid_slave_pos='';
+
+--connection server_1
+# Do it once to compute the right GTID, then throw it away and do it again
+# for the actual test.
+RESET MASTER;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+--let $until_condition=`SELECT @@GLOBAL.gtid_binlog_pos`
+INSERT INTO t1 VALUES (12);
+DELETE FROM t1 WHERE a >= 10;
+
+RESET MASTER;
+INSERT INTO t1 VALUES (10);
+
+--connection server_2
+--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_use_gtid = current_pos;
+eval START SLAVE UNTIL master_gtid_pos = '$until_condition';
+--source include/wait_for_slave_to_start.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+--save_master_pos
+
+--connection server_2
+# This then should wait until it gets the row (11) and then stop, not
+# yet having the row (12).
+--source include/wait_for_slave_to_stop.inc
+SELECT * FROM t1 ORDER BY a;
+--source include/start_slave.inc
+--sync_with_master
+# And now the row (12) should be there.
+SELECT * FROM t1 ORDER BY a;
+
+
+# Clean up.
+--connection server_1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION extract_gtid;
+
+--source include/rpl_end.inc
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 b8ca409e25b..99a371eac44 100644
--- a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
+++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
@@ -6,16 +6,23 @@ connection master;
set @old_master_binlog_checksum= @@global.binlog_checksum;
set @old_slave_dbug= @@global.debug_dbug;
-CREATE TABLE t1 (a INT PRIMARY KEY);
-INSERT INTO t1 VALUES (0);
-sync_slave_with_master;
+# MDEV-4475: Cannot replicate to old server when binlog contains
+# empty Gtid_list event
+#
+# Test this by binlog rotation before we log any GTIDs.
connection slave;
-
---echo # Test slave with no capability gets dummy event, which is ignored.
--source include/stop_slave.inc
+--echo # Test slave with no capability gets dummy event, which is ignored.
SET @@global.debug_dbug='+d,simulate_slave_capability_none';
--source include/start_slave.inc
+
+connection master;
+FLUSH LOGS;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (0);
+sync_slave_with_master;
+
connection master;
# Add a dummy event just to have something to sync_slave_with_master on.
# Otherwise we occasionally get different $relaylog_start, depending on
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
index f2f73d59086..820ec19925f 100644
--- a/mysql-test/suite/rpl/t/rpl_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -36,7 +36,7 @@
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
# Use innodb so we do not get "table should be repaired" issues.
-ALTER TABLE mysql.rpl_slave_state ENGINE=InnoDB;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
flush tables;
CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
diff --git a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
index cf067c7e7b6..56522566ec9 100644
--- a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
@@ -1,30 +1,34 @@
SET @start_global_value = @@global.aria_sort_buffer_size;
select @@global.aria_sort_buffer_size;
@@global.aria_sort_buffer_size
-134217728
+268434432
select @@session.aria_sort_buffer_size;
@@session.aria_sort_buffer_size
-134217728
+268434432
show global variables like 'aria_sort_buffer_size';
Variable_name Value
-aria_sort_buffer_size 134217728
+aria_sort_buffer_size 268434432
show session variables like 'aria_sort_buffer_size';
Variable_name Value
-aria_sort_buffer_size 134217728
+aria_sort_buffer_size 268434432
select * from information_schema.global_variables where variable_name='aria_sort_buffer_size';
VARIABLE_NAME VARIABLE_VALUE
-ARIA_SORT_BUFFER_SIZE 134217728
+ARIA_SORT_BUFFER_SIZE 268434432
select * from information_schema.session_variables where variable_name='aria_sort_buffer_size';
VARIABLE_NAME VARIABLE_VALUE
-ARIA_SORT_BUFFER_SIZE 134217728
+ARIA_SORT_BUFFER_SIZE 268434432
set global aria_sort_buffer_size=10;
+Warnings:
+Warning 1292 Truncated incorrect aria_sort_buffer_size value: '10'
select @@global.aria_sort_buffer_size;
@@global.aria_sort_buffer_size
-10
+4096
set session aria_sort_buffer_size=10;
+Warnings:
+Warning 1292 Truncated incorrect aria_sort_buffer_size value: '10'
select @@session.aria_sort_buffer_size;
@@session.aria_sort_buffer_size
-10
+4096
set global aria_sort_buffer_size=1.1;
ERROR 42000: Incorrect argument type to variable 'aria_sort_buffer_size'
set session aria_sort_buffer_size=1e1;
@@ -36,7 +40,7 @@ Warnings:
Warning 1292 Truncated incorrect aria_sort_buffer_size value: '0'
select @@global.aria_sort_buffer_size;
@@global.aria_sort_buffer_size
-4
+4096
set session aria_sort_buffer_size=cast(-1 as unsigned int);
select @@session.aria_sort_buffer_size;
@@session.aria_sort_buffer_size
diff --git a/mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result
new file mode 100644
index 00000000000..6d9d0ec449d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result
@@ -0,0 +1,9 @@
+SET GLOBAL gtid_binlog_pos= '';
+ERROR HY000: Variable 'gtid_binlog_pos' is a read only variable
+SELECT variable_name FROM information_schema.global_variables
+WHERE variable_name='gtid_binlog_pos';
+variable_name
+GTID_BINLOG_POS
+SELECT @@gtid_binlog_pos;
+SELECT @@session.gtid_binlog_pos;
+ERROR HY000: Variable 'gtid_binlog_pos' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result
new file mode 100644
index 00000000000..3ddc20d9b8c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result
@@ -0,0 +1,9 @@
+SET GLOBAL gtid_current_pos= '';
+ERROR HY000: Variable 'gtid_current_pos' is a read only variable
+SELECT variable_name FROM information_schema.global_variables
+WHERE variable_name='gtid_current_pos';
+variable_name
+GTID_CURRENT_POS
+SELECT @@gtid_current_pos;
+SELECT @@session.gtid_current_pos;
+ERROR HY000: Variable 'gtid_current_pos' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/gtid_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_pos_basic.result
deleted file mode 100644
index b97db1b657e..00000000000
--- a/mysql-test/suite/sys_vars/r/gtid_pos_basic.result
+++ /dev/null
@@ -1,47 +0,0 @@
-SET @old_gtid_pos= @@gtid_pos;
-SET GLOBAL gtid_pos= '';
-SELECT @@gtid_pos;
-@@gtid_pos
-
-SET GLOBAL gtid_pos= '1-2-3';
-SELECT variable_value FROM information_schema.global_variables
-WHERE variable_name='gtid_pos';
-variable_value
-1-2-3
-SET @@global.gtid_pos= '1-2-4';
-SELECT @@gtid_pos;
-@@gtid_pos
-1-2-4
-SET GLOBAL gtid_pos= ' 1-2-3';
-SELECT @@gtid_pos;
-@@gtid_pos
-1-2-3
-SET GLOBAL gtid_pos= '1-2-3, 2-4-6';
-SELECT @@gtid_pos;
-@@gtid_pos
-1-2-3,2-4-6
-SET GLOBAL gtid_pos= '-1-2-3';
-ERROR HY000: Could not parse GTID list for GTID_POS
-SET GLOBAL gtid_pos= '1-2 -3';
-ERROR HY000: Could not parse GTID list for GTID_POS
-SET GLOBAL gtid_pos= '1-2-3 ';
-ERROR HY000: Could not parse GTID list for GTID_POS
-SET GLOBAL gtid_pos= '1-2-3,2-4';
-ERROR HY000: Could not parse GTID list for GTID_POS
-SET GLOBAL gtid_pos= '0-1-10,0-2-20';
-ERROR HY000: GTID 0-2-20 and 0-1-10 conflict (duplicate domain id 0)
-SET GLOBAL gtid_pos= '0-1-10,1-2-20,2-3-30,1-20-200,3-4-1';
-ERROR HY000: GTID 1-20-200 and 1-2-20 conflict (duplicate domain id 1)
-SET gtid_pos= '';
-ERROR HY000: Variable 'gtid_pos' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_pos= '';
-ERROR HY000: Variable 'gtid_pos' is a GLOBAL variable and should be set with SET GLOBAL
-SET GLOBAL gtid_pos= '1-2-3,2-4-6';
-SELECT @@gtid_pos;
-@@gtid_pos
-1-2-3,2-4-6
-SET GLOBAL gtid_pos= DEFAULT;
-ERROR 42000: Variable 'gtid_pos' doesn't have a default value
-SELECT @@session.gtid_pos;
-ERROR HY000: Variable 'gtid_pos' is a GLOBAL variable
-SET GLOBAL gtid_pos= @old_gtid_pos;
diff --git a/mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result
new file mode 100644
index 00000000000..e3ef59b7e30
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result
@@ -0,0 +1,47 @@
+SET @old_gtid_slave_pos= @@gtid_slave_pos;
+SET GLOBAL gtid_slave_pos= '';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+
+SET GLOBAL gtid_slave_pos= '1-2-3';
+SELECT variable_value FROM information_schema.global_variables
+WHERE variable_name='gtid_slave_pos';
+variable_value
+1-2-3
+SET @@global.gtid_slave_pos= '1-2-4';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-4
+SET GLOBAL gtid_slave_pos= ' 1-2-3';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-3
+SET GLOBAL gtid_slave_pos= '1-2-3, 2-4-6';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-3,2-4-6
+SET GLOBAL gtid_slave_pos= '-1-2-3';
+ERROR HY000: Could not parse GTID list for GTID_POS
+SET GLOBAL gtid_slave_pos= '1-2 -3';
+ERROR HY000: Could not parse GTID list for GTID_POS
+SET GLOBAL gtid_slave_pos= '1-2-3 ';
+ERROR HY000: Could not parse GTID list for GTID_POS
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4';
+ERROR HY000: Could not parse GTID list for GTID_POS
+SET GLOBAL gtid_slave_pos= '0-1-10,0-2-20';
+ERROR HY000: GTID 0-2-20 and 0-1-10 conflict (duplicate domain id 0)
+SET GLOBAL gtid_slave_pos= '0-1-10,1-2-20,2-3-30,1-20-200,3-4-1';
+ERROR HY000: GTID 1-20-200 and 1-2-20 conflict (duplicate domain id 1)
+SET gtid_slave_pos= '';
+ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
+SET SESSION gtid_slave_pos= '';
+ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4-6';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-3,2-4-6
+SET GLOBAL gtid_slave_pos= DEFAULT;
+ERROR 42000: Variable 'gtid_slave_pos' doesn't have a default value
+SELECT @@session.gtid_slave_pos;
+ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable
+SET GLOBAL gtid_slave_pos= @old_gtid_slave_pos;
diff --git a/mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result b/mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result
new file mode 100644
index 00000000000..25afe97f4c9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result
@@ -0,0 +1,29 @@
+select @@global.gtid_strict_mode;
+@@global.gtid_strict_mode
+0
+select @@session.gtid_strict_mode;
+ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable
+show global variables like 'gtid_strict_mode';
+Variable_name Value
+gtid_strict_mode OFF
+show session variables like 'gtid_strict_mode';
+Variable_name Value
+gtid_strict_mode OFF
+select * from information_schema.global_variables where variable_name='gtid_strict_mode';
+VARIABLE_NAME VARIABLE_VALUE
+GTID_STRICT_MODE OFF
+select * from information_schema.session_variables where variable_name='gtid_strict_mode';
+VARIABLE_NAME VARIABLE_VALUE
+GTID_STRICT_MODE OFF
+SET @old= @@GLOBAL.gtid_strict_mode;
+set global gtid_strict_mode=1;
+select @@global.gtid_strict_mode;
+@@global.gtid_strict_mode
+1
+set global gtid_strict_mode=0;
+select @@global.gtid_strict_mode;
+@@global.gtid_strict_mode
+0
+set global gtid_strict_mode=@old;
+set session gtid_strict_mode=1;
+ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable and should be set with SET GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
index 85482be9ad4..932d06668fb 100644
--- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
@@ -1,11 +1,11 @@
SET @start_global_value = @@global.myisam_sort_buffer_size ;
SELECT @start_global_value;
@start_global_value
-8388608
+134216704
SET @start_session_value = @@session.myisam_sort_buffer_size ;
SELECT @start_session_value;
@start_session_value
-8388608
+134216704
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.myisam_sort_buffer_size = 100;
Warnings:
@@ -13,22 +13,22 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100'
SET @@global.myisam_sort_buffer_size = DEFAULT;
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
-8388608
+134216704
SET @@session.myisam_sort_buffer_size = 200;
Warnings:
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200'
SET @@session.myisam_sort_buffer_size = DEFAULT;
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
-8388608
+134216704
'#--------------------FN_DYNVARS_005_02-------------------------#'
SET @@global.myisam_sort_buffer_size = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size = 8388608;
-@@global.myisam_sort_buffer_size = 8388608
+SELECT @@global.myisam_sort_buffer_size = 134216704;
+@@global.myisam_sort_buffer_size = 134216704
1
SET @@session.myisam_sort_buffer_size = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size = 8388608;
-@@session.myisam_sort_buffer_size = 8388608
+SELECT @@session.myisam_sort_buffer_size = 134216704;
+@@session.myisam_sort_buffer_size = 134216704
1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.myisam_sort_buffer_size = 4;
@@ -187,8 +187,8 @@ ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list'
SET @@global.myisam_sort_buffer_size = @start_global_value;
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
-8388608
+134216704
SET @@session.myisam_sort_buffer_size = @start_session_value;
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
-8388608
+134216704
diff --git a/mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test
new file mode 100644
index 00000000000..452132653fc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test
@@ -0,0 +1,15 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL gtid_binlog_pos= '';
+SELECT variable_name FROM information_schema.global_variables
+ WHERE variable_name='gtid_binlog_pos';
+
+# The value of the variable depends on the binary log, this is tested extensively
+# elsewhere in rpl.rpl_gtid*.test
+--disable_result_log
+SELECT @@gtid_binlog_pos;
+--enable_result_log
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_binlog_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test
new file mode 100644
index 00000000000..9aac7ad7c10
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test
@@ -0,0 +1,15 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL gtid_current_pos= '';
+SELECT variable_name FROM information_schema.global_variables
+ WHERE variable_name='gtid_current_pos';
+
+# The value of the variable depends on the binary log, this is tested extensively
+# elsewhere in rpl.rpl_gtid*.test
+--disable_result_log
+SELECT @@gtid_current_pos;
+--enable_result_log
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_current_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_pos_basic.test
deleted file mode 100644
index 929fdebed20..00000000000
--- a/mysql-test/suite/sys_vars/t/gtid_pos_basic.test
+++ /dev/null
@@ -1,46 +0,0 @@
---source include/not_embedded.inc
-
-SET @old_gtid_pos= @@gtid_pos;
-
-SET GLOBAL gtid_pos= '';
-SELECT @@gtid_pos;
-SET GLOBAL gtid_pos= '1-2-3';
-SELECT variable_value FROM information_schema.global_variables
- WHERE variable_name='gtid_pos';
-SET @@global.gtid_pos= '1-2-4';
-SELECT @@gtid_pos;
-
-SET GLOBAL gtid_pos= ' 1-2-3';
-SELECT @@gtid_pos;
-SET GLOBAL gtid_pos= '1-2-3, 2-4-6';
-SELECT @@gtid_pos;
-
---error ER_INCORRECT_GTID_STATE
-SET GLOBAL gtid_pos= '-1-2-3';
---error ER_INCORRECT_GTID_STATE
-SET GLOBAL gtid_pos= '1-2 -3';
---error ER_INCORRECT_GTID_STATE
-SET GLOBAL gtid_pos= '1-2-3 ';
---error ER_INCORRECT_GTID_STATE
-SET GLOBAL gtid_pos= '1-2-3,2-4';
-
---error ER_DUPLICATE_GTID_DOMAIN
-SET GLOBAL gtid_pos= '0-1-10,0-2-20';
---error ER_DUPLICATE_GTID_DOMAIN
-SET GLOBAL gtid_pos= '0-1-10,1-2-20,2-3-30,1-20-200,3-4-1';
-
---error ER_GLOBAL_VARIABLE
-SET gtid_pos= '';
---error ER_GLOBAL_VARIABLE
-SET SESSION gtid_pos= '';
-
-SET GLOBAL gtid_pos= '1-2-3,2-4-6';
-SELECT @@gtid_pos;
-
---error ER_NO_DEFAULT
-SET GLOBAL gtid_pos= DEFAULT;
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.gtid_pos;
-
-SET GLOBAL gtid_pos= @old_gtid_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
new file mode 100644
index 00000000000..d021e335b86
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
@@ -0,0 +1,46 @@
+--source include/not_embedded.inc
+
+SET @old_gtid_slave_pos= @@gtid_slave_pos;
+
+SET GLOBAL gtid_slave_pos= '';
+SELECT @@gtid_slave_pos;
+SET GLOBAL gtid_slave_pos= '1-2-3';
+SELECT variable_value FROM information_schema.global_variables
+ WHERE variable_name='gtid_slave_pos';
+SET @@global.gtid_slave_pos= '1-2-4';
+SELECT @@gtid_slave_pos;
+
+SET GLOBAL gtid_slave_pos= ' 1-2-3';
+SELECT @@gtid_slave_pos;
+SET GLOBAL gtid_slave_pos= '1-2-3, 2-4-6';
+SELECT @@gtid_slave_pos;
+
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '-1-2-3';
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '1-2 -3';
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '1-2-3 ';
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4';
+
+--error ER_DUPLICATE_GTID_DOMAIN
+SET GLOBAL gtid_slave_pos= '0-1-10,0-2-20';
+--error ER_DUPLICATE_GTID_DOMAIN
+SET GLOBAL gtid_slave_pos= '0-1-10,1-2-20,2-3-30,1-20-200,3-4-1';
+
+--error ER_GLOBAL_VARIABLE
+SET gtid_slave_pos= '';
+--error ER_GLOBAL_VARIABLE
+SET SESSION gtid_slave_pos= '';
+
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4-6';
+SELECT @@gtid_slave_pos;
+
+--error ER_NO_DEFAULT
+SET GLOBAL gtid_slave_pos= DEFAULT;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_slave_pos;
+
+SET GLOBAL gtid_slave_pos= @old_gtid_slave_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test b/mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test
new file mode 100644
index 00000000000..c6287dcd6bc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test
@@ -0,0 +1,21 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.gtid_strict_mode;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.gtid_strict_mode;
+show global variables like 'gtid_strict_mode';
+show session variables like 'gtid_strict_mode';
+select * from information_schema.global_variables where variable_name='gtid_strict_mode';
+select * from information_schema.session_variables where variable_name='gtid_strict_mode';
+
+SET @old= @@GLOBAL.gtid_strict_mode;
+set global gtid_strict_mode=1;
+select @@global.gtid_strict_mode;
+set global gtid_strict_mode=0;
+select @@global.gtid_strict_mode;
+set global gtid_strict_mode=@old;
+
+--error ER_GLOBAL_VARIABLE
+set session gtid_strict_mode=1;
diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test
index c35949ac5f3..1aa25fa2c8e 100644
--- a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test
@@ -60,10 +60,10 @@ SELECT @@session.myisam_sort_buffer_size ;
########################################################################
SET @@global.myisam_sort_buffer_size = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size = 8388608;
+SELECT @@global.myisam_sort_buffer_size = 134216704;
SET @@session.myisam_sort_buffer_size = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size = 8388608;
+SELECT @@session.myisam_sort_buffer_size = 134216704;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 8323890b028..6c9371eed25 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1600,6 +1600,7 @@ INSERT INTO t1 SELECT a+1280,b FROM t1;
INSERT INTO t1 SELECT a+2560,b FROM t1;
INSERT INTO t1 SELECT a+5120,b FROM t1;
SET myisam_sort_buffer_size=4;
+--replace_regex /Current myisam_sort_buffer_size.*/X/
REPAIR TABLE t1;
SET myisam_repair_threads=2;
@@ -1648,6 +1649,7 @@ DROP TABLE t1, t2, t3;
CREATE TABLE t1(a CHAR(255), KEY(a));
SELECT * FROM t1, t1 AS a1;
SET myisam_sort_buffer_size=4;
+--replace_regex /Current myisam_sort_buffer_size.*/X/
INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test
index 3c55f06ff4c..6536c052019 100644
--- a/mysql-test/t/repair.test
+++ b/mysql-test/t/repair.test
@@ -61,6 +61,7 @@ DROP TABLE t1;
#
CREATE TABLE t1(a CHAR(255), KEY(a));
SET myisam_sort_buffer_size=4096;
+--replace_regex /Current myisam_sort_buffer_size.*/X/
INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
@@ -79,6 +80,7 @@ INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0');
SET myisam_repair_threads=2;
+--replace_regex /Current myisam_sort_buffer_size.*/X/
REPAIR TABLE t1;
SET myisam_repair_threads=@@global.myisam_repair_threads;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test
index 9a22fdb409a..1b89ea2001b 100644
--- a/mysql-test/t/system_mysql_db_fix40123.test
+++ b/mysql-test/t/system_mysql_db_fix40123.test
@@ -78,7 +78,7 @@ CREATE TABLE index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) N
-- disable_query_log
# Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, rpl_slave_state, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats, slave_worker_info, table_stats, column_stats, index_stats;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, gtid_slave_pos, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats, slave_worker_info, table_stats, column_stats, index_stats;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test
index 2149025a730..454711a93e6 100644
--- a/mysql-test/t/system_mysql_db_fix50030.test
+++ b/mysql-test/t/system_mysql_db_fix50030.test
@@ -85,7 +85,7 @@ CREATE TABLE index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) N
-- disable_query_log
# Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, rpl_slave_state, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats, slave_worker_info, table_stats, column_stats, index_stats;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, gtid_slave_pos, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats, slave_worker_info, table_stats, column_stats, index_stats;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test
index 1a156d67f19..af1bcf2a6e0 100644
--- a/mysql-test/t/system_mysql_db_fix50117.test
+++ b/mysql-test/t/system_mysql_db_fix50117.test
@@ -104,7 +104,7 @@ CREATE TABLE index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) N
-- disable_query_log
# Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, rpl_slave_state, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats, slave_worker_info, table_stats, column_stats, index_stats;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, gtid_slave_pos, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats, slave_worker_info, table_stats, column_stats, index_stats;
-- enable_query_log