mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-26: Global transaction ID.
Change of user interface to be more logical and more in line with expectations to work similar to old-style replication. User can now explicitly choose in CHANGE MASTER whether binlog position is taken into account (master_gtid_pos=current_pos) or not (master_gtid_pos= slave_pos) when slave connects to master. @@gtid_pos is replaced by three separate variables @@gtid_slave_pos (can be set by user, replicated GTIDs only), @@gtid_binlog_pos (read only), and @@gtid_current_pos (a combination of the two, most recent GTID within each domain). mysql.rpl_slave_state is renamed to mysql.gtid_slave_pos to match. This fixes MDEV-4474.
This commit is contained in:
46
mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
Normal file
46
mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
Normal file
@ -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;
|
Reference in New Issue
Block a user