summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei <andrei.elkin@mariadb.com>2022-01-18 13:57:27 +0200
committerAndrei <andrei.elkin@mariadb.com>2022-01-18 13:57:27 +0200
commitaec1b43a3945de09352bb1de956a0df38420d171 (patch)
treea252d0847e0ab69dbda68cc1d8f4ae9307413437
parent940ad66992be981b67d1e45358a75a462d9ddefa (diff)
downloadmariadb-git-aec1b43a3945de09352bb1de956a0df38420d171.tar.gz
MDEV-19555 assert Diagnostics_area::sql_errno() in ha_rollback_trans
Fixed the assert to restore pre-refactoring condition for calling set_error() equivalent.
-rw-r--r--sql/handler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 57992d98c04..c08c480e9b9 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2203,7 +2203,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;