From a010959a5673203b0c3c91f0764b19c2ba8c45c8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 9 Oct 2021 11:07:47 +0200 Subject: [PATCH] MDEV-26774 Compression provider unloading at runtime has no effect but doesn't produce a warning --- mysql-test/suite/plugins/r/compression_load.result | 2 ++ sql/sql_plugin.cc | 8 +++++++- .../mysql-test/rocksdb/r/mariadb_plugin.result | 13 +++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/plugins/r/compression_load.result b/mysql-test/suite/plugins/r/compression_load.result index f6c8a6e2a56..a23037edc17 100644 --- a/mysql-test/suite/plugins/r/compression_load.result +++ b/mysql-test/suite/plugins/r/compression_load.result @@ -17,6 +17,8 @@ a left(b, 9) length(b) 1 defdefdef 3000 2 ghighighi 30000 uninstall plugin provider_lz4; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; plugin_name plugin_status provider_lz4 INACTIVE diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index d493c69e38a..e3ddd14fe6a 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1267,7 +1267,13 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) if (!deinit) deinit= (plugin_type_init)(plugin->plugin->deinit); - if (!deinit || !deinit(plugin)) + if (deinit && deinit(plugin)) + { + if (THD *thd= current_thd) + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY)); + } + else plugin->state= PLUGIN_IS_UNINITIALIZED; // free to unload if (ref_check && plugin->ref_count) diff --git a/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result b/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result index ab13976b742..a8e42a4e2b2 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result @@ -10,6 +10,19 @@ connection default; UNINSTALL SONAME 'ha_rocksdb'; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown +Warning 1620 Plugin is busy and will be uninstalled on shutdown SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ROCKSDB'; ENGINE SUPPORT ROCKSDB NO