diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-12-02 18:29:49 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-12-02 18:29:49 +0200 |
commit | 6a1e655cb0d400d8ed44fbfd22151b1d3e7f22d8 (patch) | |
tree | 3915bd814fa0ea7c0219b258a1fb458846a5b0bd /sql/xa.cc | |
parent | e76e12886fd37094d95ca40b8cce45ca3ef28021 (diff) | |
parent | 24ec8eaf66ecd864529309c5edcb8dd6b685f2aa (diff) | |
download | mariadb-git-6a1e655cb0d400d8ed44fbfd22151b1d3e7f22d8.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/xa.cc')
-rw-r--r-- | sql/xa.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/xa.cc b/sql/xa.cc index 15833377fb6..e0defcb92ed 100644 --- a/sql/xa.cc +++ b/sql/xa.cc @@ -404,6 +404,7 @@ bool xa_trans_force_rollback(THD *thd) xid_cache_delete(thd, &thd->transaction->xid_state); trans_track_end_trx(thd); + thd->mdl_context.release_transactional_locks(thd); return rc; } @@ -554,11 +555,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) @@ -718,6 +721,8 @@ bool trans_xa_commit(THD *thd) xid_cache_delete(thd, &xid_state); trans_track_end_trx(thd); + thd->mdl_context.release_transactional_locks(thd); + /* The transaction should be marked as complete in P_S. */ DBUG_ASSERT(thd->m_transaction_psi == NULL || res); DBUG_RETURN(res); @@ -726,6 +731,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 @@ -844,6 +850,10 @@ bool trans_xa_detach(THD *thd) thd->transaction->all.ha_list= 0; thd->transaction->all.no_2pc= 0; thd->m_transaction_psi= 0; + thd->server_status&= ~(SERVER_STATUS_IN_TRANS | + SERVER_STATUS_IN_TRANS_READONLY); + thd->mdl_context.release_transactional_locks(thd); + return false; } |