1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-4591:Setting gtid* values from inside a transaction might cause unexpected results

Now we give an error on attempts to set @@SESSION.gtid_domain_id or
@@SESSION.gtid_seq_no when a transaction is active.
This commit is contained in:
unknown
2013-06-07 09:31:11 +02:00
parent 7b6ab5638a
commit dbe2c5060e
4 changed files with 65 additions and 1 deletions

View File

@ -52,6 +52,23 @@ ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (domain_id, sub_id);
SELECT * FROM t1;
--echo *** Test that setting @@gtid_domain_id or @@gtid_seq_no is not allowed inside a transaction. ***
BEGIN;
INSERT INTO t1 VALUES (100);
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
SET SESSION gtid_domain_id= 100;
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
SET SESSION gtid_seq_no= 100;
SET @old_domain= @@GLOBAL.gtid_domain_id;
SET GLOBAL gtid_domain_id= 100;
SELECT @@SESSION.gtid_domain_id;
SET GLOBAL gtid_domain_id= @old_domain;
INSERT INTO t1 VALUES (101);
SELECT * FROM t1 ORDER BY a;
ROLLBACK;
SELECT * FROM t1 ORDER BY a;
--echo *** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. ***
--connection slave
--source include/stop_slave.inc