summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <baker@bk-internal.mysql.com>2006-11-02 08:35:55 +0100
committerunknown <baker@bk-internal.mysql.com>2006-11-02 08:35:55 +0100
commit9beab523e86c1f8f4e911a941afbd946bdc30843 (patch)
tree1410eedefabcb79961c493f2196b85460b6e4dcc /sql
parenta1db0e72de8805fe0652c7142be5ec59cd659c67 (diff)
parent6baa75737184a0508242846aadf4a3e536a9887e (diff)
downloadmariadb-git-9beab523e86c1f8f4e911a941afbd946bdc30843.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-arch sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/mysqld.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc38
-rw-r--r--sql/handler.h1
-rw-r--r--sql/mysqld.cc2
3 files changed, 17 insertions, 24 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 280e518b3c5..4aa76cf6760 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)
diff --git a/sql/handler.h b/sql/handler.h
index 0cfd6da23d7..8d2f7df802a 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1654,6 +1654,7 @@ static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
/* basic stuff */
int ha_init(void);
+int ha_end(void);
int ha_initialize_handlerton(st_plugin_int *plugin);
int ha_finalize_handlerton(st_plugin_int *plugin);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 819695fc67f..5687a826faa 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1186,7 +1186,6 @@ void clean_up(bool print_message)
lex_free(); /* Free some memory */
set_var_free();
free_charsets();
- (void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */
if (!opt_noacl)
{
#ifdef HAVE_DLOPEN
@@ -1194,6 +1193,7 @@ void clean_up(bool print_message)
#endif
}
plugin_shutdown();
+ ha_end();
if (tc_log)
tc_log->close();
xid_cache_free();