mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -248,5 +248,17 @@ INSERT INTO t1 VALUES ('a');
|
||||
SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
# Bug #31236: Inconsistent division by zero behavior for floating point numbers
|
||||
#
|
||||
|
||||
SELECT 1e308 + 1e308;
|
||||
SELECT -1e308 - 1e308;
|
||||
SELECT 1e300 * 1e300;
|
||||
SELECT 1e300 / 1e-300;
|
||||
SELECT EXP(750);
|
||||
SELECT POW(10, 309);
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user