diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-09-18 20:19:03 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-09-18 20:20:04 +0530 |
commit | f94d9ab9f8f03585f01f426e2479833a292527c4 (patch) | |
tree | fa56c9f2bb48e07fab80fe07a4d492a94f1c2a48 /storage/innobase/trx | |
parent | b3a7c07eae000f20c62812ecf7a8b9349aedc8a1 (diff) | |
download | mariadb-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.cc | 12 |
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); |