diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index e5d44d8..8d2a71b 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -934,9 +934,7 @@ static bool plugin_add(MEM_ROOT *tmp_root, mysql_mutex_assert_owner(&LOCK_plugin); if (plugin_find_internal(name_cstr, MYSQL_ANY_PLUGIN)) { - mysql_mutex_unlock(&LOCK_plugin); report_error(report, ER_UDF_EXISTS, name->str); - mysql_mutex_lock(&LOCK_plugin); DBUG_RETURN(TRUE); } /* Clear the whole struct to catch future extensions. */ @@ -963,9 +961,7 @@ static bool plugin_add(MEM_ROOT *tmp_root, strxnmov(buf, sizeof(buf) - 1, "API version for ", plugin_type_names[plugin->type].str, " plugin is too different", NullS); - mysql_mutex_unlock(&LOCK_plugin); report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, 0, buf); - mysql_mutex_lock(&LOCK_plugin); goto err; } tmp.plugin= plugin; @@ -997,9 +993,7 @@ static bool plugin_add(MEM_ROOT *tmp_root, DBUG_RETURN(FALSE); } } - mysql_mutex_unlock(&LOCK_plugin); report_error(report, ER_CANT_FIND_DL_ENTRY, name->str); - mysql_mutex_lock(&LOCK_plugin); err: plugin_dl_del(dl); DBUG_RETURN(TRUE);