From af8b2c6cec995c82d5a764717c954739ff125473 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 30 Sep 2021 10:14:56 +0200 Subject: [PATCH] MDEV-26637: (plugin) ASAN: main.metadata and user_variables.basic MTR failures after MDEV-26572 Get rid of locking "empty" plugin. This problem present in our tests in case of malformed frm-file, for example. --- sql/sql_plugin.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index ab13e8cc569..f07c2dc5fae 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1068,6 +1068,8 @@ plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name, int type) plugin_ref rc= NULL; st_plugin_int *plugin; DBUG_ENTER("plugin_lock_by_name"); + if (!name->length) + DBUG_RETURN(NULL); mysql_mutex_lock(&LOCK_plugin); if ((plugin= plugin_find_internal(name, type))) rc= intern_plugin_lock(lex, plugin_int_to_ref(plugin));