Commit 391b3ec6 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

item_func.cc, item_cmpfunc.cc, unireg.cc, table.cc, sql_base.cc:

  some default_charset_info were removed
parent 9994e625
...@@ -1114,7 +1114,7 @@ int in_vector::find(Item *item) ...@@ -1114,7 +1114,7 @@ int in_vector::find(Item *item)
in_string::in_string(uint elements,qsort_cmp cmp_func) in_string::in_string(uint elements,qsort_cmp cmp_func)
:in_vector(elements, sizeof(String), cmp_func), :in_vector(elements, sizeof(String), cmp_func),
tmp(buff, sizeof(buff), default_charset_info) tmp(buff, sizeof(buff), &my_charset_bin)
{} {}
in_string::~in_string() in_string::~in_string()
...@@ -1137,7 +1137,7 @@ void in_string::set(uint pos,Item *item) ...@@ -1137,7 +1137,7 @@ void in_string::set(uint pos,Item *item)
{ {
CHARSET_INFO *cs; CHARSET_INFO *cs;
if (!(cs= item->charset())) if (!(cs= item->charset()))
cs= default_charset_info; // Should never happen for STR items cs= &my_charset_bin; // Should never happen for STR items
str->set_charset(cs); str->set_charset(cs);
} }
} }
...@@ -1840,7 +1840,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -1840,7 +1840,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
if (!regex_compiled && args[1]->const_item()) if (!regex_compiled && args[1]->const_item())
{ {
char buff[MAX_FIELD_WIDTH]; char buff[MAX_FIELD_WIDTH];
String tmp(buff,sizeof(buff),default_charset_info); String tmp(buff,sizeof(buff),&my_charset_bin);
String *res=args[1]->val_str(&tmp); String *res=args[1]->val_str(&tmp);
if (args[1]->null_value) if (args[1]->null_value)
{ // Will always return NULL { // Will always return NULL
...@@ -1870,7 +1870,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -1870,7 +1870,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
longlong Item_func_regex::val_int() longlong Item_func_regex::val_int()
{ {
char buff[MAX_FIELD_WIDTH]; char buff[MAX_FIELD_WIDTH];
String *res, tmp(buff,sizeof(buff),default_charset_info); String *res, tmp(buff,sizeof(buff),&my_charset_bin);
res=args[0]->val_str(&tmp); res=args[0]->val_str(&tmp);
if (args[0]->null_value) if (args[0]->null_value)
...@@ -1881,7 +1881,7 @@ longlong Item_func_regex::val_int() ...@@ -1881,7 +1881,7 @@ longlong Item_func_regex::val_int()
if (!regex_is_const) if (!regex_is_const)
{ {
char buff2[MAX_FIELD_WIDTH]; char buff2[MAX_FIELD_WIDTH];
String *res2, tmp2(buff2,sizeof(buff2),default_charset_info); String *res2, tmp2(buff2,sizeof(buff2),&my_charset_bin);
res2= args[1]->val_str(&tmp2); res2= args[1]->val_str(&tmp2);
if (args[1]->null_value) if (args[1]->null_value)
......
...@@ -1545,7 +1545,7 @@ String *udf_handler::val_str(String *str,String *save_str) ...@@ -1545,7 +1545,7 @@ String *udf_handler::val_str(String *str,String *save_str)
str->length(res_length); str->length(res_length);
return str; return str;
} }
save_str->set(res, res_length, default_charset_info); save_str->set(res, res_length, str->charset());
return save_str; return save_str;
} }
......
...@@ -2292,8 +2292,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys) ...@@ -2292,8 +2292,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
DBUG_ENTER("mysql_create_index"); DBUG_ENTER("mysql_create_index");
bzero((char*) &create_info,sizeof(create_info)); bzero((char*) &create_info,sizeof(create_info));
create_info.db_type=DB_TYPE_DEFAULT; create_info.db_type=DB_TYPE_DEFAULT;
/* TODO: Fix to use database character set */ create_info.table_charset= thd->db_charset;
create_info.table_charset=default_charset_info;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name,
&create_info, table_list, &create_info, table_list,
fields, keys, drop, alter, 0, (ORDER*)0, FALSE, fields, keys, drop, alter, 0, (ORDER*)0, FALSE,
...@@ -2310,7 +2309,7 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop) ...@@ -2310,7 +2309,7 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop)
DBUG_ENTER("mysql_drop_index"); DBUG_ENTER("mysql_drop_index");
bzero((char*) &create_info,sizeof(create_info)); bzero((char*) &create_info,sizeof(create_info));
create_info.db_type=DB_TYPE_DEFAULT; create_info.db_type=DB_TYPE_DEFAULT;
create_info.table_charset=default_charset_info; create_info.table_charset= thd->db_charset;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name,
&create_info, table_list, &create_info, table_list,
fields, keys, drop, alter, 0, (ORDER*)0, FALSE, fields, keys, drop, alter, 0, (ORDER*)0, FALSE,
......
...@@ -1162,7 +1162,7 @@ rename_file_ext(const char * from,const char * to,const char * ext) ...@@ -1162,7 +1162,7 @@ rename_file_ext(const char * from,const char * to,const char * ext)
char *get_field(MEM_ROOT *mem, Field *field) char *get_field(MEM_ROOT *mem, Field *field)
{ {
char buff[MAX_FIELD_WIDTH]; char buff[MAX_FIELD_WIDTH];
String str(buff,sizeof(buff),default_charset_info); String str(buff,sizeof(buff),&my_charset_bin);
field->val_str(&str,&str); field->val_str(&str,&str);
uint length=str.length(); uint length=str.length();
if (!length) if (!length)
......
...@@ -486,7 +486,7 @@ static bool pack_fields(File file,List<create_field> &create_fields) ...@@ -486,7 +486,7 @@ static bool pack_fields(File file,List<create_field> &create_fields)
/* Write intervals */ /* Write intervals */
if (int_count) if (int_count)
{ {
String tmp((char*) buff,sizeof(buff), default_charset_info); String tmp((char*) buff,sizeof(buff), &my_charset_bin);
tmp.length(0); tmp.length(0);
it.rewind(); it.rewind();
int_count=0; int_count=0;
...@@ -598,9 +598,9 @@ static bool make_empty_rec(File file,enum db_type table_type, ...@@ -598,9 +598,9 @@ static bool make_empty_rec(File file,enum db_type table_type,
regfield->store((longlong) 1); regfield->store((longlong) 1);
} }
else if (type == Field::YES) // Old unireg type else if (type == Field::YES) // Old unireg type
regfield->store(ER(ER_YES),(uint) strlen(ER(ER_YES)),default_charset_info); regfield->store(ER(ER_YES),(uint) strlen(ER(ER_YES)),system_charset_info);
else if (type == Field::NO) // Old unireg type else if (type == Field::NO) // Old unireg type
regfield->store(ER(ER_NO), (uint) strlen(ER(ER_NO)),default_charset_info); regfield->store(ER(ER_NO), (uint) strlen(ER(ER_NO)),system_charset_info);
else else
regfield->reset(); regfield->reset();
delete regfield; delete regfield;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment