diff options
author | serg@sergbook.mysql.com <> | 2007-04-26 21:26:04 +0200 |
---|---|---|
committer | serg@sergbook.mysql.com <> | 2007-04-26 21:26:04 +0200 |
commit | 31c1a1c9c33dd721708ed02fdf3e0f79758d489d (patch) | |
tree | 3f0bb0440f009d5eb738bbdc119edada18c81f97 /plugin | |
parent | a90109dd2b79882a94f2122ec2d8acec2ff2c78b (diff) | |
download | mariadb-git-31c1a1c9c33dd721708ed02fdf3e0f79758d489d.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
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fulltext/plugin_example.c | 16 |
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 }; |