diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-10-14 20:37:38 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-10-14 20:37:38 +0400 |
commit | 9b41c7532d18b04d2f430932ad916886c77fbff6 (patch) | |
tree | f4b1025df0074aacaf5f04f64aac370a80806ee1 /sql/repl_failsafe.cc | |
parent | 2b75d952e68375eb1727040074266bbe1b436653 (diff) | |
download | mariadb-git-9b41c7532d18b04d2f430932ad916886c77fbff6.tar.gz |
Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
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.
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r-- | sql/repl_failsafe.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index e470317abef..aa8618399f8 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -146,10 +146,10 @@ void unregister_slave(THD* thd, bool only_mine, bool need_mutex) pthread_mutex_lock(&LOCK_slave_list); SLAVE_INFO* old_si; - if ((old_si = (SLAVE_INFO*)hash_search(&slave_list, - (uchar*)&thd->server_id, 4)) && + if ((old_si = (SLAVE_INFO*)my_hash_search(&slave_list, + (uchar*)&thd->server_id, 4)) && (!only_mine || old_si->thd == thd)) - hash_delete(&slave_list, (uchar*)old_si); + my_hash_delete(&slave_list, (uchar*)old_si); if (need_mutex) pthread_mutex_unlock(&LOCK_slave_list); @@ -221,17 +221,18 @@ extern "C" void slave_info_free(void *s) void init_slave_list() { - hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0, - (hash_get_key) slave_list_key, (hash_free_key) slave_info_free, 0); + my_hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0, + (my_hash_get_key) slave_list_key, + (my_hash_free_key) slave_info_free, 0); pthread_mutex_init(&LOCK_slave_list, MY_MUTEX_INIT_FAST); } void end_slave_list() { /* No protection by a mutex needed as we are only called at shutdown */ - if (hash_inited(&slave_list)) + if (my_hash_inited(&slave_list)) { - hash_free(&slave_list); + my_hash_free(&slave_list); pthread_mutex_destroy(&LOCK_slave_list); } } @@ -547,8 +548,8 @@ HOSTS"; uint32 log_server_id; SLAVE_INFO* si, *old_si; log_server_id = atoi(row[0]); - if ((old_si= (SLAVE_INFO*)hash_search(&slave_list, - (uchar*)&log_server_id,4))) + if ((old_si= (SLAVE_INFO*)my_hash_search(&slave_list, + (uchar*)&log_server_id,4))) si = old_si; else { @@ -682,7 +683,7 @@ bool show_slave_hosts(THD* thd) for (uint i = 0; i < slave_list.records; ++i) { - SLAVE_INFO* si = (SLAVE_INFO*) hash_element(&slave_list, i); + SLAVE_INFO* si = (SLAVE_INFO*) my_hash_element(&slave_list, i); protocol->prepare_for_resend(); protocol->store((uint32) si->server_id); protocol->store(si->host, &my_charset_bin); |