mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
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.
This commit is contained in:
@@ -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
|
bool
|
||||||
Storage_engine_name::resolve_storage_engine_with_error(THD *thd,
|
Storage_engine_name::resolve_storage_engine_with_error(THD *thd,
|
||||||
handlerton **ha,
|
handlerton **ha,
|
||||||
bool tmp_table)
|
bool tmp_table)
|
||||||
{
|
{
|
||||||
if (plugin_ref plugin= ha_resolve_by_name(thd, &m_storage_engine_name,
|
plugin_ref plugin;
|
||||||
tmp_table))
|
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);
|
*ha= plugin_hton(plugin);
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user