Commit 9739cf18 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-25664 Potential hang in purge for virtual columns

ha_innobase::open(): If the table is only being opened by purge
for evaluating virtual column values, avoid invoking
initialize_auto_increment(), because the purge thread may already
be holding an shared latch on the clustered index root page.
Shared latches are not recursive. The additional request would lead
to a hang if another thread has started waiting for an exclusive latch.
parent 2087d47a
......@@ -6488,7 +6488,9 @@ ha_innobase::open(const char* name, int, uint)
dict_table_get_format(m_prebuilt->table));
}
if (m_prebuilt->table == NULL
const my_bool for_vc_purge = THDVAR(thd, background_thread);
if (for_vc_purge || m_prebuilt->table == NULL
|| dict_table_is_temporary(m_prebuilt->table)
|| m_prebuilt->table->persistent_autoinc
|| !m_prebuilt->table->is_readable()) {
......@@ -6512,7 +6514,7 @@ ha_innobase::open(const char* name, int, uint)
}
}
if (!THDVAR(thd, background_thread)) {
if (!for_vc_purge) {
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment