Debian Codegraph @

mysql-test/suite/binlog_nogtid/t/binlog_gtid_mode_set_gtid_next.test

raw
1 # ==== Purpose ====
2 #
3 # Test that GTID_NEXT can be set as allowed by GTID_MODE.
4 #
5 # ==== Implementation ====
6 #
7 # Execute all the following tests:
8 #
9 # For each GTID_MODE (OFF, OFF_PERMISSIVE, ON_PERMISSIVE, ON):
10 # For each old value of GTID_NEXT (AUTOMATIC, ANONYMOUS, UUID:NUMBER):
11 # For each new value of GTID_NEXT (AUTOMATIC, ANONYMOUS, UUID:NUMBER):
12 # Verify that it is possible to change gtid_mode from old to new,
13 # if new is compatible with GTID_MODE; otherwise verify that this is
14 # not possible.
15
16 # Test sets gtid_mode explicitly, no need to run in multiple combinations.
17
18 --let $rpl_gtid_utils= 1
19 --let $rpl_topology= none
20 --source include/rpl_init.inc
21
22 SET GLOBAL ENFORCE_GTID_CONSISTENCY = ON;
23
24 --echo ==== GTID_MODE = OFF ====
25
26 --echo ---- Old value is AUTOMATIC or ANONYMOUS ----
27
28 --let $error= ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF
29 --let $gtid_next= $uuida:1
30 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
31 --let $error= 0
32
33 --let $gtid_next= ANONYMOUS
34 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
35
36 --let $error= ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF
37 --let $gtid_next= $uuida:1
38 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
39 --let $error= 0
40
41 --let $gtid_next= ANONYMOUS
42 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
43
44 --let $gtid_next= AUTOMATIC
45 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
46
47 --let $gtid_next= AUTOMATIC
48 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
49
50 --echo ---- Old value is UUID:NUMBER ----
51
52 SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';
53 --eval SET GTID_NEXT = '$uuida:1';
54 --let $old_gtid_next= $uuida:1
55 ROLLBACK;
56 SET GLOBAL GTID_MODE = 'OFF';
57
58 --let $error= ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF
59 --let $gtid_next= $uuida:1
60 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
61 --let $error= 0
62
63 --let $error= ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF
64 --let $gtid_next= $uuida:2
65 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
66 --let $error= 0
67
68 --let $gtid_next= ANONYMOUS
69 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
70
71 SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';
72 --eval SET GTID_NEXT = '$uuida:1';
73 --let $old_gtid_next= $uuida:1
74 ROLLBACK;
75 SET GLOBAL GTID_MODE = 'OFF';
76
77 --let $gtid_next= AUTOMATIC
78 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
79
80 --echo ==== GTID_MODE = OFF_PERMISSIVE ====
81
82 SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';
83 --source extra/binlog_tests/binlog_gtid_mode_permissive_set_gtid_next.inc
84
85 --echo ==== GTID_MODE = ON_PERMISSIVE ====
86
87 SET GLOBAL GTID_MODE = ON_PERMISSIVE;
88 --source extra/binlog_tests/binlog_gtid_mode_permissive_set_gtid_next.inc
89
90 --echo ==== GTID_MODE = ON ====
91
92 --echo ---- Old value is AUTOMATIC or GTID ----
93
94 SET @@GLOBAL.GTID_MODE = ON;
95
96 --let $gtid_next= AUTOMATIC
97 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
98
99 --let $error= ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON
100 --let $gtid_next= ANONYMOUS
101 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
102 --let $error= 0
103
104 --let $gtid_next= $uuida:1
105 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
106
107 --let $gtid_next= $uuida:1
108 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
109
110 --let $gtid_next= $uuida:2
111 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
112
113 --let $gtid_next= AUTOMATIC
114 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
115
116 --let $gtid_next= $uuida:1
117 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
118
119 --let $error= ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON
120 --let $gtid_next= ANONYMOUS
121 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
122 --let $error= 0
123
124 --let $gtid_next= AUTOMATIC
125 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
126
127 --echo ---- Old value is ANONYMOUS ----
128
129 SET GLOBAL GTID_MODE = 'ON_PERMISSIVE';
130 --eval SET GTID_NEXT = 'ANONYMOUS';
131 --let $old_gtid_next= ANONYMOUS
132 ROLLBACK;
133 SET GLOBAL GTID_MODE = 'ON';
134
135 --let $error= ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON
136 --let $gtid_next= ANONYMOUS
137 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
138 --let $error= 0
139
140 --let $gtid_next= $uuida:1
141 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
142
143 SET GLOBAL GTID_MODE = 'ON_PERMISSIVE';
144 --eval SET GTID_NEXT = 'ANONYMOUS';
145 --let $old_gtid_next= ANONYMOUS
146 ROLLBACK;
147 SET GLOBAL GTID_MODE = 'ON';
148
149 --let $gtid_next= AUTOMATIC
150 --source extra/binlog_tests/binlog_gtid_mode_set_gtid_next.inc
151
152 --echo ---- Clean up ----
153
154 SET GLOBAL GTID_MODE = ON_PERMISSIVE;
155 SET GLOBAL GTID_MODE = OFF_PERMISSIVE;
156 SET GLOBAL GTID_MODE = OFF;
157 SET GLOBAL ENFORCE_GTID_CONSISTENCY = OFF;
158
159 --source include/rpl_end.inc