Commit 9ff43be8 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 6cdf5c65
...@@ -3778,9 +3778,11 @@ int Field_string::store(double nr) ...@@ -3778,9 +3778,11 @@ int Field_string::store(double nr)
int Field_string::store(longlong nr) int Field_string::store(longlong nr)
{ {
char buff[22]; char buff[64];
char *end=longlong10_to_str(nr,buff,-10); int l;
return Field_string::store(buff,(uint) (end-buff), default_charset_info); 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) ...@@ -3975,9 +3977,11 @@ int Field_varstring::store(double nr)
int Field_varstring::store(longlong nr) int Field_varstring::store(longlong nr)
{ {
char buff[22]; char buff[64];
char *end=longlong10_to_str(nr,buff,-10); int l;
return Field_varstring::store(buff,(uint) (end-buff), default_charset_info); 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) ...@@ -108,9 +108,7 @@ Item_sum_int::val_str(String *str)
longlong nr=val_int(); longlong nr=val_int();
if (null_value) if (null_value)
return 0; return 0;
char buff[21]; str->set(nr,thd_charset());
uint length= (uint) (longlong10_to_str(nr,buff,-10)-buff);
str->copy(buff,length,thd_charset());
return str; return str;
} }
......
...@@ -3055,8 +3055,8 @@ CHARSET_INFO my_charset_ucs2 = ...@@ -3055,8 +3055,8 @@ CHARSET_INFO my_charset_ucs2 =
my_hash_sort_ucs2, /* hash_sort */ my_hash_sort_ucs2, /* hash_sort */
0, 0,
my_snprintf_ucs2, my_snprintf_ucs2,
my_l10tostr_8bit, my_l10tostr_ucs2,
my_ll10tostr_8bit, my_ll10tostr_ucs2,
my_strntol_ucs2, my_strntol_ucs2,
my_strntoul_ucs2, my_strntoul_ucs2,
my_strntoll_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