summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/daemon_example/Makefile.am3
-rw-r--r--plugin/daemon_example/daemon_example.cc6
-rw-r--r--plugin/fulltext/Makefile.am3
-rw-r--r--plugin/fulltext/plugin_example.c39
4 files changed, 46 insertions, 5 deletions
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
index 21a86f8973e..92b1ab040fb 100644
--- a/plugin/daemon_example/Makefile.am
+++ b/plugin/daemon_example/Makefile.am
@@ -36,3 +36,6 @@ noinst_LIBRARIES = @plugin_daemon_example_static_target@
libdaemon_example_a_CXXFLAGS = $(AM_CFLAGS)
libdaemon_example_a_CFLAGS = $(AM_CFLAGS)
libdaemon_example_a_SOURCES= daemon_example.cc
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc
index e73a3d336ea..e683bf7ab7a 100644
--- a/plugin/daemon_example/daemon_example.cc
+++ b/plugin/daemon_example/daemon_example.cc
@@ -60,7 +60,7 @@ pthread_handler_t mysql_heartbeat(void *p)
tm_tmp.tm_hour,
tm_tmp.tm_min,
tm_tmp.tm_sec);
- my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
+ my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
x++;
}
@@ -114,7 +114,7 @@ static int daemon_example_plugin_init(void *p __attribute__ ((unused)))
tm_tmp.tm_hour,
tm_tmp.tm_min,
tm_tmp.tm_sec);
- my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
+ my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,
@@ -168,7 +168,7 @@ static int daemon_example_plugin_deinit(void *p __attribute__ ((unused)))
tm_tmp.tm_hour,
tm_tmp.tm_min,
tm_tmp.tm_sec);
- my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
+ my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
my_close(con->heartbeat_file, MYF(0));
my_free((char *)con, MYF(0));
diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am
index d4ec097efbd..ec033018a00 100644
--- a/plugin/fulltext/Makefile.am
+++ b/plugin/fulltext/Makefile.am
@@ -22,3 +22,6 @@ pkglib_LTLIBRARIES= mypluglib.la
mypluglib_la_SOURCES= plugin_example.c
mypluglib_la_LDFLAGS= -module -rpath $(pkglibdir)
mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index c38498fb9e8..70022da2cc4 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -216,6 +216,41 @@ static struct st_mysql_show_var simple_status[]=
};
/*
+ 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, 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, "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
+};
+
+/*
Plugin library descriptor
*/
@@ -231,8 +266,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;