1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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).
This commit is contained in:
Sergei Golubchik
2014-03-20 09:50:45 +01:00
parent 47f438675b
commit 9ff0c9f730
3 changed files with 43 additions and 18 deletions

View File

@@ -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.
#