Skip to content

Commit

Permalink
MDEV-22998 Free thd->mem_root at applier commit or rollback.
Browse files Browse the repository at this point in the history
  • Loading branch information
temeo authored and Jan Lindström committed Jul 24, 2020
1 parent 468e56b commit 3d76af0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sql/wsrep_high_priority_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ int Wsrep_high_priority_service::append_fragment_and_commit(
m_thd->wsrep_cs().after_applying();
m_thd->mdl_context.release_transactional_locks();

free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));

thd_proc_info(m_thd, "wsrep applier committed");

DBUG_RETURN(ret);
Expand Down Expand Up @@ -334,6 +336,8 @@ int Wsrep_high_priority_service::commit(const wsrep::ws_handle& ws_handle,

thd->lex->sql_command= SQLCOM_END;

free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC));

must_exit_= check_exit_status();
DBUG_RETURN(ret);
}
Expand All @@ -346,6 +350,9 @@ int Wsrep_high_priority_service::rollback(const wsrep::ws_handle& ws_handle,
int ret= (trans_rollback_stmt(m_thd) || trans_rollback(m_thd));
m_thd->mdl_context.release_transactional_locks();
m_thd->mdl_context.release_explicit_locks();

free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));

DBUG_RETURN(ret);
}

Expand Down

0 comments on commit 3d76af0

Please sign in to comment.