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/sql_handler.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/sql_handler.cc')
-rw-r--r-- | sql/sql_handler.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 1e92d95573a..ae07e648921 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -207,21 +207,21 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) DBUG_RETURN(TRUE); } - if (! hash_inited(&thd->handler_tables_hash)) + if (! my_hash_inited(&thd->handler_tables_hash)) { /* HASH entries are of type TABLE_LIST. */ - if (hash_init(&thd->handler_tables_hash, &my_charset_latin1, - HANDLER_TABLES_HASH_SIZE, 0, 0, - (hash_get_key) mysql_ha_hash_get_key, - (hash_free_key) mysql_ha_hash_free, 0)) + if (my_hash_init(&thd->handler_tables_hash, &my_charset_latin1, + HANDLER_TABLES_HASH_SIZE, 0, 0, + (my_hash_get_key) mysql_ha_hash_get_key, + (my_hash_free_key) mysql_ha_hash_free, 0)) goto err; } else if (! reopen) /* Otherwise we have 'tables' already. */ { - if (hash_search(&thd->handler_tables_hash, (uchar*) tables->alias, - strlen(tables->alias) + 1)) + if (my_hash_search(&thd->handler_tables_hash, (uchar*) tables->alias, + strlen(tables->alias) + 1)) { DBUG_PRINT("info",("duplicate '%s'", tables->alias)); my_error(ER_NONUNIQ_TABLE, MYF(0), tables->alias); @@ -367,12 +367,12 @@ bool mysql_ha_close(THD *thd, TABLE_LIST *tables) DBUG_PRINT("enter",("'%s'.'%s' as '%s'", tables->db, tables->table_name, tables->alias)); - if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, - (uchar*) tables->alias, - strlen(tables->alias) + 1))) + if ((hash_tables= (TABLE_LIST*) my_hash_search(&thd->handler_tables_hash, + (uchar*) tables->alias, + strlen(tables->alias) + 1))) { mysql_ha_close_table(thd, hash_tables, FALSE); - hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); + my_hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); } else { @@ -439,9 +439,9 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, it++; retry: - if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, - (uchar*) tables->alias, - strlen(tables->alias) + 1))) + if ((hash_tables= (TABLE_LIST*) my_hash_search(&thd->handler_tables_hash, + (uchar*) tables->alias, + strlen(tables->alias) + 1))) { table= hash_tables->table; DBUG_PRINT("info-in-hash",("'%s'.'%s' as '%s' table: 0x%lx", @@ -719,7 +719,7 @@ static TABLE_LIST *mysql_ha_find(THD *thd, TABLE_LIST *tables) /* search for all handlers with matching table names */ for (uint i= 0; i < thd->handler_tables_hash.records; i++) { - hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i); + hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i); for (tables= first; tables; tables= tables->next_local) { if ((! *tables->db || @@ -763,7 +763,7 @@ void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked) next= hash_tables->next_local; if (hash_tables->table) mysql_ha_close_table(thd, hash_tables, is_locked); - hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); + my_hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); hash_tables= next; } @@ -789,7 +789,7 @@ void mysql_ha_flush(THD *thd) for (uint i= 0; i < thd->handler_tables_hash.records; i++) { - hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i); + hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i); if (hash_tables->table && hash_tables->table->needs_reopen_or_name_lock()) mysql_ha_close_table(thd, hash_tables, TRUE); } @@ -813,12 +813,12 @@ void mysql_ha_cleanup(THD *thd) for (uint i= 0; i < thd->handler_tables_hash.records; i++) { - hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i); + hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i); if (hash_tables->table) mysql_ha_close_table(thd, hash_tables, FALSE); - } + } - hash_free(&thd->handler_tables_hash); + my_hash_free(&thd->handler_tables_hash); DBUG_VOID_RETURN; } |