Commit 6283caca authored by unknown's avatar unknown

Use of new num->str functions

fix in ucs2 charset


sql/field.cc:
  Use of new num->str functions
sql/item_sum.cc:
  Use of new num->str functions
strings/ctype-utf8.c:
  Fix
parent cf89b487
......@@ -3778,9 +3778,11 @@ int Field_string::store(double nr)
int Field_string::store(longlong nr)
{
char buff[22];
char *end=longlong10_to_str(nr,buff,-10);
return Field_string::store(buff,(uint) (end-buff), default_charset_info);
char buff[64];
int l;
CHARSET_INFO *cs=charset();
l=cs->ll10tostr(cs,buff,sizeof(buff),-10,nr);
return Field_string::store(buff,(uint)l,cs);
}
......@@ -3975,9 +3977,11 @@ int Field_varstring::store(double nr)
int Field_varstring::store(longlong nr)
{
char buff[22];
char *end=longlong10_to_str(nr,buff,-10);
return Field_varstring::store(buff,(uint) (end-buff), default_charset_info);
char buff[64];
int l;
CHARSET_INFO *cs=charset();
l=cs->ll10tostr(cs,buff,sizeof(buff),-10,nr);
return Field_varstring::store(buff,(uint)l,cs);
}
......
......@@ -108,9 +108,7 @@ Item_sum_int::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
char buff[21];
uint length= (uint) (longlong10_to_str(nr,buff,-10)-buff);
str->copy(buff,length,thd_charset());
str->set(nr,thd_charset());
return str;
}
......
......@@ -3055,8 +3055,8 @@ CHARSET_INFO my_charset_ucs2 =
my_hash_sort_ucs2, /* hash_sort */
0,
my_snprintf_ucs2,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_l10tostr_ucs2,
my_ll10tostr_ucs2,
my_strntol_ucs2,
my_strntoul_ucs2,
my_strntoll_ucs2,
......
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