From c9356223c9677f9d488d6768902764de03fc89ac Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 18 Jan 2022 13:57:27 +0200 Subject: [PATCH] MDEV-19555 assert Diagnostics_area::sql_errno() in ha_rollback_trans Fixed the assert to restore pre-refactoring condition for calling set_error() equivalent. --- sql/handler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/handler.cc b/sql/handler.cc index 18a0e00be10..49849f46908 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1957,7 +1957,8 @@ int ha_rollback_trans(THD *thd, bool all) Thanks to possibility of MDL deadlock rollback request can come even if transaction hasn't been started in any transactional storage engine. */ - if (thd->transaction_rollback_request) + if (thd->transaction_rollback_request && + thd->transaction.xid_state.is_explicit_XA()) thd->transaction.xid_state.set_error(thd->get_stmt_da()->sql_errno()); thd->has_waiter= false;