From ac0fb49f187d05747ea2a834f310cec2f4c8a27f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Apr 2007 10:40:23 +0200 Subject: WL#2936 - Falcon & MySQL plugin interface: server variables Added initialization for the plugin structure created in plugin_add(). Made a correct argument vector in mysql_install_plugin(): handle_options() assumes that arg0 (program name) always exists. mysys/my_getopt.c: WL#2936 - Falcon & MySQL plugin interface: server variables Added DBUG_ASSERTs. handle_options() assumes that arg0 (program name) always exists. plugin/fulltext/plugin_example.c: WL#2936 - Falcon & MySQL plugin interface: server variables Extended the fulltext parser example plugin with system variables. --- plugin/fulltext/plugin_example.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'plugin/fulltext') diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c index c38498fb9e8..67c16a91268 100644 --- a/plugin/fulltext/plugin_example.c +++ b/plugin/fulltext/plugin_example.c @@ -215,6 +215,29 @@ static struct st_mysql_show_var simple_status[]= {0,0,0} }; +/* + Plugin system variables. +*/ + +static long sysvar_one_value; +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); + +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); + +static struct st_mysql_sys_var* simple_system_variables[]= { + MYSQL_SYSVAR(simple_sysvar_one), + MYSQL_SYSVAR(simple_sysvar_two), + NULL +}; + /* Plugin library descriptor */ @@ -231,8 +254,8 @@ mysql_declare_plugin(ftexample) simple_parser_plugin_deinit,/* deinit function (when unloaded) */ 0x0001, /* version */ simple_status, /* status variables */ - NULL, /* system variables */ - NULL /* config options */ + simple_system_variables, /* system variables */ + NULL } mysql_declare_plugin_end; -- cgit v1.2.1