From d32ec7d48e1c942773da2a1a4d2233d755a8e58e Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Mon, 20 Jan 2025 12:14:46 +0100 Subject: [PATCH] MDEV-35852 : ASAN heap-use-after-free in WSREP_DEBUG after INSERT DELAYED Post-fix: remove unnecessary warning messages when wrep is not used. --- sql/handler.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index a6e5043a636..979e9315571 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2158,11 +2158,14 @@ int ha_rollback_trans(THD *thd, bool all) my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err); error=1; #ifdef WITH_WSREP - WSREP_WARN("handlerton rollback failed, thd %lld %lld " - "conf %d wsrep_err %s SQL %s", - thd->thread_id, thd->query_id, thd->wsrep_trx().state(), - wsrep::to_c_string(thd->wsrep_cs().current_error()), - thd->query()); + if (WSREP(thd)) + { + WSREP_WARN("handlerton rollback failed, thd %lld %lld " + "conf %d wsrep_err %s SQL %s", + thd->thread_id, thd->query_id, thd->wsrep_trx().state(), + wsrep::to_c_string(thd->wsrep_cs().current_error()), + thd->query()); + } #endif /* WITH_WSREP */ } status_var_increment(thd->status_var.ha_rollback_count);