summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_math.result
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2010-10-27 18:12:10 +0400
committerSergey Glukhov <sergey.glukhov@oracle.com>2010-10-27 18:12:10 +0400
commit5bf148fccdc1a05ae044757262d6db3beb2d80e8 (patch)
tree24d6a3ebdae432176a50d877a61191eed2d15537 /mysql-test/r/func_math.result
parentc163b89247cd8c985c07ff7d824bfdc861b63d9c (diff)
downloadmariadb-git-5bf148fccdc1a05ae044757262d6db3beb2d80e8.tar.gz
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.
Diffstat (limited to 'mysql-test/r/func_math.result')
-rw-r--r--mysql-test/r/func_math.result16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index fd7ef72409e..649232e0b05 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -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