diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-28 18:20:51 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-28 18:20:51 +0100 |
commit | b27d93f3471c2e06347d0c918a8ada20f6168191 (patch) | |
tree | 0e2580ba5092b4d11e56bca9b73e3cba47e41ddf | |
parent | 07209ea34b20984b96b602016a28943da9d198b5 (diff) | |
download | mariadb-git-b27d93f3471c2e06347d0c918a8ada20f6168191.tar.gz |
by default disable pbxt too
-rw-r--r-- | sql/sql_plugin.cc | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 3024d9d2e46..eb811f26bbd 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -149,6 +149,35 @@ static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]= MYSQL_AUTHENTICATION_INTERFACE_VERSION }; +static struct +{ + const char *plugin_name; + enum enum_plugin_load_option override; +} override_plugin_load_policy[]={ + /* + If the performance schema is compiled in, + treat the storage engine plugin as 'mandatory', + to suppress any plugin-level options such as '--performance-schema'. + This is specific to the performance schema, and is done on purpose: + the server-level option '--performance-schema' controls the overall + performance schema initialization, which consists of much more that + the underlying storage engine initialization. + See mysqld.cc, set_vars.cc. + Suppressing ways to interfere directly with the storage engine alone + prevents awkward situations where: + - the user wants the performance schema functionality, by using + '--enable-performance-schema' (the server option), + - yet disable explicitly a component needed for the functionality + to work, by using '--skip-performance-schema' (the plugin) + */ + { "performance_schema", PLUGIN_FORCE }, + + /* we disable few other plugins by default */ + { "ndbcluster", PLUGIN_OFF }, + { "feedback", PLUGIN_OFF }, + { "pbxt", PLUGIN_OFF } +}; + /* support for Services */ #include "sql_plugin_services.h" @@ -1487,24 +1516,15 @@ int plugin_init(int *argc, char **argv, int flags) tmp.state= 0; tmp.load_option= mandatory ? PLUGIN_FORCE : PLUGIN_ON; - /* - If the performance schema is compiled in, - treat the storage engine plugin as 'mandatory', - to suppress any plugin-level options such as '--performance-schema'. - This is specific to the performance schema, and is done on purpose: - the server-level option '--performance-schema' controls the overall - performance schema initialization, which consists of much more that - the underlying storage engine initialization. - See mysqld.cc, set_vars.cc. - Suppressing ways to interfere directly with the storage engine alone - prevents awkward situations where: - - the user wants the performance schema functionality, by using - '--enable-performance-schema' (the server option), - - yet disable explicitly a component needed for the functionality - to work, by using '--skip-performance-schema' (the plugin) - */ - if (!my_strcasecmp(&my_charset_latin1, plugin->name, "PERFORMANCE_SCHEMA")) - tmp.load_option= PLUGIN_FORCE; + for (i=0; i < array_elements(override_plugin_load_policy); i++) + { + if (!my_strcasecmp(&my_charset_latin1, plugin->name, + override_plugin_load_policy[i].plugin_name)) + { + tmp.load_option= override_plugin_load_policy[i].override; + break; + } + } free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE)); if (test_plugin_options(&tmp_root, &tmp, argc, argv)) @@ -3618,14 +3638,6 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, DBUG_ENTER("test_plugin_options"); DBUG_ASSERT(tmp->plugin && tmp->name.str); - /* - The 'ndbcluster' storage engines is always disabled by default. - */ - if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "ndbcluster")) - plugin_load_option= PLUGIN_OFF; - if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "feedback")) - plugin_load_option= PLUGIN_OFF; - for (opt= tmp->plugin->system_vars; opt && *opt; opt++) count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */ |