diff options
-rw-r--r-- | client/mysqltest.c | 8 | ||||
-rw-r--r-- | include/hash.h | 2 | ||||
-rw-r--r-- | mysys/hash.c | 2 | ||||
-rw-r--r-- | mysys/testhash.c | 4 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 2 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 2 | ||||
-rw-r--r-- | sql/hash_filo.h | 2 | ||||
-rw-r--r-- | sql/item_func.cc | 4 | ||||
-rw-r--r-- | sql/lock.cc | 2 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 4 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 10 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_cache.cc | 4 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_udf.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 2 | ||||
-rw-r--r-- | tools/mysqlmanager.c | 4 |
20 files changed, 32 insertions, 32 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 04278bce834..fd8cf7ecc8b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -664,7 +664,7 @@ static VAR* var_obtain(char* name, int len) if ((v = (VAR*)hash_search(&var_hash, name, len))) return v; v = var_init(0, name, len, "", 0); - hash_insert(&var_hash, (byte*)v); + my_hash_insert(&var_hash, (byte*)v); return v; } @@ -2400,7 +2400,7 @@ static void var_from_env(const char *name, const char *def_val) tmp = def_val; v = var_init(0, name, 0, tmp, 0); - hash_insert(&var_hash, (byte*)v); + my_hash_insert(&var_hash, (byte*)v); } @@ -2416,9 +2416,9 @@ static void init_var_hash(MYSQL *mysql) var_from_env("MYSQL_TEST_DIR", "/tmp"); var_from_env("BIG_TEST", opt_big_test ? "1" : "0"); v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0); - hash_insert(&var_hash, (byte*) v); + my_hash_insert(&var_hash, (byte*) v); v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0); - hash_insert(&var_hash, (byte*) v); + my_hash_insert(&var_hash, (byte*) v); DBUG_VOID_RETURN; } diff --git a/include/hash.h b/include/hash.h index 6c805bc2da7..3c2ae32c70e 100644 --- a/include/hash.h +++ b/include/hash.h @@ -49,7 +49,7 @@ void hash_free(HASH *tree); byte *hash_element(HASH *hash,uint idx); gptr hash_search(HASH *info,const byte *key,uint length); gptr hash_next(HASH *info,const byte *key,uint length); -my_bool hash_insert(HASH *info,const byte *data); +my_bool my_hash_insert(HASH *info,const byte *data); my_bool hash_delete(HASH *hash,byte *record); my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length); void hash_replace(HASH *hash, uint idx, byte *new_row); diff --git a/mysys/hash.c b/mysys/hash.c index 0b2dbc484bc..b0ddbd90794 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -217,7 +217,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length) /* Write a hash-key to the hash-index */ -my_bool hash_insert(HASH *info,const byte *record) +my_bool my_hash_insert(HASH *info,const byte *record) { int flag; uint halfbuff,hash_nr,first_index,idx; diff --git a/mysys/testhash.c b/mysys/testhash.c index a1d14dc225d..72badffdbcd 100644 --- a/mysys/testhash.c +++ b/mysys/testhash.c @@ -83,7 +83,7 @@ static int do_test() n1=rnd(1000); n2=rnd(100); n3=rnd(min(recant*5,MAX_RECORDS)); record= (char*) my_malloc(reclength,MYF(MY_FAE)); sprintf(record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count); - if (hash_insert(&hash,record)) + if (my_hash_insert(&hash,record)) { printf("Error: %d in write at record: %d\n",my_errno,i); goto err; @@ -199,7 +199,7 @@ static int do_test() record=(byte*) my_malloc(reclength,MYF(MY_FAE)); memcpy(record,recpos,reclength); record[reclength-1]=rnd(5)+1; - if (hash_insert(&hash2,record)) + if (my_hash_insert(&hash2,record)) { printf("Got error when inserting record: %*s",reclength,record); goto err; diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index ee1b54e5745..34915a6020c 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -2266,7 +2266,7 @@ static BDB_SHARE *get_share(const char *table_name, TABLE *table) strmov(share->table_name,table_name); share->key_file = key_file; share->key_type = key_type; - if (hash_insert(&bdb_open_tables, (byte*) share)) + if (my_hash_insert(&bdb_open_tables, (byte*) share)) { pthread_mutex_unlock(&bdb_mutex); /* purecov: inspected */ my_free((gptr) share,0); /* purecov: inspected */ diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index bc014c621fd..4ff5aba4a32 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4583,7 +4583,7 @@ static INNOBASE_SHARE *get_share(const char *table_name) share->table_name_length=length; share->table_name=(char*) (share+1); strmov(share->table_name,table_name); - if (hash_insert(&innobase_open_tables, (mysql_byte*) share)) + if (my_hash_insert(&innobase_open_tables, (mysql_byte*) share)) { pthread_mutex_unlock(&innobase_mutex); my_free((gptr) share,0); diff --git a/sql/hash_filo.h b/sql/hash_filo.h index 92cd2658967..d1672e1a60c 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -116,7 +116,7 @@ public: last_link=last_link->prev_used; hash_delete(&cache,(byte*) tmp); } - if (hash_insert(&cache,(byte*) entry)) + if (my_hash_insert(&cache,(byte*) entry)) { if (free_element) (*free_element)(entry); // This should never happen diff --git a/sql/item_func.cc b/sql/item_func.cc index fe419745b60..1c141668509 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1742,7 +1742,7 @@ public: pthread_cond_init(&cond,NULL); if (key) { - if (hash_insert(&hash_user_locks,(byte*) this)) + if (my_hash_insert(&hash_user_locks,(byte*) this)) { my_free((gptr) key,MYF(0)); key=0; @@ -2103,7 +2103,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, entry->used_query_id=current_thd->query_id; entry->type=STRING_RESULT; memcpy(entry->name.str, name.str, name.length+1); - if (hash_insert(hash,(byte*) entry)) + if (my_hash_insert(hash,(byte*) entry)) { my_free((char*) entry,MYF(0)); return 0; diff --git a/sql/lock.cc b/sql/lock.cc index 82004298453..ea5e60b558f 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -526,7 +526,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) table->locked_by_name=1; table_list->table=table; - if (hash_insert(&open_cache, (byte*) table)) + if (my_hash_insert(&open_cache, (byte*) table)) { my_free((gptr) table,MYF(0)); DBUG_RETURN(-1); diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 5e040d26dc3..b931ce0ba8c 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -177,7 +177,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) pthread_mutex_lock(&LOCK_slave_list); unregister_slave(thd,0,0); - res= hash_insert(&slave_list, (byte*) si); + res= my_hash_insert(&slave_list, (byte*) si); pthread_mutex_unlock(&LOCK_slave_list); return res; @@ -540,7 +540,7 @@ HOSTS"; goto err; } si->server_id = server_id; - hash_insert(&slave_list, (byte*)si); + my_hash_insert(&slave_list, (byte*)si); } strmake(si->host, row[1], sizeof(si->host)-1); si->port = atoi(row[port_ind]); diff --git a/sql/set_var.cc b/sql/set_var.cc index ec4f0191d4a..147033be660 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1925,7 +1925,7 @@ void set_var_init() { (*var)->name_length= strlen((*var)->name); (*var)->option_limits= find_option(my_long_options, (*var)->name); - hash_insert(&system_variable_hash, (byte*) *var); + my_hash_insert(&system_variable_hash, (byte*) *var); } /* Special cases diff --git a/sql/slave.cc b/sql/slave.cc index 8490881f5dc..641707aab2f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -790,7 +790,7 @@ int add_table_rule(HASH* h, const char* table_spec) e->tbl_name = e->db + (dot - table_spec) + 1; e->key_len = len; memcpy(e->db, table_spec, len); - (void)hash_insert(h, (byte*)e); + (void)my_hash_insert(h, (byte*)e); return 0; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7889a583fde..508ff88a0cf 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1069,7 +1069,7 @@ static void init_check_host(void) else if (!hash_search(&acl_check_hosts,(byte*) &acl_user->host, (uint) strlen(acl_user->host.hostname))) { - if (hash_insert(&acl_check_hosts,(byte*) acl_user)) + if (my_hash_insert(&acl_check_hosts,(byte*) acl_user)) { // End of memory allow_all_hosts=1; // Should never happen DBUG_VOID_RETURN; @@ -1782,7 +1782,7 @@ public: privs = cols = 0; /* purecov: deadcode */ return; /* purecov: deadcode */ } - hash_insert(&hash_columns, (byte *) mem_check); + my_hash_insert(&hash_columns, (byte *) mem_check); } while (!col_privs->file->index_next(col_privs->record[0]) && !key_cmp(col_privs,key,0,key_len)); } @@ -1944,7 +1944,7 @@ static int replace_column_table(GRANT_TABLE *g_t, goto end; /* purecov: inspected */ } GRANT_COLUMN *grant_column = new GRANT_COLUMN(xx->column,privileges); - hash_insert(&g_t->hash_columns,(byte*) grant_column); + my_hash_insert(&g_t->hash_columns,(byte*) grant_column); } } table->file->index_end(); @@ -2295,7 +2295,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, result= -1; /* purecov: deadcode */ continue; /* purecov: deadcode */ } - hash_insert(&column_priv_hash,(byte*) grant_table); + my_hash_insert(&column_priv_hash,(byte*) grant_table); } /* If revoke_grant, calculate the new column privilege for tables_priv */ @@ -2538,7 +2538,7 @@ my_bool grant_init(THD *org_thd) { GRANT_TABLE *mem_check; if (!(mem_check=new GRANT_TABLE(t_table,c_table)) || - mem_check->ok() && hash_insert(&column_priv_hash,(byte*) mem_check)) + mem_check->ok() && my_hash_insert(&column_priv_hash,(byte*) mem_check)) { /* This could only happen if we are out memory */ grant_option= FALSE; /* purecov: deadcode */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fa4f08b5f14..1e44aa6e46d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -873,7 +873,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name, table->version=refresh_version; table->flush_version=flush_version; DBUG_PRINT("info", ("inserting table %p into the cache", table)); - VOID(hash_insert(&open_cache,(byte*) table)); + VOID(my_hash_insert(&open_cache,(byte*) table)); } table->in_use=thd; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f7742c6b7a7..fb86f52ab6e 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -823,7 +823,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) Query_cache_query *header = query_block->query(); header->init_n_lock(); - if (hash_insert(&queries, (byte*) query_block)) + if (my_hash_insert(&queries, (byte*) query_block)) { refused++; DBUG_PRINT("qcache", ("insertion in query hash")); @@ -2044,7 +2044,7 @@ Query_cache::insert_table(uint key_len, char *key, Query_cache_block_table *list_root = table_block->table(0); list_root->n = 0; list_root->next = list_root->prev = list_root; - if (hash_insert(&tables, (const byte *) table_block)) + if (my_hash_insert(&tables, (const byte *) table_block)) { DBUG_PRINT("qcache", ("Can't insert table to hash")); // write_block_data return locked block diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 42f8bb16bcd..de76fef85a9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -161,7 +161,7 @@ static int get_or_create_user_conn(THD *thd, const char *user, if (max_user_connections && mqh->connections > max_user_connections) uc->user_resources.connections = max_user_connections; uc->intime=thd->thr_create_time; - if (hash_insert(&hash_user_connections, (byte*) uc)) + if (my_hash_insert(&hash_user_connections, (byte*) uc)) { my_free((char*) uc,0); send_error(thd, 0, NullS); // Out of memory diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ab985ffbc6d..ff41e9fd067 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7196,7 +7196,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, goto err; } else - (void) hash_insert(&hash, key_pos-key_length); + (void) my_hash_insert(&hash, key_pos-key_length); key_pos+=extra_length; } my_free((char*) key_buffer,MYF(0)); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 99410bb34ac..c237b023e7b 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -345,7 +345,7 @@ static udf_func *add_udf(LEX_STRING *name, Item_result ret, char *dl, tmp->returns = ret; tmp->type = type; tmp->usage_count=1; - if (hash_insert(&udf_hash,(byte*) tmp)) + if (my_hash_insert(&udf_hash,(byte*) tmp)) return 0; using_udf_functions=1; return tmp; diff --git a/sql/table.cc b/sql/table.cc index a980e086d60..5e7991436a1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -459,7 +459,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (outparam->timestamp_field == reg_field) outparam->timestamp_field_offset=i; if (use_hash) - (void) hash_insert(&outparam->name_hash,(byte*) *field_ptr); // Will never fail + (void) my_hash_insert(&outparam->name_hash,(byte*) *field_ptr); // Will never fail } *field_ptr=0; // End marker diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c index 70382c29735..f1efd3be3eb 100644 --- a/tools/mysqlmanager.c +++ b/tools/mysqlmanager.c @@ -818,7 +818,7 @@ HANDLE_DECL(handle_def_exec) update_req_len(e); hash_delete(&exec_hash,(byte*)old_e); } - hash_insert(&exec_hash,(byte*)e); + my_hash_insert(&exec_hash,(byte*)e); pthread_mutex_unlock(&lock_exec_hash); client_msg(&thd->net,MANAGER_OK,"Exec definition created"); return 0; @@ -1666,7 +1666,7 @@ static void init_user_hash() } else { - hash_insert(&user_hash,(gptr)u); + my_hash_insert(&user_hash,(gptr)u); } } my_fclose(f, MYF(0)); |