diff options
author | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-03-14 21:44:42 +0400 |
---|---|---|
committer | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-03-14 21:44:42 +0400 |
commit | 8959b690fe796a44ddda440290b3fe9a9cf89ca5 (patch) | |
tree | d80812bbab290e762f4a058cded480022c09d0f3 /sql | |
parent | ee1ef8c58c9df9a62f7a0cc3dee6c2f705c8eb44 (diff) | |
download | mariadb-git-8959b690fe796a44ddda440290b3fe9a9cf89ca5.tar.gz |
Hash now supports several charsets
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_berkeley.cc | 2 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 2 | ||||
-rw-r--r-- | sql/hash_filo.h | 4 | ||||
-rw-r--r-- | sql/item_func.cc | 3 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 11 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_cache.cc | 4 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 3 | ||||
-rw-r--r-- | sql/sql_select.cc | 6 | ||||
-rw-r--r-- | sql/sql_udf.cc | 3 | ||||
-rw-r--r-- | sql/table.cc | 1 |
14 files changed, 28 insertions, 19 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 614d1b5abf5..58a090a8aed 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -168,7 +168,7 @@ bool berkeley_init(void) db_env=0; /* purecov: inspected */ } - (void) hash_init(&bdb_open_tables,32,0,0, + (void) hash_init(&bdb_open_tables,system_charset_info,32,0,0, (hash_get_key) bdb_get_key,0,0); pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST); DBUG_RETURN(db_env == 0); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index d53b027a415..fd2dcf4dfb6 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -666,7 +666,7 @@ innobase_init(void) DBUG_RETURN(1); } - (void) hash_init(&innobase_open_tables,32,0,0, + (void) hash_init(&innobase_open_tables,system_charset_info,32,0,0, (hash_get_key) innobase_get_key,0,0); pthread_mutex_init(&innobase_mutex,MY_MUTEX_INIT_FAST); DBUG_RETURN(0); diff --git a/sql/hash_filo.h b/sql/hash_filo.h index b8d45f0d3be..4d746d9b9bd 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -75,8 +75,8 @@ public: if (!locked) (void) pthread_mutex_lock(&lock); (void) hash_free(&cache); - (void) hash_init(&cache,size,key_offset, key_length, get_key, free_element, - 0); + (void) hash_init(&cache,system_charset_info,size,key_offset, + key_length, get_key, free_element,0); if (!locked) (void) pthread_mutex_unlock(&lock); first_link=last_link=0; diff --git a/sql/item_func.cc b/sql/item_func.cc index 587388d6159..e25f4c6e94a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1421,7 +1421,8 @@ char *ull_get_key(const ULL *ull,uint *length, void item_user_lock_init(void) { pthread_mutex_init(&LOCK_user_locks,MY_MUTEX_INIT_SLOW); - hash_init(&hash_user_locks,16,0,0,(hash_get_key) ull_get_key,NULL,0); + hash_init(&hash_user_locks,system_charset_info, + 16,0,0,(hash_get_key) ull_get_key,NULL,0); } void item_user_lock_free(void) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 257418d1682..3f16880c18e 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -184,7 +184,7 @@ static void slave_info_free(void *s) void init_slave_list() { - hash_init(&slave_list, SLAVE_LIST_CHUNK, 0, 0, + hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0, (hash_get_key) slave_list_key, slave_info_free, 0); pthread_mutex_init(&LOCK_slave_list, MY_MUTEX_INIT_FAST); } diff --git a/sql/slave.cc b/sql/slave.cc index 9630cf6aa0e..52f04ef8675 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -470,7 +470,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, void init_table_rule_hash(HASH* h, bool* h_inited) { - hash_init(h, TABLE_RULE_HASH_SIZE,0,0, + hash_init(h, system_charset_info,TABLE_RULE_HASH_SIZE,0,0, (hash_get_key) get_table_key, (void (*)(void*)) free_table_ent, 0); *h_inited = 1; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 198569cec3c..32630a9537e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -847,7 +847,7 @@ static void init_check_host(void) DBUG_ENTER("init_check_host"); VOID(init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip), acl_users.elements,1)); - VOID(hash_init(&acl_check_hosts,acl_users.elements,0,0, + VOID(hash_init(&acl_check_hosts,system_charset_info,acl_users.elements,0,0, (hash_get_key) check_get_key,0,HASH_CASE_INSENSITIVE)); if (!allow_all_hosts) { @@ -1424,7 +1424,8 @@ public: key_length =(uint) strlen(d)+(uint) strlen(u)+(uint) strlen(t)+3; hash_key = (char*) alloc_root(&memex,key_length); strmov(strmov(strmov(hash_key,user)+1,db)+1,tname); - (void) hash_init(&hash_columns,0,0,0, (hash_get_key) get_key_column,0, + (void) hash_init(&hash_columns,system_charset_info, + 0,0,0, (hash_get_key) get_key_column,0, HASH_CASE_INSENSITIVE); } @@ -1456,7 +1457,8 @@ public: privs = fix_rights_for_table(privs); cols = fix_rights_for_column(cols); - (void) hash_init(&hash_columns,0,0,0, (hash_get_key) get_key_column,0, + (void) hash_init(&hash_columns,system_charset_info, + 0,0,0, (hash_get_key) get_key_column,0, HASH_CASE_INSENSITIVE); if (cols) { @@ -2143,7 +2145,8 @@ int grant_init (void) DBUG_ENTER("grant_init"); grant_option = FALSE; - (void) hash_init(&hash_tables,0,0,0, (hash_get_key) get_grant_table, + (void) hash_init(&hash_tables,system_charset_info, + 0,0,0, (hash_get_key) get_grant_table, (hash_free_key) free_grant_table,0); init_sql_alloc(&memex,1024,0); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e73a0c63fa6..d2d38d9a7c4 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -50,7 +50,7 @@ static byte *cache_key(const byte *record,uint *length, void table_cache_init(void) { - VOID(hash_init(&open_cache, + VOID(hash_init(&open_cache,system_charset_info, table_cache_size+16,0,0,cache_key, (void (*)(void*)) free_cache_entry,0)); mysql_rm_tmp_tables(); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 72ac20d8818..78d82f9b420 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1330,9 +1330,9 @@ ulong Query_cache::init_cache() DUMP(this); - VOID(hash_init(&queries,def_query_hash_size, 0, 0, + VOID(hash_init(&queries,system_charset_info,def_query_hash_size, 0, 0, query_cache_query_get_key, 0, 0)); - VOID(hash_init(&tables,def_table_hash_size, 0, 0, + VOID(hash_init(&tables,system_charset_info,def_table_hash_size, 0, 0, query_cache_table_get_key, 0, 0)); queries_in_cache = 0; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f6f66b0b7da..d0caa4e7b8c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -137,7 +137,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), /* Initialize sub structures */ bzero((char*) &mem_root,sizeof(mem_root)); user_connect=(UC *)0; - hash_init(&user_vars, USER_VARS_HASH_SIZE, 0, 0, + hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0, (hash_get_key) get_var_key, (void (*)(void*)) free_var,0); #ifdef USING_TRANSACTIONS diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c47d6ddd4bb..7fd3db1fe21 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -269,7 +269,8 @@ static void free_user(struct user_conn *uc) void init_max_user_conn(void) { - (void) hash_init(&hash_user_connections,max_connections,0,0, + (void) hash_init(&hash_user_connections,system_charset_info,max_connections, + 0,0, (hash_get_key) get_key_conn, (void (*)(void*)) free_user, 0); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 14feb12c769..1ea85984bcc 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5874,8 +5874,10 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, (uint) (field_count*sizeof(*field_lengths)), NullS)) DBUG_RETURN(1); - if (hash_init(&hash, (uint) file->records, 0, key_length, - (hash_get_key) 0, 0, 0)) + + // BAR TODO: this must be fixed to use charset from "table" argument + if (hash_init(&hash, default_charset_info, (uint) file->records, 0, + key_length,(hash_get_key) 0, 0, 0)) { my_free((char*) key_buffer,MYF(0)); DBUG_RETURN(1); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 9493f969802..f44fa3b7321 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -127,7 +127,8 @@ void udf_init() init_sql_alloc(&mem, 1024,0); THD *new_thd = new THD; if (!new_thd || - hash_init(&udf_hash,32,0,0,get_hash_key, NULL, HASH_CASE_INSENSITIVE)) + hash_init(&udf_hash,system_charset_info, + 32,0,0,get_hash_key, NULL, HASH_CASE_INSENSITIVE)) { sql_print_error("Can't allocate memory for udf structures"); hash_free(&udf_hash); diff --git a/sql/table.cc b/sql/table.cc index 2fa5d41f1ba..eeda172c65d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -319,6 +319,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, use_hash= outparam->fields >= MAX_FIELDS_BEFORE_HASH; if (use_hash) use_hash= !hash_init(&outparam->name_hash, + system_charset_info, outparam->fields,0,0, (hash_get_key) get_field_name,0, HASH_CASE_INSENSITIVE); |