#At file:///home/thek/Development/cpp/mysqlbzr/mysql-5.1-bug19027/
2675 Kristofer Pettersson 2008-11-06
Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
If the InnoDB SE fails to initialize during server start up, there is
no automatic mechanism for client applications to detect that the meta data
has changed.
This patch provide a temporary solution to this issue so that if the InnoDB
SE plugin fails the server won't go online.
modified:
sql/handler.cc
sql/sql_plugin.cc
per-file messages:
sql/handler.cc
* Added documentation
sql/sql_plugin.cc
* Added hard coded check to guarantee that the InnoDB storage engine is
successful in starting up before the server goes online.
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2008-10-08 13:52:57 +0000
+++ b/sql/handler.cc 2008-11-06 11:31:18 +0000
@@ -419,6 +419,16 @@ int ha_finalize_handlerton(st_plugin_int
}
+/**
+ Apply handler initialization methods on a plugin.
+
+ @param plugin A pointer to a plugin
+
+ @return Status code.
+ @retval 0 Success
+ @retval 1 Failure
+*/
+
int ha_initialize_handlerton(st_plugin_int *plugin)
{
handlerton *hton;
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2008-10-06 20:36:15 +0000
+++ b/sql/sql_plugin.cc 2008-11-06 11:31:18 +0000
@@ -990,13 +990,12 @@ void plugin_unlock_list(THD *thd, plugin
DBUG_VOID_RETURN;
}
-
static int plugin_initialize(struct st_plugin_int *plugin)
{
DBUG_ENTER("plugin_initialize");
safe_mutex_assert_owner(&LOCK_plugin);
-
+
if (plugin_type_initialize[plugin->plugin->type])
{
if ((*plugin_type_initialize[plugin->plugin->type])(plugin))
@@ -1098,6 +1097,7 @@ int plugin_init(int *argc, char **argv,
struct st_mysql_plugin *plugin;
struct st_plugin_int tmp, *plugin_ptr, **reap;
MEM_ROOT tmp_root;
+ bool mandatory_plugin_failed_to_load= FALSE;
DBUG_ENTER("plugin_init");
if (initialized)
@@ -1160,7 +1160,14 @@ int plugin_init(int *argc, char **argv,
continue;
if (plugin_initialize(plugin_ptr))
+ {
+ /*
+ Built in plugins will cause the server to abort.
+ */
+ sql_print_error("Plugin '%s' is configured as a requirement. "
+ "Server will terminate.",plugin->name);
goto err_unlock;
+ }
/*
initialize the global default storage engine so that it may
@@ -1220,6 +1227,13 @@ int plugin_init(int *argc, char **argv,
while ((plugin_ptr= *(--reap)))
{
pthread_mutex_unlock(&LOCK_plugin);
+ /*
+ InnoDB must succeed in loading before the server is allowed to start.
+ This is a temporary solution until a dependency checker is implemented.
+ */
+ if (my_strcasecmp(&my_charset_latin1, plugin_ptr->name.str, "InnoDB") == 0)
+ mandatory_plugin_failed_to_load= TRUE;
+
plugin_deinitialize(plugin_ptr, true);
pthread_mutex_lock(&LOCK_plugin);
plugin_del(plugin_ptr);
@@ -1228,6 +1242,9 @@ int plugin_init(int *argc, char **argv,
pthread_mutex_unlock(&LOCK_plugin);
my_afree(reap);
+ if (mandatory_plugin_failed_to_load)
+ goto err;
+
end:
free_root(&tmp_root, MYF(0));
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (kristofer.pettersson:2675) Bug#19027 | Kristofer Pettersson | 6 Nov |