Fix for a NAN problem in FORMAT(...) string function ..

This commit is contained in:
unknown 2003-04-14 21:46:24 +03:00
commit 24aba046bf
3 changed files with 5 additions and 1 deletions

View file

@ -1477,7 +1477,7 @@ String *Item_func_format::val_str(String *str)
if (nr < 0)
str_length--; // Don't count sign
length=str->length()+(diff=(str_length- dec-1)/3);
if (diff)
if (diff && diff < 330) // size of buff ...
{
char *tmp,*pos;
str=copy_if_not_alloced(&tmp_str,str,length);