summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2010-04-14 13:53:59 +0400
committerSergey Vojtovich <svoj@sun.com>2010-04-14 13:53:59 +0400
commit4aa36ee7b689c4e9f74ccdc08fa278df66042fe8 (patch)
treeb63efe0cd130b6f27ed369fb7438cca073cabe69 /sql/handler.h
parent6eca53f1d382a247456d29794c70338f972b77a9 (diff)
downloadmariadb-git-4aa36ee7b689c4e9f74ccdc08fa278df66042fe8.tar.gz
BUG#39053 - UNISTALL PLUGIN does not allow the storage engine
to cleanup open connections It was possible to UNINSTALL storage engine plugin when binding between THD object and storage engine is still active (e.g. in the middle of transaction). To avoid unclean deactivation (uninstall) of storage engine plugin in the middle of transaction, additional storage engine plugin lock is acquired by thd_set_ha_data(). If ha_data is not null and storage engine plugin was not locked by thd_set_ha_data() in this connection before, storage engine plugin gets locked. If ha_data is null and storage engine plugin was locked by thd_set_ha_data() in this connection before, storage engine plugin lock gets released. If handlerton::close_connection() didn't reset ha_data, server does it immediately after calling handlerton::close_connection(). Note that this is just a framework fix, storage engines must switch to thd_set_ha_data() from thd_ha_data() if they want to see fit. include/mysql/plugin.h: As thd_{get|set}_ha_data() have some extra logic now, they must be implemented on server side. include/mysql/plugin.h.pp: As thd_{get|set}_ha_data() have some extra logic now, they must be implemented on server side. sql/handler.cc: Make sure ha_data is reset and ha_data lock is released. sql/handler.h: hton is not supposed to be updated by ha_lock_engine(), make it const. sql/sql_class.cc: As thd_{get|set}_ha_data() have some extra logic now, they must be implemented on server side. sql/sql_class.h: Added ha_data lock.
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 7fc2bf2fece..d9dfd4f0707 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1956,7 +1956,7 @@ extern ulong total_ha, total_ha_2pc;
/* lookups */
handlerton *ha_default_handlerton(THD *thd);
plugin_ref ha_resolve_by_name(THD *thd, const LEX_STRING *name);
-plugin_ref ha_lock_engine(THD *thd, handlerton *hton);
+plugin_ref ha_lock_engine(THD *thd, const handlerton *hton);
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type);
handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
handlerton *db_type);