| 1 |
# ==== Requirements ==== |
| 2 |
# |
| 3 |
# R1. When '@@SESSION.GTID_NEXT' is set to 'AUTOMATIC', |
| 4 |
# an XA empty transaction, ended with 'XA COMMIT |
| 5 |
# ONE PHASE', nothing should be logged to the |
| 6 |
# binlog. |
| 7 |
# R2. When '@@SESSION.GTID_NEXT' is set manually to a GTID, |
| 8 |
# an empty XA transation, ended with 'XA COMMIT |
| 9 |
# ONE PHASE', should be written to the binary log |
| 10 |
# as an empty transaction (BEGIN; COMMIT;). |
| 11 |
# |
| 12 |
# ==== Implementation ==== |
| 13 |
# |
| 14 |
# With default setup: |
| 15 |
# 1) Start with a GTID_NEXT value of 'AUTOMATIC', |
| 16 |
# start a XA transaction, |
| 17 |
# and end the transaction with 'XA COMMIT ONE PHASE'. |
| 18 |
# |
| 19 |
# 2) Start with a GTID_NEXT value set manually, |
| 20 |
# start a XA transaction, |
| 21 |
# and end the transaction with 'XA COMMIT ONE PHASE'. |
| 22 |
# |
| 23 |
# ==== References ==== |
| 24 |
# |
| 25 |
# Bug#27041402 ASSERTION `NEW_VALUE >= 0' FAILED. |
| 26 |
|
| 27 |
--source include/have_binlog_format_mixed_or_row.inc |
| 28 |
--source include/master-slave.inc |
| 29 |
|
| 30 |
--echo # |
| 31 |
--echo # 1) Start with a GTID_NEXT value of 'AUTOMATIC', |
| 32 |
--echo # start a XA transaction, |
| 33 |
--echo # and end the transaction with 'XA COMMIT ONE PHASE'. |
| 34 |
--echo # |
| 35 |
|
| 36 |
--source include/rpl_connection_master.inc |
| 37 |
|
| 38 |
--source include/save_binlog_position.inc |
| 39 |
--let $pre_commit_position= $binlog_position |
| 40 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 41 |
XA START 'trx'; |
| 42 |
XA END 'trx'; |
| 43 |
XA COMMIT 'trx' ONE PHASE; |
| 44 |
--source include/save_binlog_position.inc |
| 45 |
--let $assert_cond= $pre_commit_position = $binlog_position |
| 46 |
--let $assert_text= Empty transaction, binlog position is the same |
| 47 |
--source include/assert.inc |
| 48 |
|
| 49 |
--source include/sync_slave_sql_with_master.inc |
| 50 |
|
| 51 |
--source include/rpl_connection_master.inc |
| 52 |
|
| 53 |
--echo # |
| 54 |
--echo # 2) Start with a GTID_NEXT value set manually, |
| 55 |
--echo # start a XA transaction, |
| 56 |
--echo # and end the transaction with 'XA COMMIT ONE PHASE'. |
| 57 |
--echo # |
| 58 |
|
| 59 |
SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'; |
| 60 |
XA START 'trx'; |
| 61 |
XA END 'trx'; |
| 62 |
XA COMMIT 'trx' ONE PHASE; |
| 63 |
|
| 64 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 65 |
|
| 66 |
--let $assert_cond= [SELECT GTID_SUBSET("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1", @@GLOBAL.GTID_EXECUTED)] != 0 |
| 67 |
--let $assert_text= Transaction is present in GTID_EXECUTED |
| 68 |
--source include/assert.inc |
| 69 |
|
| 70 |
--let $event_sequence= Gtid/SET.* # Query/BEGIN # Query/COMMIT |
| 71 |
--source include/assert_binlog_events.inc |
| 72 |
|
| 73 |
--source include/sync_slave_sql_with_master.inc |
| 74 |
|
| 75 |
--source include/rpl_end.inc |