summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/hash_filo.h9
-rw-r--r--sql/hostname.cc3
-rw-r--r--sql/item.h9
-rw-r--r--sql/item_cmpfunc.h2
-rw-r--r--sql/mysql_priv.h1
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_analyse.h2
7 files changed, 17 insertions, 11 deletions
diff --git a/sql/hash_filo.h b/sql/hash_filo.h
index f7384cc6e32..92cd2658967 100644
--- a/sql/hash_filo.h
+++ b/sql/hash_filo.h
@@ -42,6 +42,7 @@ class hash_filo
const hash_get_key get_key;
hash_free_key free_element;
bool init;
+ CHARSET_INFO *hash_charset;
hash_filo_element *first_link,*last_link;
public:
@@ -49,9 +50,11 @@ public:
HASH cache;
hash_filo(uint size_arg, uint key_offset_arg , uint key_length_arg,
- hash_get_key get_key_arg, hash_free_key free_element_arg)
+ hash_get_key get_key_arg, hash_free_key free_element_arg,
+ CHARSET_INFO *hash_charset_arg)
:size(size_arg), key_offset(key_offset_arg), key_length(key_length_arg),
- get_key(get_key_arg), free_element(free_element_arg),init(0)
+ get_key(get_key_arg), free_element(free_element_arg),init(0),
+ hash_charset(hash_charset_arg)
{
bzero((char*) &cache,sizeof(cache));
}
@@ -75,7 +78,7 @@ public:
if (!locked)
(void) pthread_mutex_lock(&lock);
(void) hash_free(&cache);
- (void) hash_init(&cache,system_charset_info,size,key_offset,
+ (void) hash_init(&cache,hash_charset,size,key_offset,
key_length, get_key, free_element,0);
if (!locked)
(void) pthread_mutex_unlock(&lock);
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 2905320cc15..5c4bde99256 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -65,7 +65,8 @@ bool hostname_cache_init()
if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE, offset,
sizeof(struct in_addr),NULL,
- (hash_free_key) free)))
+ (hash_free_key) free,
+ &my_charset_latin1)))
return 1;
hostname_cache->clear();
return 0;
diff --git a/sql/item.h b/sql/item.h
index e262a9cb4e6..cc4e9a5909b 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -393,8 +393,7 @@ public:
bool eq(const Item *item, bool binary_cmp) const;
Item *new_item()
{
- return new Item_string(name, str_value.ptr(), max_length,
- default_charset_info);
+ return new Item_string(name, str_value.ptr(), max_length, &my_charset_bin);
}
String *const_string() { return &str_value; }
inline void append(char *str, uint length) { str_value.append(str, length); }
@@ -406,7 +405,8 @@ public:
class Item_datetime :public Item_string
{
public:
- Item_datetime(const char *item_name): Item_string(item_name,"",0,default_charset_info)
+ Item_datetime(const char *item_name): Item_string(item_name,"",0,
+ &my_charset_bin)
{ max_length=19;}
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; }
};
@@ -414,7 +414,8 @@ public:
class Item_empty_string :public Item_string
{
public:
- Item_empty_string(const char *header,uint length) :Item_string("",0,default_charset_info)
+ Item_empty_string(const char *header,uint length) :Item_string("",0,
+ &my_charset_bin)
{ name=(char*) header; max_length=length;}
};
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index cc0ce455019..b9d8615beb4 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -482,7 +482,7 @@ public:
int cmp(Item *arg)
{
char buff[80];
- String tmp(buff, sizeof(buff), default_charset_info), *res;
+ String tmp(buff, sizeof(buff), cmp_charset), *res;
if (!(res= arg->val_str(&tmp)))
return 1; /* Can't be right */
return sortcmp(value_res, res, cmp_charset);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 5bf7e6e6951..09eddf161fe 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -62,7 +62,6 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#endif
#endif
-#define my_thd_charset default_charset_info
#define files_charset_info system_charset_info
/***************************************************************************
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 41b825e3322..fe443f6c882 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -97,7 +97,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
if (!acl_cache)
acl_cache=new hash_filo(ACL_CACHE_SIZE,0,0,
(hash_get_key) acl_entry_get_key,
- (hash_free_key) free);
+ (hash_free_key) free, system_charset_info);
if (dont_read_acl_tables)
{
DBUG_RETURN(0); /* purecov: tested */
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index d40811a2911..2087e6b2b75 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -21,6 +21,8 @@
#pragma interface /* gcc class implementation */
#endif
+#define my_thd_charset default_charset_info
+
#define DEC_IN_AVG 4
typedef struct st_number_info