mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 02:47:37 +02:00
MDEV-15880: ASAN heap-use-after-free with innodb_evict_tables_on_commit_debug
trx_update_mod_tables_timestamp(): When implementing
innodb_evict_tables_on_commit_debug, do not evict tables
on which transactional locks exist.
This debug variable was broken since its introduction in
commit 947b0b5722.
This commit is contained in:
parent
e26c822aa0
commit
b75563cdfd
1 changed files with 7 additions and 2 deletions
|
|
@ -1295,7 +1295,8 @@ trx_update_mod_tables_timestamp(
|
|||
dict_table_t* table = it->first;
|
||||
table->update_time = now;
|
||||
#ifdef UNIV_DEBUG
|
||||
if (preserve_tables || table->get_ref_count()) {
|
||||
if (preserve_tables || table->get_ref_count()
|
||||
|| UT_LIST_GET_LEN(table->locks)) {
|
||||
/* do not evict when committing DDL operations
|
||||
or if some other transaction is holding the
|
||||
table handle */
|
||||
|
|
@ -1304,7 +1305,11 @@ trx_update_mod_tables_timestamp(
|
|||
/* recheck while holding the mutex that blocks
|
||||
table->acquire() */
|
||||
mutex_enter(&dict_sys_mutex);
|
||||
if (!table->get_ref_count()) {
|
||||
mutex_enter(&lock_sys.mutex);
|
||||
const bool do_evict = !table->get_ref_count()
|
||||
&& !UT_LIST_GET_LEN(table->locks);
|
||||
mutex_exit(&lock_sys.mutex);
|
||||
if (do_evict) {
|
||||
# if MYSQL_VERSION_ID >= 100405
|
||||
dict_sys.remove(table, true);
|
||||
# else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue