summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorbaker@bk-internal.mysql.com <>2006-11-07 06:59:51 +0100
committerbaker@bk-internal.mysql.com <>2006-11-07 06:59:51 +0100
commit079506b5a09d52410905fcd9b2fec46a29c4ccb4 (patch)
tree8e65fc0884d7351a6b131804c5c7cc129d8e6cd9 /sql/handler.cc
parenta56565b8d551222bb610a7c3df2b4d3ebbf4459b (diff)
parent8a56fcff6a490ee67088682a5202802c21f8f0aa (diff)
downloadmariadb-git-079506b5a09d52410905fcd9b2fec46a29c4ccb4.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc38
1 files changed, 15 insertions, 23 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 13fe1ce6f1d..d328f48c774 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,31 +510,22 @@ 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)
+int ha_end()
{
- 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 error= 0;
+ DBUG_ENTER("ha_end");
-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);
+ /*
+ This should be eventualy based on the graceful shutdown flag.
+ So if flag is equal to HA_PANIC_CLOSE, the deallocate
+ the errors.
+ */
+ if (ha_finish_errors())
+ error= 1;
- if (flag == HA_PANIC_CLOSE && ha_finish_errors())
- error[0]= 1;
- return error[0];
-} /* ha_panic */
+ DBUG_RETURN(error);
+}
static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin,
void *path)