summaryrefslogtreecommitdiff
path: root/include/mysql/plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mysql/plugin.h')
-rw-r--r--include/mysql/plugin.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 144d7547100..835e691daf3 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -423,12 +423,12 @@ struct st_mysql_plugin
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
void *info; /* pointer to type-specific plugin descriptor */
const char *name; /* plugin name */
- const char *author; /* plugin author (for SHOW PLUGINS) */
- const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
+ const char *author; /* plugin author (for I_S.PLUGINS) */
+ const char *descr; /* general descriptive text (for I_S.PLUGINS) */
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
int (*init)(void *); /* the function to invoke when plugin is loaded */
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
- unsigned int version; /* plugin version (for SHOW PLUGINS) */
+ unsigned int version; /* plugin version (for I_S.PLUGINS) */
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1; /* reserved for dependency checking */
@@ -810,30 +810,37 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd,
const char *key, unsigned int key_length,
int using_trx);
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
/**
Provide a handler data getter to simplify coding
*/
-inline
-void *
-thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
-{
- return *thd_ha_data(thd, hton);
-}
+void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
+
/**
Provide a handler data setter to simplify coding
+
+ @details
+ Set ha_data pointer (storage engine per-connection information).
+
+ To avoid unclean deactivation (uninstall) of storage engine plugin
+ in the middle of transaction, additional storage engine plugin
+ lock is acquired.
+
+ 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().
*/
-inline
-void
-thd_set_ha_data(const MYSQL_THD thd, const struct handlerton *hton,
- const void *ha_data)
-{
- *thd_ha_data(thd, hton)= (void*) ha_data;
+void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
+ const void *ha_data);
+#ifdef __cplusplus
}
#endif