Commit 777df295 authored by kaa@polly.(none)'s avatar kaa@polly.(none)

Merge polly.(none):/home/kaa/src/maint/bug26788/my50-bug26788

into  polly.(none):/home/kaa/src/maint/bug26788/my51-bug26788
parents 109c0439 33125cd4
...@@ -6261,6 +6261,7 @@ int Field_str::store(double nr) ...@@ -6261,6 +6261,7 @@ int Field_str::store(double nr)
uint length; uint length;
uint local_char_length= field_length / charset()->mbmaxlen; uint local_char_length= field_length / charset()->mbmaxlen;
double anr= fabs(nr); double anr= fabs(nr);
bool fractional= (anr != floor(anr));
int neg= (nr < 0.0) ? 1 : 0; int neg= (nr < 0.0) ? 1 : 0;
uint max_length; uint max_length;
int exp; int exp;
...@@ -6289,7 +6290,7 @@ int Field_str::store(double nr) ...@@ -6289,7 +6290,7 @@ int Field_str::store(double nr)
calculate the maximum number of significant digits if the 'f'-format calculate the maximum number of significant digits if the 'f'-format
would be used (+1 for decimal point if the number has a fractional part). would be used (+1 for decimal point if the number has a fractional part).
*/ */
digits= max(0, (int) max_length - (nr != trunc(nr))); digits= max(0, (int) max_length - fractional);
/* /*
If the exponent is negative, decrease digits by the number of leading zeros If the exponent is negative, decrease digits by the number of leading zeros
after the decimal point that do not count as significant digits. after the decimal point that do not count as significant digits.
......
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