diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-12-29 14:58:17 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2016-02-26 18:35:14 +0400 |
commit | c1d1c59888953d90ee2fb1ca32f9f44ca5b1055c (patch) | |
tree | 3599bbda8ff32499aced3b51f4d1fd22d78c516c /sql/table_cache.h | |
parent | d3af8942350e87d809fdf4d9453d5210ada2d3d1 (diff) | |
download | mariadb-git-c1d1c59888953d90ee2fb1ca32f9f44ca5b1055c.tar.gz |
MDEV-9488 - Table cache cleanups
Remove tdc_acquire_share() helpers: they don't actually make things simpler.
Diffstat (limited to 'sql/table_cache.h')
-rw-r--r-- | sql/table_cache.h | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/sql/table_cache.h b/sql/table_cache.h index 2d505d3c92a..a3e6715d5d0 100644 --- a/sql/table_cache.h +++ b/sql/table_cache.h @@ -205,11 +205,8 @@ extern void tdc_purge(bool all); extern TDC_element *tdc_lock_share(THD *thd, const char *db, const char *table_name); extern void tdc_unlock_share(TDC_element *element); -extern TABLE_SHARE *tdc_acquire_share(THD *thd, const char *db, - const char *table_name, - const char *key, uint key_length, - my_hash_value_type hash_value, - uint flags, TABLE **out_table); +extern TABLE_SHARE *tdc_acquire_share(THD *thd, TABLE_LIST *tl, uint flags, + TABLE **out_table= 0); extern void tdc_release_share(TABLE_SHARE *share); extern bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, const char *db, const char *table_name, @@ -248,50 +245,3 @@ inline uint tdc_create_key(char *key, const char *db, const char *table_name) return (uint) (strmake(strmake(key, db, NAME_LEN) + 1, table_name, NAME_LEN) - key + 1); } - -/** - Convenience helper: call tdc_acquire_share() without out_table. -*/ - -static inline TABLE_SHARE *tdc_acquire_share(THD *thd, const char *db, - const char *table_name, - const char *key, - uint key_length, uint flags) -{ - return tdc_acquire_share(thd, db, table_name, key, key_length, - my_hash_sort(&my_charset_bin, (uchar*) key, - key_length), flags, 0); -} - - -/** - Convenience helper: call tdc_acquire_share() without precomputed cache key. -*/ - -static inline TABLE_SHARE *tdc_acquire_share(THD *thd, const char *db, - const char *table_name, uint flags) -{ - char key[MAX_DBKEY_LENGTH]; - uint key_length; - key_length= tdc_create_key(key, db, table_name); - return tdc_acquire_share(thd, db, table_name, key, key_length, flags); -} - - -/** - Convenience helper: call tdc_acquire_share() reusing the MDL cache key. - - @note lifetime of the returned TABLE_SHARE is limited by the - lifetime of the TABLE_LIST object!!! -*/ - -uint get_table_def_key(const TABLE_LIST *table_list, const char **key); - -static inline TABLE_SHARE *tdc_acquire_share_shortlived(THD *thd, TABLE_LIST *tl, - uint flags) -{ - const char *key; - uint key_length= get_table_def_key(tl, &key); - return tdc_acquire_share(thd, tl->db, tl->table_name, key, key_length, - tl->mdl_request.key.tc_hash_value(), flags, 0); -} |