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

Use of new num->str functions

fix in ucs2 charset
parent 2204f764
......@@ -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