summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-10-04 16:51:39 +0200
committerSergei Golubchik <sergii@pisem.net>2011-10-04 16:51:39 +0200
commit1b7e566683d13906530a2218791bb5f48b6425ec (patch)
tree84ab0ef35871e48a973ac86784b0f75bb61bbb30 /sql
parent031e78dd5b77c3756b77c2cc130a38ca127029f6 (diff)
downloadmariadb-git-1b7e566683d13906530a2218791bb5f48b6425ec.tar.gz
tests for feedback plugin,
bugfix: garbage in PLUGIN_VAR_STR variables when INSTALL'ing a plugin mysql-test/include/default_mysqld.cnf: disable feedback plugin by default. when enabled - tag is as a test run
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_plugin.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index dbbcd7e8c86..8fc02f4b196 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -3176,6 +3176,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)