mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 11:45:32 +02: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. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: -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:
parent
ed2e88e66c
commit
c7371c9e75
3 changed files with 32 additions and 6 deletions
|
|
@ -482,4 +482,20 @@ RAND(i)
|
|||
0.155220427694936
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#57477 SIGFPE when dividing a huge number a negative number
|
||||
#
|
||||
SELECT -9999999999999999991 DIV -1;
|
||||
-9999999999999999991 DIV -1
|
||||
-9223372036854775808
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
SELECT -9223372036854775808 DIV -1;
|
||||
-9223372036854775808 DIV -1
|
||||
-9223372036854775808
|
||||
SELECT -9223372036854775808 MOD -1;
|
||||
-9223372036854775808 MOD -1
|
||||
0
|
||||
SELECT -9223372036854775808999 MOD -1;
|
||||
-9223372036854775808999 MOD -1
|
||||
0
|
||||
End of 5.1 tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue