summaryrefslogtreecommitdiff
path: root/sql/transaction.cc
diff options
context:
space:
mode:
authormkaruza <mario.karuza@galeracluster.com>2020-03-26 09:45:03 +0100
committerJan Lindström <jan.lindstrom@mariadb.com>2020-03-31 09:59:37 +0300
commit2d16452a31e7c2c99d191f34897e519928541cda (patch)
treefcbdfb9b7d6b4b9a1884644de47eaa7fd5363b80 /sql/transaction.cc
parent5001487632d60c2d0d9ce5c1be697c016813a994 (diff)
downloadmariadb-git-2d16452a31e7c2c99d191f34897e519928541cda.tar.gz
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.
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r--sql/transaction.cc6
1 files changed, 6 insertions, 0 deletions
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.