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:
@ -408,3 +408,22 @@ a DIV 2
|
||||
0
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
SELECT 1e308 + 1e308;
|
||||
1e308 + 1e308
|
||||
NULL
|
||||
SELECT -1e308 - 1e308;
|
||||
-1e308 - 1e308
|
||||
NULL
|
||||
SELECT 1e300 * 1e300;
|
||||
1e300 * 1e300
|
||||
NULL
|
||||
SELECT 1e300 / 1e-300;
|
||||
1e300 / 1e-300
|
||||
NULL
|
||||
SELECT EXP(750);
|
||||
EXP(750)
|
||||
NULL
|
||||
SELECT POW(10, 309);
|
||||
POW(10, 309)
|
||||
NULL
|
||||
End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user