1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-26599 Assertion `!table->id' failed in btr_search_lazy_free

btr_search_lazy_free(): Check for !table->id. It is possible that
dict_sys_t::remove(table, ...) has started executing but has not
reached the final part yet. If that is the case, let
dict_sys_t::remove() observe that table->freed_indexes is empty
and let it free the table object.

Reviewed by: Thirunarayanan Balathandayuthapani
Tested by: Saahil Alam
This commit is contained in:
Marko Mäkelä
2025-10-22 09:25:18 +03:00
parent 31d97c3cda
commit 315b60e885

View File

@@ -205,18 +205,16 @@ ATTRIBUTE_COLD static void btr_search_lazy_free(dict_index_t *index)
UT_LIST_REMOVE(table->freed_indexes, index);
index->lock.free();
dict_mem_index_free(index);
const bool destroy= !table->id && !UT_LIST_GET_LEN(table->freed_indexes) &&
!UT_LIST_GET_LEN(table->indexes);
table->autoinc_mutex.wr_unlock();
if (!UT_LIST_GET_LEN(table->freed_indexes) &&
!UT_LIST_GET_LEN(table->indexes))
if (destroy)
{
ut_ad(!table->id);
table->autoinc_mutex.wr_unlock();
table->autoinc_mutex.destroy();
dict_mem_table_free(table);
return;
}
table->autoinc_mutex.wr_unlock();
}
/** Disable the adaptive hash search system and empty the index. */