summaryrefslogtreecommitdiff
path: root/sql/wsrep_trans_observer.h
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-08-24 14:09:40 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2020-08-25 06:53:52 +0300
commita16f4927dbde19c546b1ba3726529914f8c91730 (patch)
treee12058e1ec8455b36df2d04085177437b7ef9174 /sql/wsrep_trans_observer.h
parent2000d05c2ed85563e35c4548d9518249ddf403df (diff)
downloadmariadb-git-a16f4927dbde19c546b1ba3726529914f8c91730.tar.gz
MDEV-22055: Assertion `active() == false' failed in wsrep::transaction::start_transaction upon ROLLBACK AND CHAIN
The optional AND CHAIN clause is a convenience for initiating a new transaction as soon as the old transaction terminates. Therefore, do not start new transaction if it is already started at wsrep_start_transaction.
Diffstat (limited to 'sql/wsrep_trans_observer.h')
-rw-r--r--sql/wsrep_trans_observer.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h
index 1044cab76ad..05970e8b12f 100644
--- a/sql/wsrep_trans_observer.h
+++ b/sql/wsrep_trans_observer.h
@@ -133,9 +133,11 @@ static inline size_t wsrep_fragments_certified_for_stmt(THD* thd)
static inline int wsrep_start_transaction(THD* thd, wsrep_trx_id_t trx_id)
{
- return (thd->wsrep_cs().state() != wsrep::client_state::s_none ?
- thd->wsrep_cs().start_transaction(wsrep::transaction_id(trx_id)) :
- 0);
+ if (thd->wsrep_cs().state() != wsrep::client_state::s_none) {
+ if (wsrep_is_active(thd) == false)
+ return thd->wsrep_cs().start_transaction(wsrep::transaction_id(trx_id));
+ }
+ return 0;
}
/**/