From 2d16452a31e7c2c99d191f34897e519928541cda Mon Sep 17 00:00:00 2001 From: mkaruza Date: Thu, 26 Mar 2020 09:45:03 +0100 Subject: MDEV-22021: Galera database could get inconsistent with rollback to savepoint When binlog is disabled, WSREP will not behave correctly when SAVEPOINT ROLLBACK is executed since we don't register handlers for such case. Fixed by registering WSREP handlerton for SAVEPOINT related commands. --- sql/transaction.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/transaction.cc') diff --git a/sql/transaction.cc b/sql/transaction.cc index 7cb6e132932..72b7f8e6fe4 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -614,6 +614,9 @@ bool trans_savepoint(THD *thd, LEX_STRING name) if (thd->transaction.xid_state.check_has_uncommitted_xa()) DBUG_RETURN(TRUE); + if (WSREP_ON) + wsrep_register_hton(thd, thd->in_multi_stmt_transaction_mode()); + sv= find_savepoint(thd, name); if (*sv) /* old savepoint of the same name exists */ @@ -690,6 +693,9 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name) if (thd->transaction.xid_state.check_has_uncommitted_xa()) DBUG_RETURN(TRUE); + if (WSREP_ON) + wsrep_register_hton(thd, thd->in_multi_stmt_transaction_mode()); + /** Checking whether it is safe to release metadata locks acquired after savepoint, if rollback to savepoint is successful. -- cgit v1.2.1