summaryrefslogtreecommitdiff
path: root/plugin/fulltext
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2007-04-26 21:26:04 +0200
committerunknown <serg@sergbook.mysql.com>2007-04-26 21:26:04 +0200
commit6cc76eb61cb190d5ec410ffe3bd2e064e7951e44 (patch)
tree3f0bb0440f009d5eb738bbdc119edada18c81f97 /plugin/fulltext
parent04c015fbda381128d058619527908aac57dcae09 (diff)
downloadmariadb-git-6cc76eb61cb190d5ec410ffe3bd2e064e7951e44.tar.gz
fixed: memleak in --help, sigsegv on shutdown
Ingo's patch: WL#2936 - Falcon & MySQL plugin interface: server variables Added initialization for plugin string variables with their default values. Added deallocation of string values before a plugin and its variables is deleted. Added examples to plugin_example mysys/my_getopt.c: Ingo's patch: WL#2936 - Falcon & MySQL plugin interface: server variables Added initialization for string options. Since string variables do often have their default value assigned already, assign the default value only if the variable value is NULL. plugin/fulltext/plugin_example.c: Ingo's patch: WL#2936 - Falcon & MySQL plugin interface: server variables Added examples for thread variables, which have a SESSION and a GLOBAL value. sql/mysqld.cc: removed second fix_paths() in --help output (memory leak). removed invalid string defaul values (binlog_format) don't hide the error message in the help text sql/sql_plugin.cc: don't do plugin_dl_del for built-in plugins (sigsegv). Ingo's patch: WL#2936 - Falcon & MySQL plugin interface: server variables Clearing newly allocated variable value space. This is important for string variables. They are initialized to their default value only if their initial value is NULL. Setting default values for strings. Added a function to free global value space for string variables. Call the function before deleting a plugin and its variables.
Diffstat (limited to 'plugin/fulltext')
-rw-r--r--plugin/fulltext/plugin_example.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index 67c16a91268..70022da2cc4 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -225,16 +225,28 @@ static char *sysvar_two_value;
static MYSQL_SYSVAR_LONG(simple_sysvar_one, sysvar_one_value,
PLUGIN_VAR_RQCMDARG,
"Simple fulltext parser example system variable number one. Give a number.",
- NULL, NULL, 100L, 10L, ~0L, 0);
+ NULL, NULL, 77L, 7L, 777L, 0);
static MYSQL_SYSVAR_STR(simple_sysvar_two, sysvar_two_value,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
"Simple fulltext parser example system variable number two. Give a string.",
- NULL, NULL, NULL);
+ NULL, NULL, "simple sysvar two default");
+
+static MYSQL_THDVAR_LONG(simple_thdvar_one,
+ PLUGIN_VAR_RQCMDARG,
+ "Simple fulltext parser example thread variable number one. Give a number.",
+ NULL, NULL, 88L, 8L, 888L, 0);
+
+static MYSQL_THDVAR_STR(simple_thdvar_two,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Simple fulltext parser example thread variable number two. Give a string.",
+ NULL, NULL, "simple thdvar two default");
static struct st_mysql_sys_var* simple_system_variables[]= {
MYSQL_SYSVAR(simple_sysvar_one),
MYSQL_SYSVAR(simple_sysvar_two),
+ MYSQL_SYSVAR(simple_thdvar_one),
+ MYSQL_SYSVAR(simple_thdvar_two),
NULL
};