mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Fix for a NAN problem in FORMAT(...) string function ..
This commit is contained in:
parent
5ae3989fe3
commit
0e76eab9d4
3 changed files with 5 additions and 1 deletions
|
@ -10,3 +10,6 @@ inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255")
|
|||
select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
|
||||
inet_ntoa(1099511627775) inet_ntoa(4294902271) inet_ntoa(511)
|
||||
NULL 255.255.1.255 0.0.1.255
|
||||
select format("nan",2);
|
||||
format("nan",2)
|
||||
nan
|
||||
|
|
|
@ -7,3 +7,4 @@ select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555
|
|||
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
|
||||
select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255");
|
||||
select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
|
||||
select format("nan",2);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue