From 9cb0bb1de0a8a169c7ab87781abe006acf46b732 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 21 May 2024 20:35:00 +0200 Subject: [PATCH] restore the error message that was changed by mistake add a test case --- mysql-test/main/plugin.result | 2 ++ mysql-test/main/plugin.test | 4 ++++ sql/sql_plugin.cc | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/plugin.result b/mysql-test/main/plugin.result index 50a82efe55a..7a56c518472 100644 --- a/mysql-test/main/plugin.result +++ b/mysql-test/main/plugin.result @@ -1,5 +1,7 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE; ERROR 42000: Unknown storage engine 'EXAMPLE' +INSTALL PLUGIN non_exist SONAME 'ha_example'; +ERROR HY000: Can't find symbol 'non_exist' in library 'ha_example.so' INSTALL PLUGIN example SONAME 'ha_example'; INSTALL PLUGIN EXAMPLE SONAME 'ha_example'; ERROR HY000: Plugin 'EXAMPLE' already installed diff --git a/mysql-test/main/plugin.test b/mysql-test/main/plugin.test index 9151a6e905c..26c388b7352 100644 --- a/mysql-test/main/plugin.test +++ b/mysql-test/main/plugin.test @@ -4,6 +4,10 @@ --error ER_UNKNOWN_STORAGE_ENGINE CREATE TABLE t1(a int) ENGINE=EXAMPLE; +--replace_regex /\.dll/.so/ +--error ER_CANT_FIND_DL_ENTRY +INSTALL PLUGIN non_exist SONAME 'ha_example'; + INSTALL PLUGIN example SONAME 'ha_example'; --replace_regex /\.dll/.so/ --error ER_PLUGIN_INSTALLED diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 0a6d4bafe0b..76846a69d05 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1222,7 +1222,8 @@ err: DBUG_ASSERT(!name->str || !dupes); // dupes is ONLY for name->str == 0 if (errs == 0 && oks == 0 && !dupes) // no plugin was found - my_error(ER_PLUGIN_IS_NOT_LOADED, MyFlags, name->str); + my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, name->str, tmp.plugin_dl->dl.str); + plugin_dl_del(tmp.plugin_dl); if (errs > 0 || oks + dupes == 0)