mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
item_func.cc, item_cmpfunc.cc, unireg.cc, table.cc, sql_base.cc:
some default_charset_info were removed sql/sql_base.cc: some default_charset_info were removed sql/table.cc: some default_charset_info were removed sql/unireg.cc: some default_charset_info were removed sql/item_cmpfunc.cc: some default_charset_info were removed sql/item_func.cc: some default_charset_info were removed
This commit is contained in:
parent
fb4ee80cfd
commit
9f6256563c
5 changed files with 12 additions and 13 deletions
|
@ -1114,7 +1114,7 @@ int in_vector::find(Item *item)
|
|||
|
||||
in_string::in_string(uint elements,qsort_cmp 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()
|
||||
|
@ -1137,7 +1137,7 @@ void in_string::set(uint pos,Item *item)
|
|||
{
|
||||
CHARSET_INFO *cs;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1840,7 +1840,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
|||
if (!regex_compiled && args[1]->const_item())
|
||||
{
|
||||
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);
|
||||
if (args[1]->null_value)
|
||||
{ // Will always return NULL
|
||||
|
@ -1870,7 +1870,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
|||
longlong Item_func_regex::val_int()
|
||||
{
|
||||
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);
|
||||
if (args[0]->null_value)
|
||||
|
@ -1881,7 +1881,7 @@ longlong Item_func_regex::val_int()
|
|||
if (!regex_is_const)
|
||||
{
|
||||
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);
|
||||
if (args[1]->null_value)
|
||||
|
|
|
@ -1545,7 +1545,7 @@ String *udf_handler::val_str(String *str,String *save_str)
|
|||
str->length(res_length);
|
||||
return str;
|
||||
}
|
||||
save_str->set(res, res_length, default_charset_info);
|
||||
save_str->set(res, res_length, str->charset());
|
||||
return save_str;
|
||||
}
|
||||
|
||||
|
|
|
@ -2292,8 +2292,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
|
|||
DBUG_ENTER("mysql_create_index");
|
||||
bzero((char*) &create_info,sizeof(create_info));
|
||||
create_info.db_type=DB_TYPE_DEFAULT;
|
||||
/* TODO: Fix to use database character set */
|
||||
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,
|
||||
&create_info, table_list,
|
||||
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)
|
|||
DBUG_ENTER("mysql_drop_index");
|
||||
bzero((char*) &create_info,sizeof(create_info));
|
||||
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,
|
||||
&create_info, table_list,
|
||||
fields, keys, drop, alter, 0, (ORDER*)0, FALSE,
|
||||
|
|
|
@ -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 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);
|
||||
uint length=str.length();
|
||||
if (!length)
|
||||
|
|
|
@ -486,7 +486,7 @@ static bool pack_fields(File file,List<create_field> &create_fields)
|
|||
/* Write intervals */
|
||||
if (int_count)
|
||||
{
|
||||
String tmp((char*) buff,sizeof(buff), default_charset_info);
|
||||
String tmp((char*) buff,sizeof(buff), &my_charset_bin);
|
||||
tmp.length(0);
|
||||
it.rewind();
|
||||
int_count=0;
|
||||
|
@ -598,9 +598,9 @@ static bool make_empty_rec(File file,enum db_type table_type,
|
|||
regfield->store((longlong) 1);
|
||||
}
|
||||
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
|
||||
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
|
||||
regfield->reset();
|
||||
delete regfield;
|
||||
|
|
Loading…
Add table
Reference in a new issue