List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:February 8 2012 11:19am
Subject:bzr push into mysql-trunk-wl3584 branch (andrei.elkin:3602)
View as plain text  
 3602 Andrei Elkin	2012-02-08 [merge]
      merging from the GTID repo to a local branch.

    modified:
      mysql-test/collections/mysql-trunk-wl3584.push
      mysql-test/suite/rpl/t/rpl_gtid_execution.test
      sql/sys_vars.cc
=== modified file 'mysql-test/suite/rpl/r/rpl_gtid_mode.result'
--- a/mysql-test/suite/rpl/r/rpl_gtid_mode.result	2012-01-27 01:26:40 +0000
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mode.result	2012-02-08 11:16:27 +0000
@@ -66,6 +66,13 @@ SET GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa
 SET GTID_NEXT = 'ANONYMOUS';
 ERROR HY000: GTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ON.
 ROLLBACK;
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+ERROR HY000: GTID_NEXT cannot be changed by a client that owns a GTID. The client owns 7805BE8E-51AB-11E1-BACC-6706C20AD7BA:1. Ownership is released on COMMIT or ROLLBACK.
+ROLLBACK;
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+ROLLBACK;
 ---- GTIDs are in binlog ----
 SET GTID_NEXT = 'AUTOMATIC';
 INSERT INTO t1 VALUES (2);

=== modified file 'mysql-test/suite/rpl/t/rpl_gtid_mode.test'
--- a/mysql-test/suite/rpl/t/rpl_gtid_mode.test	2012-01-30 19:56:21 +0000
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mode.test	2012-02-08 11:16:27 +0000
@@ -214,6 +214,25 @@ eval SET GTID_NEXT = '$uuida:1';
 SET GTID_NEXT = 'ANONYMOUS';
 ROLLBACK;
 
+#
+# Show that setting the same GTID twice raises an error the second time
+#
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+--error ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+ROLLBACK;
+
+#
+# Show that connection close releases GTID_NEXT
+#
+connect (master_gtid,127.0.0.1,root,,test,$MASTER_MYPORT);
+--connection master_gtid
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+disconnect master_gtid;
+--connection master
+SET SESSION GTID_NEXT='7805be8e-51ab-11e1-bacc-6706c20ad7ba:1';
+ROLLBACK;
+
 --echo ---- GTIDs are in binlog ----
 
 SET GTID_NEXT = 'AUTOMATIC';

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2012-02-07 10:55:08 +0000
+++ b/sql/log_event.cc	2012-02-08 11:16:27 +0000
@@ -11928,6 +11928,10 @@ int Gtid_log_event::do_apply_event(Relay
   rpl_sidno sidno= get_sidno(true);
   if (sidno < 0)
     DBUG_RETURN(1); // out of memory
+  if (thd->owned_gtid.sidno)
+  {
+    gtid_rollback(thd);
+  }
   thd->variables.gtid_next.set(sidno, spec.gtid.gno);
   DBUG_PRINT("info", ("setting gtid_next=%d:%lld",
                       sidno, spec.gtid.gno));

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl3584 branch (andrei.elkin:3602) Andrei Elkin8 Feb