blob: ed0d743444fee2989be095e8b529524cb6a9c3ab (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
include/rpl_init.inc [topology=none]
==== Configure ====
SET GLOBAL ENFORCE_GTID_CONSISTENCY = ON;
CREATE TABLE t1 (a INT);
==== Test ====
---- Case 1: Specify ANONYMOUS prior to transaction ----
* BEGIN ... ROLLBACK
- history=none current=none
SET SESSION GTID_NEXT = 'ANONYMOUS';
BEGIN;
INSERT INTO t1 VALUES (1);
ROLLBACK;
- history=ANONYMOUS current=ANONYMOUS
* BEGIN ... COMMIT
- history=none current=none
SET SESSION GTID_NEXT = 'ANONYMOUS';
- history=none current=none
[START] BEGIN;
- history=none current=AUTOMATIC
[END] BEGIN;
- history=none current=ANONYMOUS
INSERT INTO t1 VALUES (1);
- history=none current=ANONYMOUS
COMMIT;
- history=ANONYMOUS current=ANONYMOUS
* AUTOCOMMIT = OFF
SET @@SESSION.AUTOCOMMIT = 0;
- history=none current=none
SET SESSION GTID_NEXT = 'ANONYMOUS';
- history=none current=none
[START] INSERT INTO t1 VALUES (1);
- history=none current=ANONYMOUS
[END] INSERT INTO t1 VALUES (1);
- history=none current=ANONYMOUS
COMMIT;
- history=ANONYMOUS current=ANONYMOUS
* AUTOCOMMIT = ON
SET @@SESSION.AUTOCOMMIT = 1;
- history=none current=none
SET SESSION GTID_NEXT = 'ANONYMOUS';
- history=none current=none
[START] INSERT INTO t1 VALUES (1);
- history=none current=ANONYMOUS
[END] INSERT INTO t1 VALUES (1);
- history=ANONYMOUS current=ANONYMOUS
---- Case 2: Generate ANONYMOUS at commit ----
* BEGIN ... ROLLBACK
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
BEGIN;
INSERT INTO t1 VALUES (2);
ROLLBACK;
- history=AUTOMATIC current=AUTOMATIC
* BEGIN ... COMMIT
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
- history=none current=none
[START] BEGIN;
- history=none current=AUTOMATIC
[END] BEGIN;
- history=none current=AUTOMATIC
INSERT INTO t1 VALUES (2);
- history=none current=AUTOMATIC
COMMIT;
- history=ANONYMOUS current=ANONYMOUS
* AUTOCOMMIT = OFF
SET @@SESSION.AUTOCOMMIT = 0;
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
- history=none current=none
[START] INSERT INTO t1 VALUES (2);
- history=none current=AUTOMATIC
[END] INSERT INTO t1 VALUES (2);
- history=none current=AUTOMATIC
COMMIT;
- history=ANONYMOUS current=ANONYMOUS
* AUTOCOMMIT = ON
SET @@SESSION.AUTOCOMMIT = 1;
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
- history=none current=none
[START] INSERT INTO t1 VALUES (2);
- history=none current=AUTOMATIC
[END] INSERT INTO t1 VALUES (2);
- history=ANONYMOUS current=ANONYMOUS
include/rpl_set_gtid_mode.inc [ON on servers 1]
---- Case 3: Specify GTID prior to transaction ----
* BEGIN ... ROLLBACK
- history=none current=none
SET SESSION GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
BEGIN;
INSERT INTO t1 VALUES (3);
ROLLBACK;
- history=A:1 current=A:1
* BEGIN ... COMMIT
- history=none current=none
SET SESSION GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
- history=none current=none
[START] BEGIN;
- history=none current=AUTOMATIC
[END] BEGIN;
- history=none current=A:1
INSERT INTO t1 VALUES (3);
- history=none current=A:1
COMMIT;
- history=A:1 current=A:1
* AUTOCOMMIT = OFF
SET @@SESSION.AUTOCOMMIT = 0;
- history=none current=none
SET SESSION GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
- history=none current=none
[START] INSERT INTO t1 VALUES (3);
- history=none current=A:1
[END] INSERT INTO t1 VALUES (3);
- history=none current=A:1
COMMIT;
- history=A:1 current=A:1
* AUTOCOMMIT = ON
SET @@SESSION.AUTOCOMMIT = 1;
- history=none current=none
SET SESSION GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
- history=none current=none
[START] INSERT INTO t1 VALUES (3);
- history=none current=A:1
[END] INSERT INTO t1 VALUES (3);
- history=A:1 current=A:1
---- Case 4: Generate GTID at commit ----
* BEGIN ... ROLLBACK
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
BEGIN;
INSERT INTO t1 VALUES (4);
ROLLBACK;
- history=AUTOMATIC current=AUTOMATIC
* BEGIN ... COMMIT
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
- history=none current=none
[START] BEGIN;
- history=none current=AUTOMATIC
[END] BEGIN;
- history=none current=AUTOMATIC
INSERT INTO t1 VALUES (4);
- history=none current=AUTOMATIC
COMMIT;
- history=SERVER_UUID:1 current=SERVER_UUID:1
* AUTOCOMMIT = OFF
SET @@SESSION.AUTOCOMMIT = 0;
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
- history=none current=none
[START] INSERT INTO t1 VALUES (4);
- history=none current=AUTOMATIC
[END] INSERT INTO t1 VALUES (4);
- history=none current=AUTOMATIC
COMMIT;
- history=SERVER_UUID:1 current=SERVER_UUID:1
* AUTOCOMMIT = ON
SET @@SESSION.AUTOCOMMIT = 1;
- history=none current=none
SET SESSION GTID_NEXT = 'AUTOMATIC';
- history=none current=none
[START] INSERT INTO t1 VALUES (4);
- history=none current=AUTOMATIC
[END] INSERT INTO t1 VALUES (4);
- history=SERVER_UUID:1 current=SERVER_UUID:1
==== Clean up ====
DROP TABLE t1;
include/rpl_set_gtid_mode.inc [OFF on servers 1]
SET GLOBAL ENFORCE_GTID_CONSISTENCY = OFF;
include/rpl_end.inc
|