summaryrefslogtreecommitdiff
path: root/sql/transaction.cc
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2012-03-15 15:10:57 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2012-03-15 15:10:57 +0600
commit2b68b4bc1b7a450fcdd07412a3b05a91ecbfce8d (patch)
tree0a50caefd76d598d9153e571b2caaeab0551afde /sql/transaction.cc
parent75c2eb6df323ae6f14bae944f5e88750de6da467 (diff)
downloadmariadb-git-2b68b4bc1b7a450fcdd07412a3b05a91ecbfce8d.tar.gz
This patch fixes the bug#13737343 (formerly known as 64374): XA TRANSACTIONS
AND SAVEPOINT. The bug was introduced by the patch for bug#11766752. This patch sets too strong condition on XA state for SAVEPOINT statement that disallows its execution during XA transaction. But since the statement SAVEPOINT doesn't imply implicit commit we can allow its handling during XA transaction. The patch explicitly check for transaction state against states XA_NOTR and XA_ACTIVE for which the handling of statement SAVEPOINT for XA transaction is allowed. mysql-test/t/xa.test: Testcase was adjusted for bug#13737343. Now SAVEPOINT is allowed for XA transactions in ACTIVE state.
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r--sql/transaction.cc2
1 files changed, 1 insertions, 1 deletions
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);