sql_acl.cc, item.h:
use of new argument sql_analyse.h: macros from mysql_priv.h. Should be deleted soon. mysql_priv.h: _default_charset_info has been removed item_cmpfunc.h: Use cmp_charset hostname.cc, hash_filo.h: Move charset to constructor argument sql/hash_filo.h: Move charset to constructor argument sql/hostname.cc: Move charset to constructor argument sql/item_cmpfunc.h: Use cmp_charset sql/mysql_priv.h: _default_charset_info has been removed sql/sql_analyse.h: macros from mysql_priv.h. Should be deleted soon. sql/item.h: use of new argument sql/sql_acl.cc: use of new argument
This commit is contained in:
parent
8d9d12d182
commit
11da9dede6
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;}
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user