diff options
author | mkaruza <mario.karuza@galeracluster.com> | 2020-03-20 10:46:44 +0100 |
---|---|---|
committer | mkaruza <mario.karuza@galeracluster.com> | 2020-03-23 09:34:52 +0100 |
commit | 5e8039ce4b8bda5e2df265c849186123bfedb579 (patch) | |
tree | db705361e6229dc152de2bcef2b612633834b4a1 | |
parent | 5d1b8f4152c8b71ad8a911432dd8a6a00c470c52 (diff) | |
download | mariadb-git-5e8039ce4b8bda5e2df265c849186123bfedb579.tar.gz |
MDEV-21988: Assertion failure mysqld: bool trans_commit_stmt(THD*): Assertion `thd->in_active_multi_stmt_transaction() || thd->m_transaction_psi == __null' failed.
Set temporary `SERVER_STATUS_IN_TRANS` so assert is not triggered in `trans_commit_stmt`.
-rw-r--r-- | sql/wsrep_schema.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc index 95c788ba806..80bc53b1790 100644 --- a/sql/wsrep_schema.cc +++ b/sql/wsrep_schema.cc @@ -139,6 +139,25 @@ private: my_bool m_wsrep_on; }; +class thd_server_status +{ +public: + thd_server_status(THD* thd, uint server_status, bool condition) + : m_thd(thd) + , m_thd_server_status(thd->server_status) + { + if (condition) + thd->server_status= server_status; + } + ~thd_server_status() + { + m_thd->server_status= m_thd_server_status; + } +private: + THD* m_thd; + uint m_thd_server_status; +}; + class thd_context_switch { public: @@ -1094,6 +1113,9 @@ int Wsrep_schema::remove_fragments(THD* thd, } else { + Wsrep_schema_impl::thd_server_status + thd_server_status(thd, thd->server_status | SERVER_STATUS_IN_TRANS, + thd->in_multi_stmt_transaction_mode()); Wsrep_schema_impl::finish_stmt(thd); } |