diff options
author | unknown <gshchepa/uchum@gleb.loc> | 2007-10-08 03:48:59 +0500 |
---|---|---|
committer | unknown <gshchepa/uchum@gleb.loc> | 2007-10-08 03:48:59 +0500 |
commit | 60761a7cc67a358861e4af7863b785adc449b92f (patch) | |
tree | 9ca852e262b3c8f4fa4b9cd92f183fa5aa598ce3 /mysql-test/r/type_decimal.result | |
parent | a408f34866de14649b13dc1e4c08edf40a19db28 (diff) | |
download | mariadb-git-60761a7cc67a358861e4af7863b785adc449b92f.tar.gz |
Fixed bug #31019: the MOD() function and the % operator crash the server
when a divisor is less than 1 and its fractional part is very long.
For example:
1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789;
Stack buffer overflow has been fixed in the do_div_mod function.
strings/decimal.c:
Fixed bug #31019.
Stack buffer overflow has been fixed in the do_div_mod function:
a value of the upper bound of the buffer was increased where
a decrement is required.
mysql-test/t/type_decimal.test:
Added test case for bug #31019.
mysql-test/r/type_decimal.result:
Added test case for bug #31019.
Diffstat (limited to 'mysql-test/r/type_decimal.result')
-rw-r--r-- | mysql-test/r/type_decimal.result | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 3cf24529421..72f827f11ed 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -799,3 +799,9 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; ROUND(qty,3) dps ROUND(qty,dps) 1.133 3 1.133 DROP TABLE t1; +SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%'; +% +0.012345687012345687012345687012345687012345687012345687012345687012345687000000000 +SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()'; +MOD() +0.012345687012345687012345687012345687012345687012345687012345687012345687000000000 |