From 918e47030b49867d449bd9aaa54257616d5ebe42 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 14 Jun 2017 11:30:32 +0200 Subject: [PATCH] MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init if a forced plugin is disabled (for any reason, e.g. invalid command-line option) - it's an error --- mysql-test/t/bootstrap.test | 6 ++++++ sql/sql_plugin.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 405c24a6d74..2930d936830 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -60,4 +60,10 @@ SHOW VARIABLES LIKE 'have_innodb'; SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' and SUPPORT='YES'; +# +# MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init +# +--error 1 +--exec $MYSQLD_BOOTSTRAP_CMD --myisam_recover_options=NONE + --echo End of 5.5 tests diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 0ceb3088c6a..75aca02990d 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1359,7 +1359,7 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin, if (options_only || state == PLUGIN_IS_DISABLED) { - ret= 0; + ret= !options_only && plugin_is_forced(plugin); goto err; }