Browse Source

MDEV-32487 Check plugin is ready when resolving storage engine

This handles the situation when one thread is still initiating a
storage engine plugin, while another is creating a table using it.
bb-10.5-MDEV-33952-galera
Yuchen Pei 1 year ago
parent
commit
a6ae1c2dfb
No known key found for this signature in database GPG Key ID: 3DD1B35105743563
  1. 11
      sql/handler.cc

11
sql/handler.cc

@ -291,13 +291,20 @@ redo:
}
/*
Resolve the storage engine by name.
Succeed if the storage engine is found and initialised. Otherwise
fail if the sql mode contains NO_ENGINE_SUBSTITUTION.
*/
bool
Storage_engine_name::resolve_storage_engine_with_error(THD *thd,
handlerton **ha,
bool tmp_table)
{
if (plugin_ref plugin= ha_resolve_by_name(thd, &m_storage_engine_name,
tmp_table))
plugin_ref plugin;
if ((plugin= ha_resolve_by_name(thd, &m_storage_engine_name, tmp_table)) &&
(plugin_ref_to_int(plugin)->state == PLUGIN_IS_READY))
{
*ha= plugin_hton(plugin);
return false;

Loading…
Cancel
Save