From 0018df2b553e302a97a85e3f6120c2f5126fe758 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Tue, 5 Dec 2023 01:40:57 +0100 Subject: [PATCH] galera fix: Assertion `WSREP(thd)` failed in wsrep_restore_kill_after_commit() Wsrep_commit_empty happens too early when wsrep is disabled. Let the cleanup happen at end of statement. Signed-off-by: Julius Goryavsky --- sql/handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/handler.cc b/sql/handler.cc index 7e30968cb1d..22bc363e88c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1660,7 +1660,7 @@ int ha_commit_trans(THD *thd, bool all) thd->m_transaction_psi= NULL; } #ifdef WITH_WSREP - if (wsrep_is_active(thd) && is_real_trans && !error) + if (WSREP(thd) && wsrep_is_active(thd) && is_real_trans && !error) wsrep_commit_empty(thd, all); #endif /* WITH_WSREP */