diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index 6db257eafd5..e7a62dbd3bc 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -174,7 +174,6 @@ CREATE TABLE t1 (a INT) engine=InnoDB; XA START 'a'; INSERT INTO t1 VALUES (1); SAVEPOINT savep; -ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state XA END 'a'; SELECT * FROM t1; ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index cb4345e9479..fe49d2d5e31 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -298,7 +298,6 @@ CREATE TABLE t1 (a INT) engine=InnoDB; XA START 'a'; INSERT INTO t1 VALUES (1); ---error ER_XAER_RMFAIL SAVEPOINT savep; XA END 'a'; diff --git a/sql/transaction.cc b/sql/transaction.cc index 94a32200274..3359decbcd5 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -390,7 +390,7 @@ bool trans_savepoint(THD *thd, LEX_STRING name) DBUG_RETURN(FALSE); enum xa_states xa_state= thd->transaction.xid_state.xa_state; - if (xa_state != XA_NOTR) + if (xa_state != XA_NOTR && xa_state != XA_ACTIVE) { my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]); DBUG_RETURN(TRUE);