--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;
