diff options
author | unknown <kostja@bodhi.(none)> | 2007-08-31 10:19:52 +0400 |
---|---|---|
committer | unknown <kostja@bodhi.(none)> | 2007-08-31 10:19:52 +0400 |
commit | 3b85708a46dab914d1b70519c575d8899d1fb695 (patch) | |
tree | 14710401798f8ef572997a003e8792fb9353e947 /include | |
parent | 3d110250d363cc7703946c96cfcd7d62c9c065c3 (diff) | |
download | mariadb-git-3b85708a46dab914d1b70519c575d8899d1fb695.tar.gz |
Never access thd->ha_data directly, use getters/setters from the plugin
API instead.
This is a pre-requisite of the fix for Bug 12713, which changes the
data type of thd->ha_data from void * to struct Ha_data.
include/mysql/plugin.h:
Provide accessors to thd->ha_data for simple and robust code.
sql/ha_ndbcluster_binlog.h:
Use getters/setters of thd->ha_data, instead of direct access.
sql/handler.cc:
Use a getter of thd->ha_data instead of direct access.
sql/log.cc:
Use getters/setters of thd->ha_data, instead of direct access.
sql/rpl_utility.h:
Fix a compilation warning (declaration order must match initialization
order in constructor).
storage/federated/ha_federated.cc:
Use interface accessors to thd->ha_data, instead of direct access.
Diffstat (limited to 'include')
-rw-r--r-- | include/mysql/plugin.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 61ed7be738f..50ec051d111 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -785,5 +785,28 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd, } #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); +} + +/** + Provide a handler data setter to simplify coding +*/ +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; +} +#endif + #endif |