summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 8243c7377e6..a32d4bad5d2 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1159,10 +1159,12 @@ void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
if (!thd->wsrep_xid.is_null())
{
*xid = *(MYSQL_XID *) &thd->wsrep_xid;
+ return;
}
- else
#endif /* WITH_WSREP */
- *xid = *(MYSQL_XID *) &thd->transaction.xid_state.xid;
+ *xid= thd->transaction.xid_state.is_explicit_XA() ?
+ *(MYSQL_XID *) thd->transaction.xid_state.get_xid() :
+ *(MYSQL_XID *) &thd->transaction.implicit_xid;
}
@@ -1386,7 +1388,7 @@ void THD::init_for_queries()
variables.trans_alloc_block_size,
variables.trans_prealloc_size);
DBUG_ASSERT(!transaction.xid_state.is_explicit_XA());
- DBUG_ASSERT(transaction.xid_state.xid.is_null());
+ DBUG_ASSERT(transaction.implicit_xid.is_null());
}