diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-11-10 10:31:33 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-11-10 10:31:33 +0300 |
commit | b712dce3d57335d3957afe94d1c3200880aebe99 (patch) | |
tree | b118b585c21710f0fef58c3d009fdd39a4578791 /storage | |
parent | 49bb8cba8e964bec96c1ca9cdc486b3a468dd822 (diff) | |
parent | d476bbb0becb27d7d3cb1fc5cc0ac4d401622893 (diff) | |
download | mariadb-git-b712dce3d57335d3957afe94d1c3200880aebe99.tar.gz |
Auto-merge from mysql-next-mr.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/example/Makefile.am | 2 | ||||
-rw-r--r-- | storage/example/ha_example.cc | 22 | ||||
-rw-r--r-- | storage/mysql_storage_engine.cmake | 2 |
3 files changed, 22 insertions, 4 deletions
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am index ce269aee59b..1179a338ee2 100644 --- a/storage/example/Makefile.am +++ b/storage/example/Makefile.am @@ -34,7 +34,7 @@ noinst_HEADERS = ha_example.h EXTRA_LTLIBRARIES = ha_example.la pkgplugin_LTLIBRARIES = @plugin_example_shared_target@ -ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir) +ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices ha_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_example_la_SOURCES = ha_example.cc diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 852dd50cb3e..9bc666663c3 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -921,6 +921,24 @@ static struct st_mysql_sys_var* example_system_variables[]= { NULL }; +// this is an example of SHOW_FUNC and of my_snprintf() service +static int show_func_example(MYSQL_THD thd, struct st_mysql_show_var *var, + char *buf) +{ + var->type= SHOW_CHAR; + var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes + my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE, + "enum_var is %u, ulong_var is %lu, %.6b", // %b is MySQL extension + srv_enum_var, srv_ulong_var, "really"); + return 0; +} + +static struct st_mysql_show_var func_status[]= +{ + {"example_func_example", (char *)show_func_example, SHOW_FUNC}, + {0,0,SHOW_UNDEF} +}; + mysql_declare_plugin(example) { MYSQL_STORAGE_ENGINE_PLUGIN, @@ -932,7 +950,7 @@ mysql_declare_plugin(example) example_init_func, /* Plugin Init */ example_done_func, /* Plugin Deinit */ 0x0001 /* 0.1 */, - NULL, /* status variables */ + func_status, /* status variables */ example_system_variables, /* system variables */ NULL /* config options */ } diff --git a/storage/mysql_storage_engine.cmake b/storage/mysql_storage_engine.cmake index af8c3a85cd1..b920f16452b 100644 --- a/storage/mysql_storage_engine.cmake +++ b/storage/mysql_storage_engine.cmake @@ -34,7 +34,7 @@ IF(NOT SOURCE_SUBLIBS) #The dll is linked to the mysqld executable SET(dyn_libname ha_${libname}) ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES}) - TARGET_LINK_LIBRARIES (${dyn_libname} mysqld) + TARGET_LINK_LIBRARIES (${dyn_libname} mysqlservices mysqld) IF(${engine}_LIBS) TARGET_LINK_LIBRARIES(${dyn_libname} ${${engine}_LIBS}) ENDIF(${engine}_LIBS) |