diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 9f297a66d7a..9e2907e4439 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2329,6 +2329,7 @@ static bool mysql_install_plugin(THD *thd, LEX_CSTRING name, "Plugin initialization function failed."); error = true; } + mysql_mutex_unlock(&LOCK_plugin); /* Store plugin I_S table metadata into DD tables. The @@ -2342,7 +2343,6 @@ static bool mysql_install_plugin(THD *thd, LEX_CSTRING name, "error storing metadata"); } } - mysql_mutex_unlock(&LOCK_plugin); if (!error && store_infoschema_metadata) { Uncommitted_tables_guard uncommitted_tables(thd);