Debian Codegraph @

mysql-test/suite/rpl/r/rpl_xa_empty_transaction.result

raw
1 include/rpl_init.inc [topology=1->2->3]
2 connection server_1;
3 connection server_2;
4 connection server_3;
5 connection server_1;
6 #
7 # Test Case 1: An XA transaction without any statements should not be
8 # binlogged
9 connection server_1;
10 connection server_2;
11 connection server_3;
12 connection server_1;
13 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
14 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
15 include/save_master_gtid.inc
16 connection server_3;
17 include/sync_with_master_gtid.inc
18 connection server_1;
19 XA START 'x';
20 XA END 'x';
21 XA PREPARE 'x';
22 XA COMMIT 'x';;
23 include/save_master_gtid.inc
24 FLUSH LOGS;
25 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
26 include/assert_grep.inc [server_1 should not binlog XA transaction]
27 connection server_2;
28 include/sync_with_master_gtid.inc
29 FLUSH LOGS;
30 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
31 include/assert_grep.inc [server_2 should not binlog XA transaction]
32 connection server_3;
33 include/sync_with_master_gtid.inc
34 FLUSH LOGS;
35 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
36 include/assert_grep.inc [server_3 should not binlog XA transaction]
37 connection server_1;
38 DROP TABLE ti,tm;
39 include/save_master_gtid.inc
40 connection server_3;
41 include/sync_with_master_gtid.inc
42 connection server_1;
43 connection server_2;
44 connection server_3;
45 connection server_1;
46 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
47 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
48 include/save_master_gtid.inc
49 connection server_3;
50 include/sync_with_master_gtid.inc
51 connection server_1;
52 connect con1,localhost,root,,;
53 XA START 'x';
54 XA END 'x';
55 XA PREPARE 'x';
56 disconnect con1;
57 connection server_1;
58 XA RECOVER;
59 formatID gtrid_length bqual_length data
60 1 1 0 x
61 XA COMMIT 'x';;
62 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
63 include/save_master_gtid.inc
64 FLUSH LOGS;
65 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
66 include/assert_grep.inc [server_1 should not binlog XA transaction]
67 connection server_2;
68 include/sync_with_master_gtid.inc
69 FLUSH LOGS;
70 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
71 include/assert_grep.inc [server_2 should not binlog XA transaction]
72 connection server_3;
73 include/sync_with_master_gtid.inc
74 FLUSH LOGS;
75 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
76 include/assert_grep.inc [server_3 should not binlog XA transaction]
77 connection server_1;
78 DROP TABLE ti,tm;
79 include/save_master_gtid.inc
80 connection server_3;
81 include/sync_with_master_gtid.inc
82 connection server_1;
83 connection server_2;
84 connection server_3;
85 connection server_1;
86 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
87 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
88 include/save_master_gtid.inc
89 connection server_3;
90 include/sync_with_master_gtid.inc
91 connection server_1;
92 XA START 'x';
93 XA END 'x';
94 XA PREPARE 'x';
95 XA ROLLBACK 'x';;
96 include/save_master_gtid.inc
97 FLUSH LOGS;
98 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
99 include/assert_grep.inc [server_1 should not binlog XA transaction]
100 connection server_2;
101 include/sync_with_master_gtid.inc
102 FLUSH LOGS;
103 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
104 include/assert_grep.inc [server_2 should not binlog XA transaction]
105 connection server_3;
106 include/sync_with_master_gtid.inc
107 FLUSH LOGS;
108 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
109 include/assert_grep.inc [server_3 should not binlog XA transaction]
110 connection server_1;
111 DROP TABLE ti,tm;
112 include/save_master_gtid.inc
113 connection server_3;
114 include/sync_with_master_gtid.inc
115 connection server_1;
116 connection server_2;
117 connection server_3;
118 connection server_1;
119 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
120 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
121 include/save_master_gtid.inc
122 connection server_3;
123 include/sync_with_master_gtid.inc
124 connection server_1;
125 connect con1,localhost,root,,;
126 XA START 'x';
127 XA END 'x';
128 XA PREPARE 'x';
129 disconnect con1;
130 connection server_1;
131 XA RECOVER;
132 formatID gtrid_length bqual_length data
133 1 1 0 x
134 XA ROLLBACK 'x';;
135 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
136 include/save_master_gtid.inc
137 FLUSH LOGS;
138 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
139 include/assert_grep.inc [server_1 should not binlog XA transaction]
140 connection server_2;
141 include/sync_with_master_gtid.inc
142 FLUSH LOGS;
143 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
144 include/assert_grep.inc [server_2 should not binlog XA transaction]
145 connection server_3;
146 include/sync_with_master_gtid.inc
147 FLUSH LOGS;
148 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
149 include/assert_grep.inc [server_3 should not binlog XA transaction]
150 connection server_1;
151 DROP TABLE ti,tm;
152 include/save_master_gtid.inc
153 connection server_3;
154 include/sync_with_master_gtid.inc
155 #
156 # Test Case 2: An XA transaction consisting of a successfully rolled back
157 # statement should not be binlogged
158 connection server_1;
159 connection server_2;
160 connection server_3;
161 connection server_1;
162 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
163 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
164 include/save_master_gtid.inc
165 connection server_3;
166 include/sync_with_master_gtid.inc
167 connection server_1;
168 XA START 'x';
169 INSERT INTO ti VALUES (1),(1);;
170 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
171 XA END 'x';
172 XA PREPARE 'x';
173 XA COMMIT 'x';;
174 include/save_master_gtid.inc
175 FLUSH LOGS;
176 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
177 include/assert_grep.inc [server_1 should not binlog XA transaction]
178 connection server_2;
179 include/sync_with_master_gtid.inc
180 FLUSH LOGS;
181 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
182 include/assert_grep.inc [server_2 should not binlog XA transaction]
183 connection server_3;
184 include/sync_with_master_gtid.inc
185 FLUSH LOGS;
186 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
187 include/assert_grep.inc [server_3 should not binlog XA transaction]
188 connection server_1;
189 DROP TABLE ti,tm;
190 include/save_master_gtid.inc
191 connection server_3;
192 include/sync_with_master_gtid.inc
193 connection server_1;
194 connection server_2;
195 connection server_3;
196 connection server_1;
197 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
198 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
199 include/save_master_gtid.inc
200 connection server_3;
201 include/sync_with_master_gtid.inc
202 connection server_1;
203 connect con1,localhost,root,,;
204 XA START 'x';
205 INSERT INTO ti VALUES (1),(1);;
206 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
207 XA END 'x';
208 XA PREPARE 'x';
209 disconnect con1;
210 connection server_1;
211 XA RECOVER;
212 formatID gtrid_length bqual_length data
213 1 1 0 x
214 XA COMMIT 'x';;
215 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
216 include/save_master_gtid.inc
217 FLUSH LOGS;
218 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
219 include/assert_grep.inc [server_1 should not binlog XA transaction]
220 connection server_2;
221 include/sync_with_master_gtid.inc
222 FLUSH LOGS;
223 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
224 include/assert_grep.inc [server_2 should not binlog XA transaction]
225 connection server_3;
226 include/sync_with_master_gtid.inc
227 FLUSH LOGS;
228 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
229 include/assert_grep.inc [server_3 should not binlog XA transaction]
230 connection server_1;
231 DROP TABLE ti,tm;
232 include/save_master_gtid.inc
233 connection server_3;
234 include/sync_with_master_gtid.inc
235 connection server_1;
236 connection server_2;
237 connection server_3;
238 connection server_1;
239 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
240 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
241 include/save_master_gtid.inc
242 connection server_3;
243 include/sync_with_master_gtid.inc
244 connection server_1;
245 XA START 'x';
246 INSERT INTO ti VALUES (1),(1);;
247 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
248 XA END 'x';
249 XA PREPARE 'x';
250 XA ROLLBACK 'x';;
251 include/save_master_gtid.inc
252 FLUSH LOGS;
253 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
254 include/assert_grep.inc [server_1 should not binlog XA transaction]
255 connection server_2;
256 include/sync_with_master_gtid.inc
257 FLUSH LOGS;
258 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
259 include/assert_grep.inc [server_2 should not binlog XA transaction]
260 connection server_3;
261 include/sync_with_master_gtid.inc
262 FLUSH LOGS;
263 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
264 include/assert_grep.inc [server_3 should not binlog XA transaction]
265 connection server_1;
266 DROP TABLE ti,tm;
267 include/save_master_gtid.inc
268 connection server_3;
269 include/sync_with_master_gtid.inc
270 connection server_1;
271 connection server_2;
272 connection server_3;
273 connection server_1;
274 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
275 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
276 include/save_master_gtid.inc
277 connection server_3;
278 include/sync_with_master_gtid.inc
279 connection server_1;
280 connect con1,localhost,root,,;
281 XA START 'x';
282 INSERT INTO ti VALUES (1),(1);;
283 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
284 XA END 'x';
285 XA PREPARE 'x';
286 disconnect con1;
287 connection server_1;
288 XA RECOVER;
289 formatID gtrid_length bqual_length data
290 1 1 0 x
291 XA ROLLBACK 'x';;
292 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
293 include/save_master_gtid.inc
294 FLUSH LOGS;
295 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
296 include/assert_grep.inc [server_1 should not binlog XA transaction]
297 connection server_2;
298 include/sync_with_master_gtid.inc
299 FLUSH LOGS;
300 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
301 include/assert_grep.inc [server_2 should not binlog XA transaction]
302 connection server_3;
303 include/sync_with_master_gtid.inc
304 FLUSH LOGS;
305 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
306 include/assert_grep.inc [server_3 should not binlog XA transaction]
307 connection server_1;
308 DROP TABLE ti,tm;
309 include/save_master_gtid.inc
310 connection server_3;
311 include/sync_with_master_gtid.inc
312 #
313 # Test Case 3: An XA transaction with a statement that cannot be rolled
314 # back should be binlogged
315 connection server_1;
316 set @sav_binlog_format = @@binlog_format;
317 set @@binlog_format = row;
318 set @@global.binlog_format = row;
319 connection server_1;
320 connection server_2;
321 connection server_3;
322 connection server_1;
323 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
324 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
325 include/save_master_gtid.inc
326 connection server_3;
327 include/sync_with_master_gtid.inc
328 connection server_1;
329 XA START 'x';
330 INSERT INTO tm VALUES (1),(1);;
331 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
332 XA END 'x';
333 XA PREPARE 'x';
334 XA COMMIT 'x';;
335 include/save_master_gtid.inc
336 FLUSH LOGS;
337 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
338 include/assert_grep.inc [server_1 should not binlog XA transaction]
339 connection server_2;
340 include/sync_with_master_gtid.inc
341 FLUSH LOGS;
342 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
343 include/assert_grep.inc [server_2 should not binlog XA transaction]
344 connection server_3;
345 include/sync_with_master_gtid.inc
346 FLUSH LOGS;
347 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
348 include/assert_grep.inc [server_3 should not binlog XA transaction]
349 connection server_1;
350 DROP TABLE ti,tm;
351 include/save_master_gtid.inc
352 connection server_3;
353 include/sync_with_master_gtid.inc
354 connection server_1;
355 connection server_2;
356 connection server_3;
357 connection server_1;
358 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
359 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
360 include/save_master_gtid.inc
361 connection server_3;
362 include/sync_with_master_gtid.inc
363 connection server_1;
364 connect con1,localhost,root,,;
365 XA START 'x';
366 INSERT INTO tm VALUES (1),(1);;
367 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
368 XA END 'x';
369 XA PREPARE 'x';
370 disconnect con1;
371 connection server_1;
372 XA RECOVER;
373 formatID gtrid_length bqual_length data
374 1 1 0 x
375 XA COMMIT 'x';;
376 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
377 include/save_master_gtid.inc
378 FLUSH LOGS;
379 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
380 include/assert_grep.inc [server_1 should not binlog XA transaction]
381 connection server_2;
382 include/sync_with_master_gtid.inc
383 FLUSH LOGS;
384 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
385 include/assert_grep.inc [server_2 should not binlog XA transaction]
386 connection server_3;
387 include/sync_with_master_gtid.inc
388 FLUSH LOGS;
389 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
390 include/assert_grep.inc [server_3 should not binlog XA transaction]
391 connection server_1;
392 DROP TABLE ti,tm;
393 include/save_master_gtid.inc
394 connection server_3;
395 include/sync_with_master_gtid.inc
396 connection server_1;
397 connection server_2;
398 connection server_3;
399 connection server_1;
400 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
401 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
402 include/save_master_gtid.inc
403 connection server_3;
404 include/sync_with_master_gtid.inc
405 connection server_1;
406 XA START 'x';
407 INSERT INTO tm VALUES (1),(1);;
408 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
409 XA END 'x';
410 XA PREPARE 'x';
411 XA ROLLBACK 'x';;
412 Warnings:
413 Warning 1196 Some non-transactional changed tables couldn't be rolled back
414 include/save_master_gtid.inc
415 FLUSH LOGS;
416 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
417 include/assert_grep.inc [server_1 should not binlog XA transaction]
418 connection server_2;
419 include/sync_with_master_gtid.inc
420 FLUSH LOGS;
421 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
422 include/assert_grep.inc [server_2 should not binlog XA transaction]
423 connection server_3;
424 include/sync_with_master_gtid.inc
425 FLUSH LOGS;
426 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
427 include/assert_grep.inc [server_3 should not binlog XA transaction]
428 connection server_1;
429 DROP TABLE ti,tm;
430 include/save_master_gtid.inc
431 connection server_3;
432 include/sync_with_master_gtid.inc
433 connection server_1;
434 connection server_2;
435 connection server_3;
436 connection server_1;
437 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
438 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
439 include/save_master_gtid.inc
440 connection server_3;
441 include/sync_with_master_gtid.inc
442 connection server_1;
443 connect con1,localhost,root,,;
444 XA START 'x';
445 INSERT INTO tm VALUES (1),(1);;
446 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
447 XA END 'x';
448 XA PREPARE 'x';
449 disconnect con1;
450 connection server_1;
451 XA RECOVER;
452 formatID gtrid_length bqual_length data
453 1 1 0 x
454 XA ROLLBACK 'x';;
455 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
456 include/save_master_gtid.inc
457 FLUSH LOGS;
458 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
459 include/assert_grep.inc [server_1 should not binlog XA transaction]
460 connection server_2;
461 include/sync_with_master_gtid.inc
462 FLUSH LOGS;
463 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
464 include/assert_grep.inc [server_2 should not binlog XA transaction]
465 connection server_3;
466 include/sync_with_master_gtid.inc
467 FLUSH LOGS;
468 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
469 include/assert_grep.inc [server_3 should not binlog XA transaction]
470 connection server_1;
471 DROP TABLE ti,tm;
472 include/save_master_gtid.inc
473 connection server_3;
474 include/sync_with_master_gtid.inc
475 connection server_1;
476 set @@binlog_format = @sav_binlog_format;
477 set @@global.binlog_format = @sav_binlog_format;
478 #
479 # Test Case 4: An XA transaction with multiple statements that can all
480 # be rolled back should not be binlogged
481 connection server_1;
482 connection server_2;
483 connection server_3;
484 connection server_1;
485 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
486 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
487 include/save_master_gtid.inc
488 connection server_3;
489 include/sync_with_master_gtid.inc
490 connection server_1;
491 XA START 'x';
492 INSERT INTO ti VALUES (1),(1);;
493 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
494 INSERT INTO ti VALUES (2),(2);;
495 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
496 XA END 'x';
497 XA PREPARE 'x';
498 XA COMMIT 'x';;
499 include/save_master_gtid.inc
500 FLUSH LOGS;
501 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
502 include/assert_grep.inc [server_1 should not binlog XA transaction]
503 connection server_2;
504 include/sync_with_master_gtid.inc
505 FLUSH LOGS;
506 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
507 include/assert_grep.inc [server_2 should not binlog XA transaction]
508 connection server_3;
509 include/sync_with_master_gtid.inc
510 FLUSH LOGS;
511 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
512 include/assert_grep.inc [server_3 should not binlog XA transaction]
513 connection server_1;
514 DROP TABLE ti,tm;
515 include/save_master_gtid.inc
516 connection server_3;
517 include/sync_with_master_gtid.inc
518 connection server_1;
519 connection server_2;
520 connection server_3;
521 connection server_1;
522 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
523 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
524 include/save_master_gtid.inc
525 connection server_3;
526 include/sync_with_master_gtid.inc
527 connection server_1;
528 connect con1,localhost,root,,;
529 XA START 'x';
530 INSERT INTO ti VALUES (1),(1);;
531 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
532 INSERT INTO ti VALUES (2),(2);;
533 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
534 XA END 'x';
535 XA PREPARE 'x';
536 disconnect con1;
537 connection server_1;
538 XA RECOVER;
539 formatID gtrid_length bqual_length data
540 1 1 0 x
541 XA COMMIT 'x';;
542 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
543 include/save_master_gtid.inc
544 FLUSH LOGS;
545 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
546 include/assert_grep.inc [server_1 should not binlog XA transaction]
547 connection server_2;
548 include/sync_with_master_gtid.inc
549 FLUSH LOGS;
550 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
551 include/assert_grep.inc [server_2 should not binlog XA transaction]
552 connection server_3;
553 include/sync_with_master_gtid.inc
554 FLUSH LOGS;
555 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
556 include/assert_grep.inc [server_3 should not binlog XA transaction]
557 connection server_1;
558 DROP TABLE ti,tm;
559 include/save_master_gtid.inc
560 connection server_3;
561 include/sync_with_master_gtid.inc
562 connection server_1;
563 connection server_2;
564 connection server_3;
565 connection server_1;
566 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
567 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
568 include/save_master_gtid.inc
569 connection server_3;
570 include/sync_with_master_gtid.inc
571 connection server_1;
572 XA START 'x';
573 INSERT INTO ti VALUES (1),(1);;
574 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
575 INSERT INTO ti VALUES (2),(2);;
576 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
577 XA END 'x';
578 XA PREPARE 'x';
579 XA ROLLBACK 'x';;
580 include/save_master_gtid.inc
581 FLUSH LOGS;
582 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
583 include/assert_grep.inc [server_1 should not binlog XA transaction]
584 connection server_2;
585 include/sync_with_master_gtid.inc
586 FLUSH LOGS;
587 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
588 include/assert_grep.inc [server_2 should not binlog XA transaction]
589 connection server_3;
590 include/sync_with_master_gtid.inc
591 FLUSH LOGS;
592 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
593 include/assert_grep.inc [server_3 should not binlog XA transaction]
594 connection server_1;
595 DROP TABLE ti,tm;
596 include/save_master_gtid.inc
597 connection server_3;
598 include/sync_with_master_gtid.inc
599 connection server_1;
600 connection server_2;
601 connection server_3;
602 connection server_1;
603 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
604 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
605 include/save_master_gtid.inc
606 connection server_3;
607 include/sync_with_master_gtid.inc
608 connection server_1;
609 connect con1,localhost,root,,;
610 XA START 'x';
611 INSERT INTO ti VALUES (1),(1);;
612 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
613 INSERT INTO ti VALUES (2),(2);;
614 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
615 XA END 'x';
616 XA PREPARE 'x';
617 disconnect con1;
618 connection server_1;
619 XA RECOVER;
620 formatID gtrid_length bqual_length data
621 1 1 0 x
622 XA ROLLBACK 'x';;
623 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
624 include/save_master_gtid.inc
625 FLUSH LOGS;
626 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
627 include/assert_grep.inc [server_1 should not binlog XA transaction]
628 connection server_2;
629 include/sync_with_master_gtid.inc
630 FLUSH LOGS;
631 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
632 include/assert_grep.inc [server_2 should not binlog XA transaction]
633 connection server_3;
634 include/sync_with_master_gtid.inc
635 FLUSH LOGS;
636 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
637 include/assert_grep.inc [server_3 should not binlog XA transaction]
638 connection server_1;
639 DROP TABLE ti,tm;
640 include/save_master_gtid.inc
641 connection server_3;
642 include/sync_with_master_gtid.inc
643 #
644 # Test Case 5: A mixed XA transaction consisting of one statement that
645 # can successfully be rolled back (first statement), and another that
646 # can not (second statement) should be binlogged
647 connection server_1;
648 set @sav_binlog_format = @@binlog_format;
649 set @@binlog_format = row;
650 set @@global.binlog_format = row;
651 connection server_1;
652 connection server_2;
653 connection server_3;
654 connection server_1;
655 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
656 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
657 include/save_master_gtid.inc
658 connection server_3;
659 include/sync_with_master_gtid.inc
660 connection server_1;
661 XA START 'x';
662 INSERT INTO ti VALUES (1),(1);;
663 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
664 INSERT INTO tm VALUES (2),(2);;
665 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
666 XA END 'x';
667 XA PREPARE 'x';
668 XA COMMIT 'x';;
669 include/save_master_gtid.inc
670 FLUSH LOGS;
671 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
672 include/assert_grep.inc [server_1 should not binlog XA transaction]
673 connection server_2;
674 include/sync_with_master_gtid.inc
675 FLUSH LOGS;
676 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
677 include/assert_grep.inc [server_2 should not binlog XA transaction]
678 connection server_3;
679 include/sync_with_master_gtid.inc
680 FLUSH LOGS;
681 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
682 include/assert_grep.inc [server_3 should not binlog XA transaction]
683 connection server_1;
684 DROP TABLE ti,tm;
685 include/save_master_gtid.inc
686 connection server_3;
687 include/sync_with_master_gtid.inc
688 connection server_1;
689 connection server_2;
690 connection server_3;
691 connection server_1;
692 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
693 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
694 include/save_master_gtid.inc
695 connection server_3;
696 include/sync_with_master_gtid.inc
697 connection server_1;
698 connect con1,localhost,root,,;
699 XA START 'x';
700 INSERT INTO ti VALUES (1),(1);;
701 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
702 INSERT INTO tm VALUES (2),(2);;
703 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
704 XA END 'x';
705 XA PREPARE 'x';
706 disconnect con1;
707 connection server_1;
708 XA RECOVER;
709 formatID gtrid_length bqual_length data
710 1 1 0 x
711 XA COMMIT 'x';;
712 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
713 include/save_master_gtid.inc
714 FLUSH LOGS;
715 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
716 include/assert_grep.inc [server_1 should not binlog XA transaction]
717 connection server_2;
718 include/sync_with_master_gtid.inc
719 FLUSH LOGS;
720 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
721 include/assert_grep.inc [server_2 should not binlog XA transaction]
722 connection server_3;
723 include/sync_with_master_gtid.inc
724 FLUSH LOGS;
725 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
726 include/assert_grep.inc [server_3 should not binlog XA transaction]
727 connection server_1;
728 DROP TABLE ti,tm;
729 include/save_master_gtid.inc
730 connection server_3;
731 include/sync_with_master_gtid.inc
732 connection server_1;
733 connection server_2;
734 connection server_3;
735 connection server_1;
736 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
737 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
738 include/save_master_gtid.inc
739 connection server_3;
740 include/sync_with_master_gtid.inc
741 connection server_1;
742 XA START 'x';
743 INSERT INTO ti VALUES (1),(1);;
744 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
745 INSERT INTO tm VALUES (2),(2);;
746 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
747 XA END 'x';
748 XA PREPARE 'x';
749 XA ROLLBACK 'x';;
750 Warnings:
751 Warning 1196 Some non-transactional changed tables couldn't be rolled back
752 include/save_master_gtid.inc
753 FLUSH LOGS;
754 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
755 include/assert_grep.inc [server_1 should not binlog XA transaction]
756 connection server_2;
757 include/sync_with_master_gtid.inc
758 FLUSH LOGS;
759 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
760 include/assert_grep.inc [server_2 should not binlog XA transaction]
761 connection server_3;
762 include/sync_with_master_gtid.inc
763 FLUSH LOGS;
764 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
765 include/assert_grep.inc [server_3 should not binlog XA transaction]
766 connection server_1;
767 DROP TABLE ti,tm;
768 include/save_master_gtid.inc
769 connection server_3;
770 include/sync_with_master_gtid.inc
771 connection server_1;
772 connection server_2;
773 connection server_3;
774 connection server_1;
775 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
776 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
777 include/save_master_gtid.inc
778 connection server_3;
779 include/sync_with_master_gtid.inc
780 connection server_1;
781 connect con1,localhost,root,,;
782 XA START 'x';
783 INSERT INTO ti VALUES (1),(1);;
784 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
785 INSERT INTO tm VALUES (2),(2);;
786 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
787 XA END 'x';
788 XA PREPARE 'x';
789 disconnect con1;
790 connection server_1;
791 XA RECOVER;
792 formatID gtrid_length bqual_length data
793 1 1 0 x
794 XA ROLLBACK 'x';;
795 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
796 include/save_master_gtid.inc
797 FLUSH LOGS;
798 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
799 include/assert_grep.inc [server_1 should not binlog XA transaction]
800 connection server_2;
801 include/sync_with_master_gtid.inc
802 FLUSH LOGS;
803 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
804 include/assert_grep.inc [server_2 should not binlog XA transaction]
805 connection server_3;
806 include/sync_with_master_gtid.inc
807 FLUSH LOGS;
808 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
809 include/assert_grep.inc [server_3 should not binlog XA transaction]
810 connection server_1;
811 DROP TABLE ti,tm;
812 include/save_master_gtid.inc
813 connection server_3;
814 include/sync_with_master_gtid.inc
815 connection server_1;
816 set @@binlog_format = @sav_binlog_format;
817 set @@global.binlog_format = @sav_binlog_format;
818 #
819 # Test Case 6: A mixed XA transaction consisting of one statement that
820 # cannot successfully be rolled back (first statement), and another that
821 # can (second statement) should be binlogged
822 connection server_1;
823 set @sav_binlog_format = @@binlog_format;
824 set @@binlog_format = row;
825 set @@global.binlog_format = row;
826 connection server_1;
827 connection server_2;
828 connection server_3;
829 connection server_1;
830 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
831 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
832 include/save_master_gtid.inc
833 connection server_3;
834 include/sync_with_master_gtid.inc
835 connection server_1;
836 XA START 'x';
837 INSERT INTO tm VALUES (1),(1);;
838 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
839 INSERT INTO ti VALUES (2),(2);;
840 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
841 XA END 'x';
842 XA PREPARE 'x';
843 XA COMMIT 'x';;
844 include/save_master_gtid.inc
845 FLUSH LOGS;
846 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
847 include/assert_grep.inc [server_1 should not binlog XA transaction]
848 connection server_2;
849 include/sync_with_master_gtid.inc
850 FLUSH LOGS;
851 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
852 include/assert_grep.inc [server_2 should not binlog XA transaction]
853 connection server_3;
854 include/sync_with_master_gtid.inc
855 FLUSH LOGS;
856 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
857 include/assert_grep.inc [server_3 should not binlog XA transaction]
858 connection server_1;
859 DROP TABLE ti,tm;
860 include/save_master_gtid.inc
861 connection server_3;
862 include/sync_with_master_gtid.inc
863 connection server_1;
864 connection server_2;
865 connection server_3;
866 connection server_1;
867 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
868 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
869 include/save_master_gtid.inc
870 connection server_3;
871 include/sync_with_master_gtid.inc
872 connection server_1;
873 connect con1,localhost,root,,;
874 XA START 'x';
875 INSERT INTO tm VALUES (1),(1);;
876 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
877 INSERT INTO ti VALUES (2),(2);;
878 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
879 XA END 'x';
880 XA PREPARE 'x';
881 disconnect con1;
882 connection server_1;
883 XA RECOVER;
884 formatID gtrid_length bqual_length data
885 1 1 0 x
886 XA COMMIT 'x';;
887 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
888 include/save_master_gtid.inc
889 FLUSH LOGS;
890 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
891 include/assert_grep.inc [server_1 should not binlog XA transaction]
892 connection server_2;
893 include/sync_with_master_gtid.inc
894 FLUSH LOGS;
895 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
896 include/assert_grep.inc [server_2 should not binlog XA transaction]
897 connection server_3;
898 include/sync_with_master_gtid.inc
899 FLUSH LOGS;
900 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
901 include/assert_grep.inc [server_3 should not binlog XA transaction]
902 connection server_1;
903 DROP TABLE ti,tm;
904 include/save_master_gtid.inc
905 connection server_3;
906 include/sync_with_master_gtid.inc
907 connection server_1;
908 connection server_2;
909 connection server_3;
910 connection server_1;
911 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
912 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
913 include/save_master_gtid.inc
914 connection server_3;
915 include/sync_with_master_gtid.inc
916 connection server_1;
917 XA START 'x';
918 INSERT INTO tm VALUES (1),(1);;
919 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
920 INSERT INTO ti VALUES (2),(2);;
921 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
922 XA END 'x';
923 XA PREPARE 'x';
924 XA ROLLBACK 'x';;
925 Warnings:
926 Warning 1196 Some non-transactional changed tables couldn't be rolled back
927 include/save_master_gtid.inc
928 FLUSH LOGS;
929 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
930 include/assert_grep.inc [server_1 should not binlog XA transaction]
931 connection server_2;
932 include/sync_with_master_gtid.inc
933 FLUSH LOGS;
934 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
935 include/assert_grep.inc [server_2 should not binlog XA transaction]
936 connection server_3;
937 include/sync_with_master_gtid.inc
938 FLUSH LOGS;
939 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
940 include/assert_grep.inc [server_3 should not binlog XA transaction]
941 connection server_1;
942 DROP TABLE ti,tm;
943 include/save_master_gtid.inc
944 connection server_3;
945 include/sync_with_master_gtid.inc
946 connection server_1;
947 connection server_2;
948 connection server_3;
949 connection server_1;
950 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
951 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
952 include/save_master_gtid.inc
953 connection server_3;
954 include/sync_with_master_gtid.inc
955 connection server_1;
956 connect con1,localhost,root,,;
957 XA START 'x';
958 INSERT INTO tm VALUES (1),(1);;
959 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
960 INSERT INTO ti VALUES (2),(2);;
961 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
962 XA END 'x';
963 XA PREPARE 'x';
964 disconnect con1;
965 connection server_1;
966 XA RECOVER;
967 formatID gtrid_length bqual_length data
968 1 1 0 x
969 XA ROLLBACK 'x';;
970 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
971 include/save_master_gtid.inc
972 FLUSH LOGS;
973 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
974 include/assert_grep.inc [server_1 should not binlog XA transaction]
975 connection server_2;
976 include/sync_with_master_gtid.inc
977 FLUSH LOGS;
978 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
979 include/assert_grep.inc [server_2 should not binlog XA transaction]
980 connection server_3;
981 include/sync_with_master_gtid.inc
982 FLUSH LOGS;
983 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
984 include/assert_grep.inc [server_3 should not binlog XA transaction]
985 connection server_1;
986 DROP TABLE ti,tm;
987 include/save_master_gtid.inc
988 connection server_3;
989 include/sync_with_master_gtid.inc
990 connection server_1;
991 set @@binlog_format = @sav_binlog_format;
992 set @@global.binlog_format = @sav_binlog_format;
993 #
994 # Test Case 7: An XA transaction consisting of two failed
995 # non-transactional statements should be binlogged
996 connection server_1;
997 set @sav_binlog_format = @@binlog_format;
998 set @@binlog_format = row;
999 set @@global.binlog_format = row;
1000 connection server_1;
1001 connection server_2;
1002 connection server_3;
1003 connection server_1;
1004 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
1005 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
1006 include/save_master_gtid.inc
1007 connection server_3;
1008 include/sync_with_master_gtid.inc
1009 connection server_1;
1010 XA START 'x';
1011 INSERT INTO tm VALUES (1),(1);;
1012 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
1013 INSERT INTO tm VALUES (2),(2);;
1014 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
1015 XA END 'x';
1016 XA PREPARE 'x';
1017 XA COMMIT 'x';;
1018 include/save_master_gtid.inc
1019 FLUSH LOGS;
1020 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
1021 include/assert_grep.inc [server_1 should not binlog XA transaction]
1022 connection server_2;
1023 include/sync_with_master_gtid.inc
1024 FLUSH LOGS;
1025 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
1026 include/assert_grep.inc [server_2 should not binlog XA transaction]
1027 connection server_3;
1028 include/sync_with_master_gtid.inc
1029 FLUSH LOGS;
1030 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
1031 include/assert_grep.inc [server_3 should not binlog XA transaction]
1032 connection server_1;
1033 DROP TABLE ti,tm;
1034 include/save_master_gtid.inc
1035 connection server_3;
1036 include/sync_with_master_gtid.inc
1037 connection server_1;
1038 connection server_2;
1039 connection server_3;
1040 connection server_1;
1041 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
1042 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
1043 include/save_master_gtid.inc
1044 connection server_3;
1045 include/sync_with_master_gtid.inc
1046 connection server_1;
1047 connect con1,localhost,root,,;
1048 XA START 'x';
1049 INSERT INTO tm VALUES (1),(1);;
1050 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
1051 INSERT INTO tm VALUES (2),(2);;
1052 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
1053 XA END 'x';
1054 XA PREPARE 'x';
1055 disconnect con1;
1056 connection server_1;
1057 XA RECOVER;
1058 formatID gtrid_length bqual_length data
1059 1 1 0 x
1060 XA COMMIT 'x';;
1061 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
1062 include/save_master_gtid.inc
1063 FLUSH LOGS;
1064 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
1065 include/assert_grep.inc [server_1 should not binlog XA transaction]
1066 connection server_2;
1067 include/sync_with_master_gtid.inc
1068 FLUSH LOGS;
1069 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
1070 include/assert_grep.inc [server_2 should not binlog XA transaction]
1071 connection server_3;
1072 include/sync_with_master_gtid.inc
1073 FLUSH LOGS;
1074 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
1075 include/assert_grep.inc [server_3 should not binlog XA transaction]
1076 connection server_1;
1077 DROP TABLE ti,tm;
1078 include/save_master_gtid.inc
1079 connection server_3;
1080 include/sync_with_master_gtid.inc
1081 connection server_1;
1082 connection server_2;
1083 connection server_3;
1084 connection server_1;
1085 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
1086 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
1087 include/save_master_gtid.inc
1088 connection server_3;
1089 include/sync_with_master_gtid.inc
1090 connection server_1;
1091 XA START 'x';
1092 INSERT INTO tm VALUES (1),(1);;
1093 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
1094 INSERT INTO tm VALUES (2),(2);;
1095 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
1096 XA END 'x';
1097 XA PREPARE 'x';
1098 XA ROLLBACK 'x';;
1099 Warnings:
1100 Warning 1196 Some non-transactional changed tables couldn't be rolled back
1101 include/save_master_gtid.inc
1102 FLUSH LOGS;
1103 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
1104 include/assert_grep.inc [server_1 should not binlog XA transaction]
1105 connection server_2;
1106 include/sync_with_master_gtid.inc
1107 FLUSH LOGS;
1108 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
1109 include/assert_grep.inc [server_2 should not binlog XA transaction]
1110 connection server_3;
1111 include/sync_with_master_gtid.inc
1112 FLUSH LOGS;
1113 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
1114 include/assert_grep.inc [server_3 should not binlog XA transaction]
1115 connection server_1;
1116 DROP TABLE ti,tm;
1117 include/save_master_gtid.inc
1118 connection server_3;
1119 include/sync_with_master_gtid.inc
1120 connection server_1;
1121 connection server_2;
1122 connection server_3;
1123 connection server_1;
1124 CREATE TABLE tm (a INT PRIMARY KEY) engine=myisam;
1125 CREATE TABLE ti (a INT PRIMARY KEY) engine=innodb;
1126 include/save_master_gtid.inc
1127 connection server_3;
1128 include/sync_with_master_gtid.inc
1129 connection server_1;
1130 connect con1,localhost,root,,;
1131 XA START 'x';
1132 INSERT INTO tm VALUES (1),(1);;
1133 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
1134 INSERT INTO tm VALUES (2),(2);;
1135 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
1136 XA END 'x';
1137 XA PREPARE 'x';
1138 disconnect con1;
1139 connection server_1;
1140 XA RECOVER;
1141 formatID gtrid_length bqual_length data
1142 1 1 0 x
1143 XA ROLLBACK 'x';;
1144 ERROR XA100: XA_RBROLLBACK: Transaction branch was rolled back
1145 include/save_master_gtid.inc
1146 FLUSH LOGS;
1147 # MYSQL_BINLOG server_1_datadir/binlog_filename --result-file=assert_file
1148 include/assert_grep.inc [server_1 should not binlog XA transaction]
1149 connection server_2;
1150 include/sync_with_master_gtid.inc
1151 FLUSH LOGS;
1152 # MYSQL_BINLOG server_2_datadir/binlog_filename --result-file=assert_file
1153 include/assert_grep.inc [server_2 should not binlog XA transaction]
1154 connection server_3;
1155 include/sync_with_master_gtid.inc
1156 FLUSH LOGS;
1157 # MYSQL_BINLOG server_3_datadir/binlog_filename --result-file=assert_file
1158 include/assert_grep.inc [server_3 should not binlog XA transaction]
1159 connection server_1;
1160 DROP TABLE ti,tm;
1161 include/save_master_gtid.inc
1162 connection server_3;
1163 include/sync_with_master_gtid.inc
1164 connection server_1;
1165 set @@binlog_format = @sav_binlog_format;
1166 set @@global.binlog_format = @sav_binlog_format;
1167 #
1168 # MDEV-33921.1: If a slave's replication of an XA transaction results in
1169 # an empty transaction, e.g. due to replication filters, the slave
1170 # should not binlog any part of the XA transaction.
1171 connection server_1;
1172 create database db1;
1173 create database db2;
1174 create table db1.t1 (a int) engine=innodb;
1175 include/save_master_gtid.inc
1176 connection server_3;
1177 include/sync_with_master_gtid.inc
1178 include/stop_slave.inc
1179 change master to master_use_gtid=slave_pos;
1180 connection server_2;
1181 include/stop_slave.inc
1182 SET @@GLOBAL.replicate_ignore_db= "";
1183 SET @@GLOBAL.replicate_do_db= "db2";
1184 change master to master_use_gtid=slave_pos;
1185 include/start_slave.inc
1186 connection server_1;
1187 use db1;
1188 XA START "x1";
1189 insert into db1.t1 values (1);
1190 XA END "x1";
1191 XA PREPARE "x1";
1192 XA COMMIT "x1";
1193 include/save_master_gtid.inc
1194 connection server_2;
1195 include/sync_with_master_gtid.inc
1196 connection server_2;
1197 include/save_master_gtid.inc
1198 connection server_3;
1199 include/start_slave.inc
1200 include/sync_with_master_gtid.inc
1201 #
1202 # 33921.2: If the slave shuts down after "preparing" a filtered-to-empty
1203 # XA transaction (and not completing it), then when the respective
1204 # XA completion (COMMIT in this test) command is replicated, the slave
1205 # should not throw ER_XAER_NOTA. Note that internally, the error is
1206 # thrown, but it is ignored because the target db is filtered.
1207 connection server_3;
1208 include/stop_slave.inc
1209 connection server_1;
1210 use db1;
1211 XA START "x2";
1212 insert into db1.t1 values (2);
1213 XA END "x2";
1214 XA PREPARE "x2";
1215 include/save_master_gtid.inc
1216 connection server_2;
1217 include/sync_with_master_gtid.inc
1218 # Connection named slave is needed for reconnection
1219 connect slave,localhost,root,,;
1220 connect slave1,localhost,root,,;
1221 include/rpl_restart_server.inc [server_number=2]
1222 connection server_2;
1223 include/stop_slave.inc
1224 SET @@GLOBAL.replicate_do_db= "db2";
1225 change master to master_use_gtid=slave_pos;
1226 include/start_slave.inc
1227 connection server_1;
1228 XA COMMIT "x2";
1229 include/save_master_gtid.inc
1230 connection server_2;
1231 include/sync_with_master_gtid.inc
1232 include/save_master_gtid.inc
1233 connection server_3;
1234 include/start_slave.inc
1235 include/sync_with_master_gtid.inc
1236 #
1237 # 33921.3: Ensure XA commands are not considered by mysqlbinlog's
1238 # --database filter
1239 connection server_1;
1240 # MYSQL_BINLOG datadir/binlog_file --start-position=pre_xa_pos --database=db2 --result-file=assert_file
1241 include/assert_grep.inc [Mysqlbinlog should output all XA commands from the filtered transaction]
1242 connection server_2;
1243 include/stop_slave.inc
1244 SET @@GLOBAL.replicate_do_db="";
1245 include/start_slave.inc
1246 connection server_1;
1247 drop database db1;
1248 drop database db2;
1249 connection server_1;
1250 include/rpl_end.inc
1251 # End of rpl_xa_empty_transaction.test