mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Move XID_state::xa_state handing inside xa.cc
Let xid_cache_insert()/xid_cache_delete() handle xa_state. Let session tracker use is_explicit_XA() rather than xa_state != XA_NOTR. Fixed open_tables() to refuse data access in XA_ROLLBACK_ONLY state. Removed dead code from THD::cleanup(). It was supposed to be a reminder, but it got messed up over time. spider_internal_start_trx() is called either with XA_NOTR or XA_ACTIVE, which is guarded by server callers. Thus is_explicit_XA() is acceptable replacement for XA_ACTIVE check (which was likely wrong anyway). Setting xa_state to XA_PREPARED in spider_internal_xa_prepare() isn't meaningful, as this value is never accessed later. It can't be accessed by current thread and it can't be recovered either. It can only be accessed by spider internally, which never happens. Make spider_xa_lock()/spider_xa_unlock() static. Part of MDEV-7974 - backport fix for mysql bug#12161 (XA and binlog)
This commit is contained in:
@ -1509,12 +1509,6 @@ void THD::cleanup(void)
|
||||
DBUG_ASSERT(cleanup_done == 0);
|
||||
|
||||
set_killed(KILL_CONNECTION);
|
||||
#ifdef ENABLE_WHEN_BINLOG_WILL_BE_ABLE_TO_PREPARE
|
||||
if (transaction.xid_state.xa_state == XA_PREPARED)
|
||||
{
|
||||
#error xid_state in the cache should be replaced by the allocated value
|
||||
}
|
||||
#endif
|
||||
#ifdef WITH_WSREP
|
||||
if (wsrep_cs().state() != wsrep::client_state::s_none)
|
||||
{
|
||||
@ -1529,9 +1523,8 @@ void THD::cleanup(void)
|
||||
delete_dynamic(&user_var_events);
|
||||
close_temporary_tables();
|
||||
|
||||
transaction.xid_state.xa_state= XA_NOTR;
|
||||
trans_rollback(this);
|
||||
xid_cache_delete(this, &transaction.xid_state);
|
||||
trans_rollback(this);
|
||||
|
||||
DBUG_ASSERT(open_tables == NULL);
|
||||
/*
|
||||
|
Reference in New Issue
Block a user