From 9b41c7532d18b04d2f430932ad916886c77fbff6 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Wed, 14 Oct 2009 20:37:38 +0400 Subject: Backport of: ---------------------------------------------------------- revno: 2617.22.5 committer: Konstantin Osipov branch nick: mysql-6.0-runtime timestamp: Tue 2009-01-27 05:08:48 +0300 message: Remove non-prefixed use of HASH. Always use my_hash_init(), my_hash_inited(), my_hash_search(), my_hash_element(), my_hash_delete(), my_hash_free() rather than non-prefixed counterparts (hash_init(), etc). Remove the backward-compatible defines. --- storage/blackhole/ha_blackhole.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'storage/blackhole') diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc index 03ed57f38e8..e64933f6629 100644 --- a/storage/blackhole/ha_blackhole.cc +++ b/storage/blackhole/ha_blackhole.cc @@ -319,8 +319,9 @@ static st_blackhole_share *get_share(const char *table_name) length= (uint) strlen(table_name); pthread_mutex_lock(&blackhole_mutex); - if (!(share= (st_blackhole_share*) hash_search(&blackhole_open_tables, - (uchar*) table_name, length))) + if (!(share= (st_blackhole_share*) + my_hash_search(&blackhole_open_tables, + (uchar*) table_name, length))) { if (!(share= (st_blackhole_share*) my_malloc(sizeof(st_blackhole_share) + length, @@ -350,7 +351,7 @@ static void free_share(st_blackhole_share *share) { pthread_mutex_lock(&blackhole_mutex); if (!--share->use_count) - hash_delete(&blackhole_open_tables, (uchar*) share); + my_hash_delete(&blackhole_open_tables, (uchar*) share); pthread_mutex_unlock(&blackhole_mutex); } @@ -377,16 +378,16 @@ static int blackhole_init(void *p) blackhole_hton->flags= HTON_CAN_RECREATE; VOID(pthread_mutex_init(&blackhole_mutex, MY_MUTEX_INIT_FAST)); - (void) hash_init(&blackhole_open_tables, system_charset_info,32,0,0, - (hash_get_key) blackhole_get_key, - (hash_free_key) blackhole_free_key, 0); + (void) my_hash_init(&blackhole_open_tables, system_charset_info,32,0,0, + (my_hash_get_key) blackhole_get_key, + (my_hash_free_key) blackhole_free_key, 0); return 0; } static int blackhole_fini(void *p) { - hash_free(&blackhole_open_tables); + my_hash_free(&blackhole_open_tables); pthread_mutex_destroy(&blackhole_mutex); return 0; -- cgit v1.2.1