summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2006-10-11 18:02:12 -0700
committerunknown <brian@zim.(none)>2006-10-11 18:02:12 -0700
commitdeb36ce16a57311071cc5cd70e8fe48ba25bcf40 (patch)
tree0119bee883ae621d9776e822040d3aca44968e95 /sql/handler.cc
parentef0ee7642ad986551495bd891ad78bcdb11c7fcf (diff)
downloadmariadb-git-deb36ce16a57311071cc5cd70e8fe48ba25bcf40.tar.gz
Panic was being called twice!
Both on its own and in the plugin shutdown.... not so good. The code is a bit simpler, and we could now technically remove the panic all entirely if we wanted to. sql/handler.cc: Handler was returning from a panic failure. Bad idea! This means that the rest of the shutdown is not carried outin the engine. Removed panic specific calls. Panic should also be called regardless of "startup". sql/mysqld.cc: Removed ha_panic call (since its called in plugin shutdown)
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc31
1 files changed, 3 insertions, 28 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index ccf1a1ef8d9..4beef164ee1 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -376,11 +376,12 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
case SHOW_OPTION_YES:
if (installed_htons[hton->db_type] == hton)
installed_htons[hton->db_type]= NULL;
- if (hton->panic && hton->panic(hton, HA_PANIC_CLOSE))
- DBUG_RETURN(1);
break;
};
+ if (hton->panic)
+ hton->panic(hton, HA_PANIC_CLOSE);
+
if (plugin->plugin->deinit)
{
/*
@@ -509,32 +510,6 @@ int ha_init()
DBUG_RETURN(error);
}
-/*
- close, flush or restart databases
- Ignore this for other databases than ours
-*/
-
-static my_bool panic_handlerton(THD *unused1, st_plugin_int *plugin, void *arg)
-{
- handlerton *hton= (handlerton *)plugin->data;
- if (hton->state == SHOW_OPTION_YES && hton->panic)
- ((int*)arg)[0]|= hton->panic(hton, (enum ha_panic_function)((int*)arg)[1]);
- return FALSE;
-}
-
-
-int ha_panic(enum ha_panic_function flag)
-{
- int error[2];
-
- error[0]= 0; error[1]= (int)flag;
- plugin_foreach(NULL, panic_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, error);
-
- if (flag == HA_PANIC_CLOSE && ha_finish_errors())
- error[0]= 1;
- return error[0];
-} /* ha_panic */
-
static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin,
void *path)
{