summaryrefslogtreecommitdiff
path: root/storage/innobase/trx
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-09-18 20:19:03 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-09-18 20:20:04 +0530
commitf94d9ab9f8f03585f01f426e2479833a292527c4 (patch)
treefa56c9f2bb48e07fab80fe07a4d492a94f1c2a48 /storage/innobase/trx
parentb3a7c07eae000f20c62812ecf7a8b9349aedc8a1 (diff)
downloadmariadb-git-f94d9ab9f8f03585f01f426e2479833a292527c4.tar.gz
MDEV-20483 Follow-up fix
At commit, trx->lock.table_locks (which is a cache of trx_locks) can consist of NULL pointers. Add a debug assertion for that, and clear the vector.
Diffstat (limited to 'storage/innobase/trx')
-rw-r--r--storage/innobase/trx/trx0trx.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 88fe5e548a9..869fe08a6ba 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -561,6 +561,8 @@ inline void trx_t::release_locks()
if (UT_LIST_GET_LEN(lock.trx_locks))
lock_trx_release_locks(this);
+ else
+ lock.table_locks.clear();
}
/********************************************************************//**
@@ -1681,6 +1683,16 @@ trx_commit_in_memory(
DBUG_LOG("trx", "Autocommit in memory: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
} else {
+#ifdef UNIV_DEBUG
+ if (!UT_LIST_GET_LEN(trx->lock.trx_locks)) {
+ for (lock_list::iterator it
+ = trx->lock.table_locks.begin();
+ it != trx->lock.table_locks.end();
+ it++) {
+ ut_ad(!*it);
+ }
+ }
+#endif /* UNIV_DEBUG */
trx_mutex_enter(trx);
trx->commit_state();
trx_mutex_exit(trx);