mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +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;
|
dict_table_t* table = it->first;
|
||||||
table->update_time = now;
|
table->update_time = now;
|
||||||
#ifdef UNIV_DEBUG
|
#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
|
/* do not evict when committing DDL operations
|
||||||
or if some other transaction is holding the
|
or if some other transaction is holding the
|
||||||
table handle */
|
table handle */
|
||||||
|
|
@ -1304,7 +1305,11 @@ trx_update_mod_tables_timestamp(
|
||||||
/* recheck while holding the mutex that blocks
|
/* recheck while holding the mutex that blocks
|
||||||
table->acquire() */
|
table->acquire() */
|
||||||
mutex_enter(&dict_sys_mutex);
|
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
|
# if MYSQL_VERSION_ID >= 100405
|
||||||
dict_sys.remove(table, true);
|
dict_sys.remove(table, true);
|
||||||
# else
|
# else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue