Commit 31e47a95 authored by brian@zim.(none)'s avatar brian@zim.(none)

Adding in an ha_end() call. This is the first part of the patch I and Monty...

Adding in an ha_end() call. This is the first part of the patch I and Monty have agreed on. In the future engines will have the option of shutting down more quickly via the panic call, or just shutting down during the unloading of a plugin. 
parent 0b6e146c
...@@ -510,6 +510,23 @@ int ha_init() ...@@ -510,6 +510,23 @@ int ha_init()
DBUG_RETURN(error); DBUG_RETURN(error);
} }
int ha_end()
{
int error= 0;
DBUG_ENTER("ha_end");
/*
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;
DBUG_RETURN(error);
}
static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin, static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin,
void *path) void *path)
{ {
......
...@@ -1654,6 +1654,7 @@ static inline bool ha_storage_engine_is_enabled(const handlerton *db_type) ...@@ -1654,6 +1654,7 @@ static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
/* basic stuff */ /* basic stuff */
int ha_init(void); int ha_init(void);
int ha_end(void);
int ha_initialize_handlerton(st_plugin_int *plugin); int ha_initialize_handlerton(st_plugin_int *plugin);
int ha_finalize_handlerton(st_plugin_int *plugin); int ha_finalize_handlerton(st_plugin_int *plugin);
......
...@@ -1193,6 +1193,7 @@ void clean_up(bool print_message) ...@@ -1193,6 +1193,7 @@ void clean_up(bool print_message)
#endif #endif
} }
plugin_shutdown(); plugin_shutdown();
ha_end();
if (tc_log) if (tc_log)
tc_log->close(); tc_log->close();
xid_cache_free(); xid_cache_free();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment