List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:February 2 2012 6:42pm
Subject:bzr push into mysql-trunk-wl3584 branch (andrei.elkin:3591 to 3592) WL#3584
View as plain text  
 3592 Andrei Elkin	2012-02-02
      wl#3584 GTID
      
      A feature test to cover mysqlbinlog with the options is improved.
     @ mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test
        The test is supposed to run on GTID-enabled servers.
        Syntax and correctness of handling --*gtid* options is verified.

    added:
      mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt
      mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt
    renamed:
      mysql-test/suite/rpl/t/rpl_group_mysqlbinlog.test => mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test
    modified:
      mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test
 3591 Sven Sandberg	2012-02-02
      WL#3584 bugfixes
       - Add assertions
       - Make disable_gtid_unsafe_statements ineffective when sql_log_bin=0
       - Test one more error condition related to GTID_NEXT.
     @ mysql-test/suite/binlog/r/binlog_disable_gtid_unsafe_statements.result
        update result file
     @ mysql-test/suite/binlog/r/binlog_gtid_errors.result
        update result file
     @ mysql-test/suite/binlog/t/binlog_disable_gtid_unsafe_statements.test
        Test that disable_gtid_unsafe_statements is
        ineffective when sql_log_bin = 0.
     @ mysql-test/suite/binlog/t/binlog_gtid_errors.test
        Test one more error case.
     @ sql/binlog.cc
        The restrictions imposed by disable_gtid_unsafe_statements
        should not apply when sql_log_bin = 0.
     @ sql/rpl_gtid_set.cc
        Add assertions.

    modified:
      mysql-test/suite/binlog/r/binlog_disable_gtid_unsafe_statements.result
      mysql-test/suite/binlog/r/binlog_gtid_errors.result
      mysql-test/suite/binlog/t/binlog_disable_gtid_unsafe_statements.test
      mysql-test/suite/binlog/t/binlog_gtid_errors.test
      sql/binlog.cc
      sql/rpl_gtid_set.cc
=== added file 'mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt	2012-02-02 18:41:01 +0000
@@ -0,0 +1 @@
+--log-bin --gtid-mode=on  --log-slave-updates --disable-gtid-unsafe-statements

=== added file 'mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt	2012-02-02 18:41:01 +0000
@@ -0,0 +1 @@
+--log-bin --gtid-mode=on  --log-slave-updates --disable-gtid-unsafe-statements

=== renamed file 'mysql-test/suite/rpl/t/rpl_group_mysqlbinlog.test' => 'mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test'
--- a/mysql-test/suite/rpl/t/rpl_group_mysqlbinlog.test	2012-01-11 07:29:43 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test	2012-02-02 18:41:01 +0000
@@ -1,51 +1,87 @@
---source include/have_binlog_format_row.inc
-
+#
+# WL#3584 GTID
+# The test verifies how mysqlbinlog handles GTID related options.
+#
 --source include/master-slave.inc
---source include/not_gtid_enabled.inc
+--source include/have_gtid.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+
+# Replication link is implemented through 
+# mysqlbinlog | mysql | slave pipe
+# the test call master-slave.inc to get connections to either server.
 
-######## Generate some data on master ########
+--connection slave
+--source include/stop_slave.inc
 
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (2);
-INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-# note: CREATE...SELECT will be logged as two groups on slave
-CREATE TABLE t5 SELECT * FROM t1;
-SET GTID_NEXT = 'ANONYMOUS';
-INSERT INTO t1 VALUES (0);
-INSERT INTO t1 VALUES (6);
-INSERT INTO t1 VALUES (7);
+--connection master
+### Generate some data on the master  ###
 
-######## Sync to slave ########
+# example of a DDL
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) engine=Innodb;
 
---sync_slave_with_master
+# Single-statement transaction
+SET @@SESSION.AUTOCOMMIT= ON;
+INSERT INTO t1 VALUES (NULL);
+
+# Multi-statement transaction
+BEGIN;
+  INSERT INTO t1 VALUES (NULL);
+  INSERT INTO t1 VALUES (NULL);
+COMMIT;
+
+#
+# Verification actions include
+# restoring t1 from binlog and checking data consistency
+#
 
 --let $server_uuid= `SELECT @@GLOBAL.SERVER_UUID`
 --let $datadir= `SELECT @@datadir`
 --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
 
-######## See output from mysqlbinlog ########
-
 --echo ================ FULL FILE ================
---exec $MYSQL_BINLOG $datadir/$binlog_file | grep '^# Subgroup'
---exec $MYSQL_BINLOG $datadir/$binlog_file
+--exec $MYSQL_BINLOG $datadir/$binlog_file | $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+
+
+--echo ================ --include-gtid ============
+
+INSERT INTO t1 VALUES (NULL) /* 4 */;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+
+#
+# TODO: discuss `:' to `,' change as the comma is the first thing that comes to 
+# anyone's mind when talking on a list of items.
+#
+--exec $MYSQL_BINLOG --include-gtid=$server_uuid:4-5:6 $datadir/$binlog_file | $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT
+
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
 
---echo ================ 2,4-5 ================
---exec $MYSQL_BINLOG --include-gtid=$server_uuid:2:4-5 $datadir/$binlog_file | grep '^# Subgroup'
---exec $MYSQL_BINLOG --include-gtid=$server_uuid:2:4-5 $datadir/$binlog_file
-
---echo ================ 1,3,ANON ================
---exec $MYSQL_BINLOG --exclude-gtid=$server_uuid:2:4-5 $datadir/$binlog_file | grep '^# Subgroup'
---exec $MYSQL_BINLOG --exclude-gtid=$server_uuid:2:4-5 $datadir/$binlog_file
-
---echo ================ 1,3,ANON ================
---exec $MYSQL_BINLOG --include-gtid=$server_uuid:1,ANONYMOUS,$server_uuid:3 $datadir/$binlog_file | grep '^# Subgroup'
---exec $MYSQL_BINLOG --include-gtid=$server_uuid:1,ANONYMOUS,$server_uuid:3 $datadir/$binlog_file
-
---echo ================ 2-5 ================
---exec $MYSQL_BINLOG --first-lgid=2 --last-lgid=5 $datadir/$binlog_file | grep '^# Subgroup'
---exec $MYSQL_BINLOG --first-lgid=2 --last-lgid=5 $datadir/$binlog_file
+INSERT INTO t1 VALUES (NULL) /* 7 */;
+INSERT INTO t1 VALUES (NULL);
+
+--echo ================ --skip-gtid ================
+
+INSERT INTO t1 VALUES (NULL) /* 9 */;
+
+--exec $MYSQL_BINLOG --skip-gtid=$server_uuid:1:2:3-8 $datadir/$binlog_file | $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT
+
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+#
+# cleanup
+#
 
 --connection master
-DROP TABLE t1, t5;
---source include/rpl_end.inc
+
+FLUSH LOGS;
+DROP TABLE t1;
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--exec $MYSQL_BINLOG $datadir/$binlog_file | $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT
+
+

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl3584 branch (andrei.elkin:3591 to 3592) WL#3584Andrei Elkin3 Feb