summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
blob: d021e335b86508ac61b33147bea1e6098aab5b1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;