1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

merge with 5.1

This commit is contained in:
Sergei Golubchik
2011-10-07 00:18:30 +02:00
49 changed files with 1847 additions and 142 deletions

View File

@@ -3381,6 +3381,19 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
opt->name, plugin_name);
}
}
/*
PLUGIN_VAR_STR command-line options without PLUGIN_VAR_MEMALLOC, point
directly to values in the argv[] array. For plugins started at the
server startup, argv[] array is allocated with load_defaults(), and
freed when the server is shut down. But for plugins loaded with
INSTALL PLUGIN, the memory allocated with load_defaults() is freed with
freed() at the end of mysql_install_plugin(). Which means we cannot
allow any pointers into that area.
Thus, for all plugins loaded after the server was started,
we force all command-line options to be PLUGIN_VAR_MEMALLOC
*/
if (mysqld_server_started && !(opt->flags & PLUGIN_VAR_NOCMDOPT))
opt->flags|= PLUGIN_VAR_MEMALLOC;
break;
case PLUGIN_VAR_ENUM:
if (!opt->check)
@@ -3537,6 +3550,10 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "ndbcluster"))
plugin_load_policy= PLUGIN_OFF;
#endif
#ifdef WITH_FEEDBACK_PLUGIN
if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "feedback"))
plugin_load_policy= PLUGIN_OFF;
#endif
for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */