Commit e83a8a89 authored by Andrei's avatar Andrei Committed by Brandon Nesterenko

Some cleanup.

parent cb29f566
......@@ -1426,7 +1426,7 @@ int ha_prepare(THD *thd)
handlerton *ht= ha_info->ht();
if (ht->prepare)
{
DBUG_EXECUTE_IF("simulate_crash_after_first_engine_prepare",
DBUG_EXECUTE_IF("simulate_crash_before_last_engine_prepare",
if (!ha_info->next()) DBUG_SUICIDE(););
if (unlikely(prepare_or_error(ht, thd, all)))
......
......@@ -11065,6 +11065,10 @@ bool MYSQL_BIN_LOG::recover_explicit_xa_prepare()
// partially engine-prepared XA is first cleaned out prior replay
thd->lex->sql_command= SQLCOM_XA_ROLLBACK;
ha_commit_or_rollback_by_xid(&gev->xid, 0);
if (thd->fix_xid_hash_pins())
sql_print_error(ER(ER_OUT_OF_RESOURCES));
if (auto xs= xid_cache_search(thd, &gev->xid))
xid_cache_delete(thd, xs);
}
else
--recover_xa_count;
......
......@@ -243,7 +243,7 @@ void xid_cache_free()
Find recovered XA transaction by XID.
*/
static XID_cache_element *xid_cache_search(THD *thd, XID *xid)
XID_cache_element *xid_cache_search(THD *thd, XID *xid)
{
DBUG_ASSERT(thd->xid_hash_pins);
XID_cache_element *element=
......@@ -308,7 +308,7 @@ bool xid_cache_insert(THD *thd, XID_STATE *xid_state, XID *xid)
}
static void xid_cache_delete(THD *thd, XID_cache_element *&element)
void xid_cache_delete(THD *thd, XID_cache_element *&element)
{
DBUG_ASSERT(thd->xid_hash_pins);
element->mark_uninitialized();
......
......@@ -44,6 +44,8 @@ void xid_cache_free(void);
bool xid_cache_insert(XID *xid);
bool xid_cache_insert(THD *thd, XID_STATE *xid_state, XID *xid);
void xid_cache_delete(THD *thd, XID_STATE *xid_state);
XID_cache_element *xid_cache_search(THD *thd, XID *xid);
void xid_cache_delete(THD *thd, XID_cache_element *&element);
bool trans_xa_start(THD *thd);
bool trans_xa_end(THD *thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment