diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-03-20 09:50:45 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-03-20 09:50:45 +0100 |
commit | 9ff0c9f730a79d4dab4303163d45c919f612cc37 (patch) | |
tree | da8b8f122ae3133407c424059a67b5a22cfe063d /mysql-test | |
parent | 47f438675b81848700822426b28281cd3158e83b (diff) | |
download | mariadb-git-9ff0c9f730a79d4dab4303163d45c919f612cc37.tar.gz |
MDEV-5858 MySQL Bug#12744991 - DECIMAL_ROUND(X,D) GIVES WRONG RESULTS WHEN D == N*(-9)
don't use mysql-5.6 change.
correct fix: zero-out rounded tail after the number was shifted because
of the carry digit (otherwise the carry digit will be zeroed out too).
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_math.result | 15 | ||||
-rw-r--r-- | mysql-test/t/func_math.test | 9 |
2 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 23a1f1bc4b3..3631af8a22f 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -728,6 +728,21 @@ select (1.175494351E-37 div 1.7976931348623157E+308); Warnings: Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. # +# Bug#12744991 - DECIMAL_ROUND(X,D) GIVES WRONG RESULTS WHEN D == N*(-9) +# +select round(999999999, -9); +round(999999999, -9) +1000000000 +select round(999999999.0, -9); +round(999999999.0, -9) +1000000000 +select round(999999999999999999, -18); +round(999999999999999999, -18) +1000000000000000000 +select round(999999999999999999.0, -18); +round(999999999999999999.0, -18) +1000000000000000000 +# # Bug#12537160 ASSERTION FAILED: # STOP0 <= &TO->BUF[TO->LEN] WITH LARGE NUMBER. # diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 92ef362c32c..2998742dbcc 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -539,6 +539,15 @@ SELECT 1 div null; select (1.175494351E-37 div 1.7976931348623157E+308); --echo # +--echo # Bug#12744991 - DECIMAL_ROUND(X,D) GIVES WRONG RESULTS WHEN D == N*(-9) +--echo # + +select round(999999999, -9); +select round(999999999.0, -9); +select round(999999999999999999, -18); +select round(999999999999999999.0, -18); + +--echo # --echo # Bug#12537160 ASSERTION FAILED: --echo # STOP0 <= &TO->BUF[TO->LEN] WITH LARGE NUMBER. --echo # |