summaryrefslogtreecommitdiff
path: root/sql/transaction.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r--sql/transaction.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/transaction.cc b/sql/transaction.cc
index e2c120ffebb..7f94d98179e 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -197,7 +197,7 @@ bool trans_begin(THD *thd, uint flags)
Release transactional metadata locks only after the
transaction has been committed.
*/
- thd->mdl_context.release_transactional_locks();
+ thd->release_transactional_locks();
// The RO/RW options are mutually exclusive.
DBUG_ASSERT(!((flags & MYSQL_START_TRANS_OPT_READ_ONLY) &&
@@ -894,11 +894,13 @@ bool trans_xa_prepare(THD *thd)
/**
Commit and terminate the a XA transaction.
+ Transactional locks are released if transaction ended
@param thd Current thread
@retval FALSE Success
@retval TRUE Failure
+
*/
bool trans_xa_commit(THD *thd)
@@ -989,6 +991,7 @@ bool trans_xa_commit(THD *thd)
thd->transaction.xid_state.xa_state= XA_NOTR;
trans_track_end_trx(thd);
+ thd->mdl_context.release_transactional_locks();
DBUG_RETURN(res);
}
@@ -996,6 +999,7 @@ bool trans_xa_commit(THD *thd)
/**
Roll back and terminate a XA transaction.
+ Transactional locks are released if transaction ended
@param thd Current thread
@@ -1046,6 +1050,7 @@ bool trans_xa_rollback(THD *thd)
thd->transaction.xid_state.xa_state= XA_NOTR;
trans_track_end_trx(thd);
+ thd->mdl_context.release_transactional_locks();
DBUG_RETURN(res);
}