| 1 |
############################################################################### |
| 2 |
# Bug#24812958: REPLICATION ERROR OCCURS, USE XA TRANSACTION(ONE PHASE) |
| 3 |
# |
| 4 |
# Problem: |
| 5 |
# ======= |
| 6 |
# Use XA transaction and execute DELETE or UPDATE statement. |
| 7 |
# If `0 rows affected`, replication error occurs. |
| 8 |
# But over 1 rows affected, replication error doesn't occur. |
| 9 |
# And if use `XA PREPARE` (not use `ONE PHASE`), replication error doesnot |
| 10 |
# occur. |
| 11 |
# |
| 12 |
# Test: |
| 13 |
# ===== |
| 14 |
# 1) Start an XA transaction named 'xatest' on master. |
| 15 |
# 2) Execute DML operation such that '0' rows are affected. |
| 16 |
# 3) Execute XA COMMIT 'xatest' ONE PHASE. |
| 17 |
# 4) On slave wait till the above XA COMMIT 'xatest' ONE PHASE command is |
| 18 |
# executed. |
| 19 |
# 5) Verify that slave server doesn't fail with 'ER_XAER_RMFAIL' error. |
| 20 |
############################################################################### |
| 21 |
--source include/have_binlog_format_statement.inc |
| 22 |
--source include/master-slave.inc |
| 23 |
|
| 24 |
# Suppression of error messages |
| 25 |
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format'); |
| 26 |
|
| 27 |
CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)) ENGINE=InnoDB; |
| 28 |
XA START 'xatest'; |
| 29 |
--disable_warnings ER_BINLOG_UNSAFE_STATEMENT ONCE |
| 30 |
DELETE FROM t1 where id=1; |
| 31 |
XA END 'xatest'; |
| 32 |
XA COMMIT 'xatest' ONE PHASE; |
| 33 |
--source include/sync_slave_sql_with_master.inc |
| 34 |
|
| 35 |
--let diff_tables=master:test.t1, slave:test.t1 |
| 36 |
--source include/diff_tables.inc |
| 37 |
|
| 38 |
--source include/rpl_connection_master.inc |
| 39 |
DROP TABLE t1; |
| 40 |
--source include/rpl_end.inc |