summaryrefslogtreecommitdiff
path: root/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test')
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test
new file mode 100644
index 00000000000..9c79925b4bd
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test
@@ -0,0 +1,43 @@
+#
+# Purpose:
+# This test validates that GTIDs are ordered when mysqlbinlog outputs
+# Gtid_list events.
+#
+# Methodology:
+# Write multiple events to the binlog with different domain ids and server
+# ids, and ensure that the Gtid_list event GTIDs are ordered first by domain id
+# (ascending), and then sequence number (ascending).
+#
+# References:
+# MDEV-4989: Support for GTID in mysqlbinlog
+#
+--source include/have_log_bin.inc
+
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.server_id= 1;
+INSERT INTO t2 VALUES (1);
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+FLUSH LOGS;
+
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/tmp_binlog.out
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > SEARCH_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $SEARCH_FILE
+
+--let SEARCH_PATTERN= Gtid list \[0-1-1,\n# 1-2-1,\n# 1-1-2,\n# 2-3-1\]
+--source include/search_pattern_in_file.inc
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;