mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed the build failure on Windows. It does not have trunc() defined in math.h, so we should not use it code.
This commit is contained in:
@ -5909,6 +5909,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;
|
||||||
@ -5937,7 +5938,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.
|
||||||
|
Reference in New Issue
Block a user