diff options
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r-- | sql/transaction.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sql/transaction.cc b/sql/transaction.cc index d6ef160206b..47d83a4fa05 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -835,18 +835,9 @@ bool trans_xa_commit(THD *thd) my_error(ER_OUT_OF_RESOURCES, MYF(0)); DBUG_RETURN(TRUE); } - /* - xid_state.in_thd is always true beside of xa recovery procedure. - Note, that there is no race condition here between xid_cache_search - and xid_cache_delete, since we always delete our own XID - (thd->lex->xid == thd->transaction.xid_state.xid). - The only case when thd->lex->xid != thd->transaction.xid_state.xid - and xid_state->in_thd == 0 is in the function - xa_cache_insert(XID, xa_states), which is called before starting - client connections, and thus is always single-threaded. - */ + XID_STATE *xs= xid_cache_search(thd, thd->lex->xid); - res= !xs || xs->in_thd; + res= !xs; if (res) my_error(ER_XAER_NOTA, MYF(0)); else @@ -947,7 +938,7 @@ bool trans_xa_rollback(THD *thd) } XID_STATE *xs= xid_cache_search(thd, thd->lex->xid); - if (!xs || xs->in_thd) + if (!xs) my_error(ER_XAER_NOTA, MYF(0)); else { |