mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for bug #31236: Inconsistent division by zero behavior for
floating point numbers Some math functions did not check if the result is a valid number (i.e. neither of +-inf or nan). Fixed by validating the result where necessary and returning NULL in case of invalid result.
This commit is contained in:
@ -2263,13 +2263,11 @@ int Field_decimal::store(double nr)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
if (!finite(nr)) // Handle infinity as special case
|
||||
if (!isfinite(nr)) // Handle infinity as special case
|
||||
{
|
||||
overflow(nr < 0.0);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
reg4 uint i;
|
||||
size_t length;
|
||||
|
Reference in New Issue
Block a user