diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-22 12:36:11 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-22 12:36:11 +0300 |
commit | 30c9833751529d403927b9832268bef2c36acbd8 (patch) | |
tree | 24fa8d8f6841eb96b26ba1257a2173a601bf59a5 | |
parent | 1b81e9659377973e2044a1e3f0001a259bbd7199 (diff) | |
download | mariadb-git-30c9833751529d403927b9832268bef2c36acbd8.tar.gz |
MDEV-22332: Assertion mtr_started == mtr.is_active() failed
Commit 5defdc382bbf606b83e556c4f0d29dcd7954ebbc
(which aimed to reduce sizeof(mtr_t) for non-debug builds)
replaced the ternary mtr_t::status with two debug-only bool
data members m_start, m_commit and inadvertently made the
(now debug-only) predicate mtr_t::is_active() wrongly hold
after mtr_t::commit().
mtr_t::is_active(): Evaluate both m_start and m_commit,
to be compatible with the old definition.
row_merge_read_clustered_index(): Correct a debug assertion.
-rw-r--r-- | storage/innobase/include/mtr0mtr.h | 3 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 2f71155187c..2664054f5c6 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -614,7 +614,8 @@ private: #ifdef UNIV_DEBUG public: /** @return whether the mini-transaction is active */ - bool is_active() const { ut_ad(!m_commit || m_start); return m_start; } + bool is_active() const + { ut_ad(!m_commit || m_start); return m_start && !m_commit; } /** @return whether the mini-transaction has been committed */ bool has_committed() const { ut_ad(!m_commit || m_start); return m_commit; } private: diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index e4943195fb1..93d86a96067 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1984,7 +1984,7 @@ row_merge_read_clustered_index( os_thread_yield(); scan_next: ut_ad(!mtr_started); - ut_ad(mtr.is_active()); + ut_ad(!mtr.is_active()); mtr.start(); mtr_started = true; /* Restore position on the record, or its |