mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#57477 SIGFPE when dividing a huge number a negative number
The problem is dividing by const value when the result is out of supported range. The fix: -return LONGLONG_MIN if the result is out of supported range for DIV operator. -return 0 if divisor is -1 for MOD operator.
This commit is contained in:
@@ -308,5 +308,11 @@ SELECT RAND(i) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#57477 SIGFPE when dividing a huge number a negative number
|
||||
--echo #
|
||||
SELECT -9999999999999999991 DIV -1;
|
||||
SELECT -9223372036854775808 DIV -1;
|
||||
SELECT -9223372036854775808 MOD -1;
|
||||
SELECT -9223372036854775808999 MOD -1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
Reference in New Issue
Block a user