#At file:///home/malff/BZR-TREE/mysql-6.0-38781/
2837 Marc Alff 2008-10-02
Bug#38781 (Error handling and trace logging mixed in Maria)
--- Proof of concept patch, not ready for production ---
This patch removes the change implemented in the server error handling
code (my_message_sql) for Maria, and remove the use of the following flags:
- ME_JUST_INFO
- ME_JUST_WARNING
The design constraints applicable to the problem are:
- the Maria code can not have a static dependency on mysql
- the Maria code needs to print to the server log files (when embedded)
- the Maria code needs to print to stderr (when not embedded)
- the server needs to be independend of Maria logic in my_message_sql
The solution consists of:
- defining a Plugin -> Server interface, usable by every plugin.
This is a general need.
- Provide this server interface to a plugin at initialization.
- For embedded code (such as unit tests or stand alone binaries like
maria_chk), provide an alternate implementation of this server interface.
This patch was written as a technical proposal to resolve bug#38781,
and server as a base for a technical discussion.
It illustrates how:
- dependencies to the server can be abstracted in a storage engine
- a plugin->server interface can be implemented.
added:
storage/maria/ma_no_server.c
storage/maria/ma_no_server.h
storage/maria/ma_server_hton.h
storage/maria/ma_test_stubs.c
storage/maria/ma_test_stubs.h
modified:
include/my_sys.h
include/mysql/plugin.h
include/mysql/plugin.h.pp
plugin/audit_null/audit_null.c
plugin/daemon_example/daemon_example.cc
sql/ha_ndbcluster.cc
sql/ha_partition.cc
sql/handler.cc
sql/log.cc
sql/mysql_priv.h
sql/mysqld.cc
sql/sql_audit.cc
sql/sql_plugin.cc
sql/sql_show.cc
storage/archive/ha_archive.cc
storage/blackhole/ha_blackhole.cc
storage/csv/ha_tina.cc
storage/example/ha_example.cc
storage/falcon/ha_falcon.cpp
storage/falcon/ha_falcon.h
storage/federated/ha_federated.cc
storage/heap/ha_heap.cc
storage/innobase/handler/ha_innodb.cc
storage/maria/Makefile.am
storage/maria/ha_maria.cc
storage/maria/ma_checkpoint.c
storage/maria/ma_checkpoint.h
storage/maria/ma_control_file.c
storage/maria/ma_loghandler.c
storage/maria/ma_recovery.c
storage/maria/ma_test1.c
storage/maria/ma_test2.c
storage/maria/ma_test3.c
storage/maria/maria_chk.c
storage/maria/maria_ftdump.c
storage/maria/maria_pack.c
storage/maria/maria_read_log.c
storage/myisam/ha_myisam.cc
storage/myisammrg/ha_myisammrg.cc
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h 2008-09-15 10:11:54 +0000
+++ b/include/my_sys.h 2008-10-02 18:05:48 +0000
@@ -99,8 +99,6 @@ extern int NEAR my_errno; /* Last error
#define ME_FATALERROR 1024 /* Fatal statement error */
#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */
#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */
-#define ME_JUST_INFO 8192 /**< not error but just info */
-#define ME_JUST_WARNING 16384 /**< not error but just warning */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h 2008-06-28 11:00:59 +0000
+++ b/include/mysql/plugin.h 2008-10-02 18:05:48 +0000
@@ -77,6 +77,69 @@ typedef struct st_mysql_xid MYSQL_XID;
#define PLUGIN_LICENSE_GPL_STRING "GPL"
#define PLUGIN_LICENSE_BSD_STRING "BSD"
+struct server_interface_version
+{
+ int m_major;
+ int m_minor;
+};
+
+struct server_hton
+{
+ /**
+ Version of the Server/Plugin ABI (Application Binary Interface).
+ */
+ struct server_interface_version m_version;
+
+ /**
+ Print a note in the server log files.
+ @since Server/Plugin ABI 1.0
+ */
+ void (*sql_print_information)(const char* format, ...);
+
+ /**
+ Print a note in the server log files.
+ @since Server/Plugin ABI 1.0
+ */
+ void (*sql_print_warning)(const char* format, ...);
+
+ /**
+ Print a note in the server log files.
+ @since Server/Plugin ABI 1.0
+ */
+ void (*sql_print_error)(const char* format, ...);
+
+ /*
+ MAINTAINER (server/plugin ABI):
+ Add new exposed server interfaces at the end of this structure,
+ to maintain binary compatibility, and increment m_version.m_minor
+ after each change.
+ In case of binary incompatible changes,
+ increment m_version.m_major and reset m_version.m_minor to 0.
+
+ MAINTAINER (Mysql Plugins):
+ Please validate the server_hton provided to your plugin
+ init function before using the callbacks provided here.
+ @see VALIDATE_SERVER_HTON()
+ */
+};
+
+/**
+ Validate the version of the server/plugin binary interface.
+ @param hton The server handlerton interface to validate.
+ @param major The major number of the ABI version expected.
+ @param minor The minimum minor version number of the ABI expected.
+ @return true if the hton supports the major.minor ABI, overwise false.
+
+ Note: this is a macro on purpose, as this code should be expanded
+ in the plugin binary, not in the server binary.
+ Usage:
+ if (! VALIDATE_SERVER_HTON(hton, 1, 0))
+ ... plugin initialization failed, the server is not compatible.
+*/
+#define VALIDATE_SERVER_HTON(hton, major, minor) \
+ (((hton->m_version.m_major == major) && \
+ (hton->m_version.m_minor >= minor)) ? 1 : 0)
+
/*
Macros for beginning and ending plugin declarations. Between
mysql_declare_plugin and mysql_declare_plugin_end there should
@@ -378,24 +441,34 @@ DECLARE_MYSQL_THDVAR_TYPELIB(name, unsig
(*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
-/*
+/**
Plugin description structure.
*/
struct st_mysql_plugin
{
- int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- void *info; /* pointer to type-specific plugin descriptor */
- const char *name; /* plugin name */
- const char *author; /* plugin author (for SHOW PLUGINS) */
- const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
- int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
- int (*init)(void *); /* the function to invoke when plugin is loaded */
- int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
- unsigned int version; /* plugin version (for SHOW PLUGINS) */
+ /** The plugin type (a MYSQL_XXX_PLUGIN value). */
+ int type;
+ /** Pointer to type-specific plugin descriptor. */
+ void *info;
+ /** Plugin name. */
+ const char *name;
+ /** Plugin author (for SHOW PLUGINS). */
+ const char *author;
+ /** General descriptive text (for SHOW PLUGINS). */
+ const char *descr;
+ /** The plugin license (PLUGIN_LICENSE_XXX). */
+ int license;
+ /** The function to invoke when plugin is loaded. */
+ int (*init)(void *, struct server_hton *hton);
+ /** The function to invoke when plugin is unloaded. */
+ int (*deinit)(void *);
+ /** Plugin version (for SHOW PLUGINS). */
+ unsigned int version;
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
- void * __reserved1; /* reserved for dependency checking */
+ /** Reserved for dependency checking. */
+ void * __reserved1;
};
/*************************************************************************
=== modified file 'include/mysql/plugin.h.pp'
--- a/include/mysql/plugin.h.pp 2008-09-12 08:58:52 +0000
+++ b/include/mysql/plugin.h.pp 2008-10-02 18:05:48 +0000
@@ -11,6 +11,18 @@ struct st_mysql_xid {
char data[128];
};
typedef struct st_mysql_xid MYSQL_XID;
+struct server_interface_version
+{
+ int m_major;
+ int m_minor;
+};
+struct server_hton
+{
+ struct server_interface_version m_version;
+ void (*sql_print_information)(const char* format, ...);
+ void (*sql_print_warning)(const char* format, ...);
+ void (*sql_print_error)(const char* format, ...);
+};
enum enum_mysql_show_type
{
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
@@ -39,7 +51,7 @@ struct st_mysql_plugin
const char *author;
const char *descr;
int license;
- int (*init)(void *);
+ int (*init)(void *, struct server_hton *hton);
int (*deinit)(void *);
unsigned int version;
struct st_mysql_show_var *status_vars;
=== modified file 'plugin/audit_null/audit_null.c'
--- a/plugin/audit_null/audit_null.c 2008-04-30 23:34:30 +0000
+++ b/plugin/audit_null/audit_null.c 2008-10-02 18:05:48 +0000
@@ -38,7 +38,8 @@ static volatile int number_of_calls; /*
1 failure (cannot happen)
*/
-static int audit_null_plugin_init(void *arg __attribute__((unused)))
+static int audit_null_plugin_init(void *arg __attribute__((unused)),
+ struct server_hton *arg2 __attribute__((unused)))
{
number_of_calls= 0;
return(0);
=== modified file 'plugin/daemon_example/daemon_example.cc'
--- a/plugin/daemon_example/daemon_example.cc 2007-06-27 14:49:12 +0000
+++ b/plugin/daemon_example/daemon_example.cc 2008-10-02 18:05:48 +0000
@@ -81,7 +81,8 @@ pthread_handler_t mysql_heartbeat(void *
1 failure (cannot happen)
*/
-static int daemon_example_plugin_init(void *p __attribute__ ((unused)))
+static int daemon_example_plugin_init(void *p __attribute__ ((unused)),
+ struct server_hton *p2 __attribute__ ((unused)))
{
DBUG_ENTER("daemon_example_plugin_init");
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2008-09-15 09:27:48 +0000
+++ b/sql/ha_ndbcluster.cc 2008-10-02 18:05:48 +0000
@@ -75,7 +75,7 @@ static const int parallelism= 0;
static const int max_transactions= 3; // should really be 2 but there is a transaction to much allocated when loch table is used
static uint ndbcluster_partition_flags();
-static int ndbcluster_init(void *);
+static int ndbcluster_init(void *, struct server_hton*);
static int ndbcluster_end(handlerton *hton, ha_panic_function flag);
static bool ndbcluster_show_status(handlerton *hton, THD*,
stat_print_fn *,
@@ -7891,7 +7891,7 @@ static int connect_callback()
extern int ndb_dictionary_is_mysqld;
extern pthread_mutex_t LOCK_plugin;
-static int ndbcluster_init(void *p)
+static int ndbcluster_init(void *p, struct server_hton *unused)
{
DBUG_ENTER("ndbcluster_init");
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2008-09-20 07:22:37 +0000
+++ b/sql/ha_partition.cc 2008-10-02 18:05:48 +0000
@@ -75,7 +75,7 @@ static uint partition_flags();
static uint alter_partition_flags();
-static int partition_initialize(void *p)
+static int partition_initialize(void *p, struct server_hton *unused)
{
handlerton *partition_hton;
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2008-10-01 12:02:28 +0000
+++ b/sql/handler.cc 2008-10-02 18:05:48 +0000
@@ -403,6 +403,13 @@ int ha_finalize_handlerton(st_plugin_int
DBUG_RETURN(0);
}
+struct server_hton mysql_server_hton=
+{
+ { 1, 0},
+ sql_print_information,
+ sql_print_warning,
+ sql_print_error
+};
int ha_initialize_handlerton(st_plugin_int *plugin)
{
@@ -424,7 +431,7 @@ int ha_initialize_handlerton(st_plugin_i
plugin->data= hton; // shortcut for the future
if (plugin->plugin->init)
{
- if (plugin->plugin->init(hton))
+ if (plugin->plugin->init(hton, & mysql_server_hton))
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2008-10-01 12:02:28 +0000
+++ b/sql/log.cc 2008-10-02 18:05:48 +0000
@@ -56,7 +56,7 @@ ulong sync_binlog_counter= 0;
static bool test_if_number(const char *str,
long *res, bool allow_wildcards);
-static int binlog_init(void *p);
+static int binlog_init(void *p, struct server_hton *unused);
static int binlog_close_connection(handlerton *hton, THD *thd);
static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv);
static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv);
@@ -2058,7 +2058,7 @@ binlog_trans_log_truncate(THD *thd, my_o
should be moved here.
*/
-int binlog_init(void *p)
+int binlog_init(void *p, struct server_hton *unused)
{
binlog_hton= (handlerton *)p;
binlog_hton->state=opt_bin_log ? SHOW_OPTION_YES : SHOW_OPTION_NO;
=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h 2008-10-01 12:02:28 +0000
+++ b/sql/mysql_priv.h 2008-10-02 18:05:48 +0000
@@ -53,6 +53,8 @@
#include <netdb.h>
#endif
+extern struct server_hton mysql_server_hton;
+
class Parser_state;
/**
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2008-10-01 12:02:28 +0000
+++ b/sql/mysqld.cc 2008-10-02 18:05:48 +0000
@@ -2969,8 +2969,6 @@ extern "C" void my_message_sql(uint erro
void my_message_sql(uint error, const char *str, myf MyFlags)
{
THD *thd;
- MYSQL_ERROR::enum_warning_level level;
- sql_print_message_func func;
DBUG_ENTER("my_message_sql");
DBUG_PRINT("error", ("error: %u message: '%s'", error, str));
/*
@@ -2978,22 +2976,6 @@ void my_message_sql(uint error, const ch
will be fixed
DBUG_ASSERT(error != 0);
*/
- if (MyFlags & ME_JUST_INFO)
- {
- level= MYSQL_ERROR::WARN_LEVEL_NOTE;
- func= sql_print_information;
- }
- else if (MyFlags & ME_JUST_WARNING)
- {
- level= MYSQL_ERROR::WARN_LEVEL_WARN;
- func= sql_print_warning;
- }
- else
- {
- level= MYSQL_ERROR::WARN_LEVEL_ERROR;
- func= sql_print_error;
- }
-
if ((thd= current_thd))
{
if (MyFlags & ME_FATALERROR)
@@ -3012,14 +2994,9 @@ void my_message_sql(uint error, const ch
TODO: There are two exceptions mechanism (THD and sp_rcontext),
this could be improved by having a common stack of handlers.
*/
- if (thd->handle_error(error, str, level))
+ if (thd->handle_error(error, str, MYSQL_ERROR::WARN_LEVEL_ERROR))
DBUG_VOID_RETURN;
- if (level == MYSQL_ERROR::WARN_LEVEL_WARN)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, error, str);
- if (level != MYSQL_ERROR::WARN_LEVEL_ERROR)
- goto to_error_log;
-
thd->is_slave_error= 1; // needed to catch query errors during replication
/*
@@ -3075,9 +3052,8 @@ void my_message_sql(uint error, const ch
thd->no_warnings_for_error= FALSE;
}
}
-to_error_log:
if (!thd || (MyFlags & ME_NOREFRESH))
- (*func)("%s: %s", my_progname_short, str); /* purecov: inspected */
+ sql_print_error("%s: %s", my_progname_short, str); /* purecov: inspected */
DBUG_VOID_RETURN;
}
=== modified file 'sql/sql_audit.cc'
--- a/sql/sql_audit.cc 2008-03-26 14:30:28 +0000
+++ b/sql/sql_audit.cc 2008-10-02 18:05:48 +0000
@@ -283,7 +283,7 @@ int initialize_audit_plugin(st_plugin_in
return 1;
}
- if (plugin->plugin->init && plugin->plugin->init(NULL))
+ if (plugin->plugin->init && plugin->plugin->init(NULL, & mysql_server_hton))
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2008-08-19 15:58:48 +0000
+++ b/sql/sql_plugin.cc 2008-10-02 18:05:48 +0000
@@ -1017,7 +1017,7 @@ static int plugin_initialize(struct st_p
}
else if (plugin->plugin->init)
{
- if (plugin->plugin->init(plugin))
+ if (plugin->plugin->init(plugin, & mysql_server_hton))
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2008-09-25 07:15:02 +0000
+++ b/sql/sql_show.cc 2008-10-02 18:05:48 +0000
@@ -7098,7 +7098,7 @@ int initialize_schema_table(st_plugin_in
/* Make the name available to the init() function. */
schema_table->table_name= plugin->name.str;
- if (plugin->plugin->init(schema_table))
+ if (plugin->plugin->init(schema_table, & mysql_server_hton))
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc 2008-07-23 08:52:08 +0000
+++ b/storage/archive/ha_archive.cc 2008-10-02 18:05:48 +0000
@@ -160,7 +160,7 @@ static uchar* archive_get_key(ARCHIVE_SH
TRUE Error
*/
-int archive_db_init(void *p)
+int archive_db_init(void *p, struct server_hton* unused)
{
DBUG_ENTER("archive_db_init");
handlerton *archive_hton;
=== modified file 'storage/blackhole/ha_blackhole.cc'
--- a/storage/blackhole/ha_blackhole.cc 2008-04-25 16:43:25 +0000
+++ b/storage/blackhole/ha_blackhole.cc 2008-10-02 18:05:48 +0000
@@ -294,7 +294,7 @@ static uchar* blackhole_get_key(st_black
return (uchar*) share->table_name;
}
-static int blackhole_init(void *p)
+static int blackhole_init(void *p, struct server_hton* unused)
{
handlerton *blackhole_hton;
blackhole_hton= (handlerton *)p;
=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc 2008-08-23 00:18:35 +0000
+++ b/storage/csv/ha_tina.cc 2008-10-02 18:05:48 +0000
@@ -104,7 +104,7 @@ static uchar* tina_get_key(TINA_SHARE *s
return (uchar*) share->table_name;
}
-static int tina_init_func(void *p)
+static int tina_init_func(void *p, struct server_hton* unused)
{
handlerton *tina_hton;
=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc 2008-04-09 00:56:49 +0000
+++ b/storage/example/ha_example.cc 2008-10-02 18:05:48 +0000
@@ -126,7 +126,7 @@ static uchar* example_get_key(EXAMPLE_SH
}
-static int example_init_func(void *p)
+static int example_init_func(void *p, struct server_hton* unused)
{
DBUG_ENTER("example_init_func");
=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp 2008-09-16 17:58:49 +0000
+++ b/storage/falcon/ha_falcon.cpp 2008-10-02 18:05:48 +0000
@@ -173,7 +173,7 @@ bool checkExceptionSupport()
return false;
}
-int StorageInterface::falcon_init(void *p)
+int StorageInterface::falcon_init(void *p, struct server_hton *unused)
{
DBUG_ENTER("falcon_init");
falcon_hton = (handlerton *)p;
@@ -3076,7 +3076,8 @@ ST_FIELD_INFO memoryDetailFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initSystemMemoryDetailInfo(void *p)
+int NfsPluginHandler::initSystemMemoryDetailInfo(void *p,
+ struct server_hton *unused)
{
DBUG_ENTER("initSystemMemoryDetailInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE*) p;
@@ -3119,7 +3120,8 @@ ST_FIELD_INFO memorySummaryFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initSystemMemorySummaryInfo(void *p)
+int NfsPluginHandler::initSystemMemorySummaryInfo(void *p,
+ struct server_hton *unused)
{
DBUG_ENTER("initSystemMemorySummaryInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3162,7 +3164,8 @@ ST_FIELD_INFO recordDetailFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initRecordCacheDetailInfo(void *p)
+int NfsPluginHandler::initRecordCacheDetailInfo(void *p,
+ struct server_hton *unused)
{
DBUG_ENTER("initRecordCacheDetailInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3205,7 +3208,8 @@ ST_FIELD_INFO recordSummaryFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initRecordCacheSummaryInfo(void *p)
+int NfsPluginHandler::initRecordCacheSummaryInfo(void *p,
+ struct server_hton *unused)
{
DBUG_ENTER("initRecordCacheSummaryInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3249,7 +3253,7 @@ ST_FIELD_INFO tableSpaceIOFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initTableSpaceIOInfo(void *p)
+int NfsPluginHandler::initTableSpaceIOInfo(void *p, struct server_hton *unused)
{
DBUG_ENTER("initTableSpaceIOInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3296,7 +3300,8 @@ ST_FIELD_INFO transactionInfoFieldInfo[]
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initTransactionInfo(void *p)
+int NfsPluginHandler::initTransactionInfo(void *p,
+ struct server_hton *unused)
{
DBUG_ENTER("initTransactionInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3339,7 +3344,8 @@ ST_FIELD_INFO transactionInfoFieldSummar
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initTransactionSummaryInfo(void *p)
+int NfsPluginHandler::initTransactionSummaryInfo(void *p,
+ struct server_hton *unused)
{
DBUG_ENTER("initTransactionSummaryInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3381,7 +3387,7 @@ ST_FIELD_INFO serialSerialLogFieldInfo[]
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initSerialLogInfo(void *p)
+int NfsPluginHandler::initSerialLogInfo(void *p, struct server_hton *unused)
{
DBUG_ENTER("initSerialLogInfoInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3420,7 +3426,7 @@ ST_FIELD_INFO falconVersionFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initFalconVersionInfo(void *p)
+int NfsPluginHandler::initFalconVersionInfo(void *p, struct server_hton *unused)
{
DBUG_ENTER("initFalconVersionInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3462,7 +3468,7 @@ ST_FIELD_INFO syncInfoFieldInfo[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
-int NfsPluginHandler::initSyncInfo(void *p)
+int NfsPluginHandler::initSyncInfo(void *p, struct server_hton *unused)
{
DBUG_ENTER("initSyncInfo");
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
@@ -3771,7 +3777,7 @@ mysql_declare_plugin(falcon)
"MySQL AB",
"Falcon Transaction Summary.",
PLUGIN_LICENSE_GPL,
- NfsPluginHandler::initTransactionSummaryInfo, /* plugin init */
+ NfsPluginHandler::initTransactionSummaryInfo, /* plugin init */
NfsPluginHandler::deinitTransactionSummaryInfo, /* plugin deinit */
0x0005,
NULL, /* status variables */
=== modified file 'storage/falcon/ha_falcon.h'
--- a/storage/falcon/ha_falcon.h 2008-09-16 17:58:49 +0000
+++ b/storage/falcon/ha_falcon.h 2008-10-02 18:05:48 +0000
@@ -137,7 +137,7 @@ public:
static StorageConnection* getStorageConnection(THD* thd);
- static int falcon_init(void *p);
+ static int falcon_init(void *p, struct server_hton *unused);
static int falcon_deinit(void *p);
static int commit(handlerton *, THD *thd, bool all);
static int prepare(handlerton* hton, THD* thd, bool all);
@@ -211,42 +211,42 @@ public:
StorageTable *storageTable;
static int getSystemMemoryDetailInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initSystemMemoryDetailInfo(void *p);
+ static int initSystemMemoryDetailInfo(void *p, struct server_hton *unused);
static int deinitSystemMemoryDetailInfo(void *p);
static int getSystemMemorySummaryInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initSystemMemorySummaryInfo(void *p);
+ static int initSystemMemorySummaryInfo(void *p, struct server_hton *unused);
static int deinitSystemMemorySummaryInfo(void *p);
static int getRecordCacheDetailInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initRecordCacheDetailInfo(void *p);
+ static int initRecordCacheDetailInfo(void *p, struct server_hton *unused);
static int deinitRecordCacheDetailInfo(void *p);
static int getRecordCacheSummaryInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initRecordCacheSummaryInfo(void *p);
+ static int initRecordCacheSummaryInfo(void *p, struct server_hton *unused);
static int deinitRecordCacheSummaryInfo(void *p);
static int getTableSpaceIOInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initTableSpaceIOInfo(void *p);
+ static int initTableSpaceIOInfo(void *p, struct server_hton *unused);
static int deinitTableSpaceIOInfo(void *p);
static int getTransactionInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initTransactionInfo(void *p);
+ static int initTransactionInfo(void *p, struct server_hton *unused);
static int deinitTransactionInfo(void *p);
static int getTransactionSummaryInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initTransactionSummaryInfo(void *p);
+ static int initTransactionSummaryInfo(void *p, struct server_hton *unused);
static int deinitTransactionSummaryInfo(void *p);
static int getSerialLogInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initSerialLogInfo(void *p);
+ static int initSerialLogInfo(void *p, struct server_hton *unused);
static int deinitSerialLogInfo(void *p);
static int getFalconVersionInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initFalconVersionInfo(void *p);
+ static int initFalconVersionInfo(void *p, struct server_hton *unused);
static int deinitFalconVersionInfo(void *p);
static int getSyncInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initSyncInfo(void *p);
+ static int initSyncInfo(void *p, struct server_hton *unused);
static int deinitSyncInfo(void *p);
};
=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc 2008-08-15 19:58:03 +0000
+++ b/storage/federated/ha_federated.cc 2008-10-02 18:05:48 +0000
@@ -438,7 +438,7 @@ static uchar *federated_get_key(FEDERATE
TRUE Error
*/
-int federated_db_init(void *p)
+int federated_db_init(void *p, struct server_hton* unused)
{
DBUG_ENTER("federated_db_init");
handlerton *federated_hton= (handlerton *)p;
=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc 2007-12-14 13:21:37 +0000
+++ b/storage/heap/ha_heap.cc 2008-10-02 18:05:48 +0000
@@ -34,7 +34,7 @@ int heap_panic(handlerton *hton, ha_pani
}
-int heap_init(void *p)
+int heap_init(void *p, struct server_hton* unused)
{
handlerton *heap_hton;
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2008-10-01 12:02:28 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2008-10-02 18:05:48 +0000
@@ -1435,7 +1435,8 @@ int
innobase_init(
/*==========*/
/* out: 0 on success, error code on failure */
- void *p) /* in: InnoDB handlerton */
+ void *p, /* in: InnoDB handlerton */
+ struct server_hton *unused) /* in: Server/Plugin Interface */
{
static char current_dir[3]; /* Set if using current lib */
int err;
=== modified file 'storage/maria/Makefile.am'
--- a/storage/maria/Makefile.am 2008-06-26 05:18:28 +0000
+++ b/storage/maria/Makefile.am 2008-10-02 18:05:48 +0000
@@ -73,21 +73,29 @@ noinst_HEADERS = maria_def.h ma_rt_index
ma_loghandler.h ma_loghandler_lsn.h ma_pagecache.h \
ma_checkpoint.h ma_recovery.h ma_commit.h ma_state.h \
trnman_public.h ma_check_standalone.h \
- ma_key_recover.h ma_recovery_util.h
+ ma_key_recover.h ma_recovery_util.h ma_test_stubs.h
+noinst_LIBRARIES= libtest_stubs.a
+libtest_stubs_a_SOURCES= ma_test_stubs.c
+ma_test1_SOURCES= ma_test1.c
ma_test1_DEPENDENCIES= $(LIBRARIES)
ma_test1_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
+ libtest_stubs.a \
$(top_builddir)/storage/myisam/libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
+ma_test2_SOURCES= ma_test2.c
ma_test2_DEPENDENCIES= $(LIBRARIES)
ma_test2_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
+ libtest_stubs.a \
$(top_builddir)/storage/myisam/libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
+ma_test3_SOURCES= ma_test3.c
ma_test3_DEPENDENCIES= $(LIBRARIES)
ma_test3_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
+ libtest_stubs.a \
$(top_builddir)/storage/myisam/libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
@@ -135,7 +143,7 @@ libmaria_a_SOURCES = ma_init.c ma_open.c
ma_pagecache.c ma_pagecaches.c \
ma_checkpoint.c ma_recovery.c ma_commit.c \
ma_pagecrc.c ma_recovery_util.c \
- ha_maria.cc
+ ha_maria.cc ma_no_server.c
CLEANFILES = test?.MA? FT?.MA? isam.log ma_test_all ma_rt_test.MA? sp_test.MA? maria_log_control maria_log.0000*
SUFFIXES = .sh
=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc 2008-09-04 18:30:34 +0000
+++ b/storage/maria/ha_maria.cc 2008-10-02 18:05:48 +0000
@@ -36,6 +36,8 @@ C_MODE_START
#include "ma_recovery.h"
C_MODE_END
+#include "ma_server_hton.h"
+
/*
Note that in future versions, only *transactional* Maria tables can
rollback, so this flag should be up or down conditionally.
@@ -2909,7 +2911,7 @@ static int mark_recovery_start(const cha
int res;
DBUG_ENTER("mark_recovery_start");
if (unlikely(maria_recover_options == HA_RECOVER_NONE))
- ma_message_no_user(ME_JUST_WARNING, "Please consider using option"
+ ma_message_no_user(MA_JUST_WARNING, "Please consider using option"
" --maria-recover[=...] to automatically check and"
" repair tables when logs are removed by option"
" --maria-force-start-after-recovery-failures=#");
@@ -2927,7 +2929,7 @@ static int mark_recovery_start(const cha
" recovery from logs",
(res ? "failed to remove some" : "removed all"),
recovery_failures);
- ma_message_no_user((res ? 0 : ME_JUST_WARNING), msg);
+ ma_message_no_user((res ? 0 : MA_JUST_WARNING), msg);
}
else
res= ma_control_file_write_and_force(last_checkpoint_lsn, last_logno,
@@ -2954,10 +2956,14 @@ static int mark_recovery_success(void)
}
-static int ha_maria_init(void *p)
+static int ha_maria_init(void *p, struct server_hton *server_callback)
{
int res;
const char *log_dir= maria_data_root;
+
+ if (! VALIDATE_SERVER_HTON(server_callback, 1, 0))
+ return HA_ERR_INITIALIZATION;
+ ma_server_hton= server_callback;
maria_hton= (handlerton *)p;
maria_hton->state= SHOW_OPTION_YES;
maria_hton->db_type= DB_TYPE_UNKNOWN;
=== modified file 'storage/maria/ma_checkpoint.c'
--- a/storage/maria/ma_checkpoint.c 2008-08-25 11:49:47 +0000
+++ b/storage/maria/ma_checkpoint.c 2008-10-02 18:05:48 +0000
@@ -36,6 +36,26 @@
#include "ma_checkpoint.h"
#include "ma_loghandler_lsn.h"
+/* Guilhem: not sure where to put this. -- Marc */
+struct server_hton *ma_server_hton;
+
+void ma_message_no_user(int level, const char* sentence)
+{
+ const char* format= "Maria engine: %s";
+ switch (level) {
+ case 0:
+ (ma_server_hton->sql_print_error)(format, sentence);
+ break;
+ case MA_JUST_WARNING:
+ (ma_server_hton->sql_print_warning)(format, sentence);
+ break;
+ case MA_JUST_INFO:
+ (ma_server_hton->sql_print_information)(format, sentence);
+ break;
+ default: DBUG_ASSERT(FALSE);
+ }
+}
+
/** @brief type of checkpoint currently running */
static CHECKPOINT_LEVEL checkpoint_in_progress= CHECKPOINT_NONE;
=== modified file 'storage/maria/ma_checkpoint.h'
--- a/storage/maria/ma_checkpoint.h 2007-11-16 16:09:51 +0000
+++ b/storage/maria/ma_checkpoint.h 2008-10-02 18:05:48 +0000
@@ -80,13 +80,16 @@ static inline LSN lsn_read_non_atomic_32
#define lsn_read_non_atomic(x) lsn_read_non_atomic_32(&x)
#endif
+#define MA_JUST_WARNING 1
+#define MA_JUST_INFO 2
+
/**
prints a message from a task not connected to any user (checkpoint
and recovery for example).
- @param level 0 if error, ME_JUST_WARNING if warning,
- ME_JUST_INFO if info
+ @param level 0 if error, MA_JUST_WARNING if warning,
+ MA_JUST_INFO if info
@param sentence text to write
*/
-#define ma_message_no_user(level, sentence) \
- my_printf_error(HA_ERR_GENERIC, "Maria engine: %s", MYF(level), sentence)
+void ma_message_no_user(int level, const char* sentence);
+
=== modified file 'storage/maria/ma_control_file.c'
--- a/storage/maria/ma_control_file.c 2008-06-05 16:11:22 +0000
+++ b/storage/maria/ma_control_file.c 2008-10-02 18:05:48 +0000
@@ -523,7 +523,7 @@ int ma_control_file_write_and_force(LSN
"Control file must be from a newer version; zero-ing out %u"
" unknown bytes in control file at offset %u", zeroed,
cf_changeable_size + cf_create_time_size);
- ma_message_no_user(ME_JUST_WARNING, msg);
+ ma_message_no_user(MA_JUST_WARNING, msg);
}
else
{
=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c 2008-08-25 18:23:18 +0000
+++ b/storage/maria/ma_loghandler.c 2008-10-02 18:05:48 +0000
@@ -18,6 +18,8 @@
#include "ma_blockrec.h" /* for some constants and in-write hooks */
#include "ma_key_recover.h" /* For some in-write hooks */
#include "ma_checkpoint.h"
+#include "ma_server_hton.h"
+#include "ma_no_server.h"
/*
On Windows, neither my_open() nor my_sync() work for directories.
@@ -8622,6 +8624,7 @@ int main(int argc, char **argv)
char **default_argv;
uchar buffer[TRANSLOG_PAGE_SIZE];
MY_INIT(argv[0]);
+ ma_server_hton= &ma_no_server_hton;
load_defaults("my", load_default_groups, &argc, &argv);
default_argv= argv;
=== added file 'storage/maria/ma_no_server.c'
--- a/storage/maria/ma_no_server.c 1970-01-01 00:00:00 +0000
+++ b/storage/maria/ma_no_server.c 2008-10-02 18:05:48 +0000
@@ -0,0 +1,24 @@
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "mysql/plugin.h"
+#include "ma_no_server.h"
+
+void stand_alone_sql_print(const char* format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+}
+
+struct server_hton ma_no_server_hton=
+{
+ {1, 0},
+ stand_alone_sql_print,
+ stand_alone_sql_print,
+ stand_alone_sql_print
+};
+
=== added file 'storage/maria/ma_no_server.h'
--- a/storage/maria/ma_no_server.h 1970-01-01 00:00:00 +0000
+++ b/storage/maria/ma_no_server.h 2008-10-02 18:05:48 +0000
@@ -0,0 +1,3 @@
+
+extern struct server_hton ma_no_server_hton;
+
=== modified file 'storage/maria/ma_recovery.c'
--- a/storage/maria/ma_recovery.c 2008-08-25 18:23:18 +0000
+++ b/storage/maria/ma_recovery.c 2008-10-02 18:05:48 +0000
@@ -175,7 +175,7 @@ void maria_recover_error_handler_hook(ui
static void print_preamble()
{
- ma_message_no_user(ME_JUST_INFO, "starting recovery");
+ ma_message_no_user(MA_JUST_INFO, "starting recovery");
}
@@ -456,7 +456,7 @@ end:
fflush(stderr);
}
if (!error)
- ma_message_no_user(ME_JUST_INFO, "recovery done");
+ ma_message_no_user(MA_JUST_INFO, "recovery done");
}
if (error)
my_message(HA_ERR_INITIALIZATION,
=== added file 'storage/maria/ma_server_hton.h'
--- a/storage/maria/ma_server_hton.h 1970-01-01 00:00:00 +0000
+++ b/storage/maria/ma_server_hton.h 2008-10-02 18:05:48 +0000
@@ -0,0 +1,3 @@
+
+extern struct server_hton *ma_server_hton;
+
=== modified file 'storage/maria/ma_test1.c'
--- a/storage/maria/ma_test1.c 2008-06-30 09:59:59 +0000
+++ b/storage/maria/ma_test1.c 2008-10-02 18:05:48 +0000
@@ -22,6 +22,8 @@
#include "ma_loghandler.h"
#include "ma_checkpoint.h"
#include "trnman.h"
+#include "ma_server_hton.h"
+#include "ma_test_stubs.h"
extern PAGECACHE *maria_log_pagecache;
extern char *maria_data_root;
@@ -71,6 +73,7 @@ extern int _ma_flush_table_files(MARIA_H
int main(int argc,char *argv[])
{
MY_INIT(argv[0]);
+ ma_server_hton= &test_server_hton;
get_options(argc,argv);
maria_data_root= (char *)".";
/* Maria requires that we always have a page cache */
=== modified file 'storage/maria/ma_test2.c'
--- a/storage/maria/ma_test2.c 2008-06-26 17:48:42 +0000
+++ b/storage/maria/ma_test2.c 2008-10-02 18:05:48 +0000
@@ -23,6 +23,8 @@
#include <m_ctype.h>
#include <my_bit.h>
#include "ma_checkpoint.h"
+#include "ma_server_hton.h"
+#include "ma_test_stubs.h"
#define STANDARD_LENGTH 37
#define MARIA_KEYS 6
@@ -73,6 +75,7 @@ int main(int argc, char *argv[])
char *blob_buffer;
MARIA_CREATE_INFO create_info;
MY_INIT(argv[0]);
+ ma_server_hton= & test_server_hton;
filename= "test2";
get_options(argc,argv);
=== modified file 'storage/maria/ma_test3.c'
--- a/storage/maria/ma_test3.c 2008-06-26 20:13:19 +0000
+++ b/storage/maria/ma_test3.c 2008-10-02 18:05:48 +0000
@@ -38,6 +38,8 @@
#define rnd_init(X) srandom(X)
#endif
+#include "ma_server_hton.h"
+#include "ma_test_stubs.h"
const char *filename= "test3";
uint tests=10,forks=10,pagecacheing=0;
@@ -62,6 +64,7 @@ int main(int argc,char **argv)
MARIA_COLUMNDEF recinfo[10];
HA_KEYSEG keyseg[10][2];
MY_INIT(argv[0]);
+ ma_server_hton= & test_server_hton;
get_options(argc,argv);
fprintf(stderr, "WARNING! this program is to test 'external locking'"
=== added file 'storage/maria/ma_test_stubs.c'
--- a/storage/maria/ma_test_stubs.c 1970-01-01 00:00:00 +0000
+++ b/storage/maria/ma_test_stubs.c 2008-10-02 18:05:48 +0000
@@ -0,0 +1,24 @@
+
+#include "mysql/plugin.h"
+#include "ma_test_stubs.h"
+
+void stub_sql_print_information(const char* format, ...)
+{
+}
+
+void stub_sql_print_warning(const char* format, ...)
+{
+}
+
+void stub_sql_print_error(const char* format, ...)
+{
+}
+
+struct server_hton test_server_hton=
+{
+ {1, 0},
+ stub_sql_print_information,
+ stub_sql_print_warning,
+ stub_sql_print_error,
+};
+
=== added file 'storage/maria/ma_test_stubs.h'
--- a/storage/maria/ma_test_stubs.h 1970-01-01 00:00:00 +0000
+++ b/storage/maria/ma_test_stubs.h 2008-10-02 18:05:48 +0000
@@ -0,0 +1,3 @@
+
+extern struct server_hton test_server_hton;
+
=== modified file 'storage/maria/maria_chk.c'
--- a/storage/maria/maria_chk.c 2008-07-09 21:25:29 +0000
+++ b/storage/maria/maria_chk.c 2008-10-02 18:05:48 +0000
@@ -34,6 +34,9 @@ SET_STACK_SIZE(9000) /* Minimum stack
#define my_raid_delete(A,B,C) my_delete(A,B)
#endif
+#include "ma_server_hton.h"
+#include "ma_no_server.h"
+
static uint decode_bits;
static char **default_argv;
static const char *load_default_groups[]= { "maria_chk", 0 };
@@ -96,6 +99,7 @@ int main(int argc, char **argv)
{
int error;
MY_INIT(argv[0]);
+ ma_server_hton= &ma_no_server_hton;
opt_log_dir= maria_data_root= (char *)".";
maria_chk_init(&check_param);
=== modified file 'storage/maria/maria_ftdump.c'
--- a/storage/maria/maria_ftdump.c 2008-08-25 18:23:18 +0000
+++ b/storage/maria/maria_ftdump.c 2008-10-02 18:05:48 +0000
@@ -18,6 +18,8 @@
#include "ma_ftdefs.h"
#include <my_getopt.h>
+#include "ma_server_hton.h"
+#include "ma_no_server.h"
static void usage();
static void complain(int val);
@@ -63,6 +65,8 @@ int main(int argc,char *argv[])
struct { MARIA_HA *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
+ ma_server_hton= &ma_no_server_hton;
+
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(error);
maria_init();
=== modified file 'storage/maria/maria_pack.c'
--- a/storage/maria/maria_pack.c 2008-08-25 18:23:18 +0000
+++ b/storage/maria/maria_pack.c 2008-10-02 18:05:48 +0000
@@ -46,6 +46,9 @@
#define OLD_EXT ".OLD"
#define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE
+#include "ma_server_hton.h"
+#include "ma_no_server.h"
+
struct st_file_buffer {
File file;
uchar *buffer,*pos,*end;
@@ -207,6 +210,7 @@ int main(int argc, char **argv)
PACK_MRG_INFO merge;
char **default_argv;
MY_INIT(argv[0]);
+ ma_server_hton= &ma_no_server_hton;
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
=== modified file 'storage/maria/maria_read_log.c'
--- a/storage/maria/maria_read_log.c 2008-06-05 16:11:22 +0000
+++ b/storage/maria/maria_read_log.c 2008-10-02 18:05:48 +0000
@@ -16,6 +16,8 @@
#include "maria_def.h"
#include "ma_recovery.h"
#include <my_getopt.h>
+#include "ma_server_hton.h"
+#include "ma_no_server.h"
#define LOG_FLAGS 0
@@ -42,6 +44,7 @@ int main(int argc, char **argv)
char **default_argv;
uint warnings_count;
MY_INIT(argv[0]);
+ ma_server_hton= & ma_no_server_hton;
load_defaults("my", load_default_groups, &argc, &argv);
default_argv= argv;
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2008-07-09 07:12:43 +0000
+++ b/storage/myisam/ha_myisam.cc 2008-10-02 18:05:48 +0000
@@ -2013,7 +2013,7 @@ int myisam_panic(handlerton *hton, ha_pa
return mi_panic(flag);
}
-static int myisam_init(void *p)
+static int myisam_init(void *p, struct server_hton* unused)
{
handlerton *myisam_hton;
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc 2008-07-24 10:00:56 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc 2008-10-02 18:05:48 +0000
@@ -1351,7 +1351,7 @@ int myisammrg_panic(handlerton *hton, ha
return myrg_panic(flag);
}
-static int myisammrg_init(void *p)
+static int myisammrg_init(void *p, struct server_hton* unused)
{
handlerton *myisammrg_hton;