diff options
author | unknown <gunnar@mysql.com.> | 2006-02-07 13:26:35 +0100 |
---|---|---|
committer | unknown <gunnar@mysql.com.> | 2006-02-07 13:26:35 +0100 |
commit | c9bb7e1f0271b8e3866d8f84964501fd624612fe (patch) | |
tree | 8730bdd3f7f12b0bf11d3a61e393a2f84b650dd3 /mysql-test/r/func_math.result | |
parent | 26a81f6fb1dc253e9d0ed99768594ac27dae5bb3 (diff) | |
download | mariadb-git-c9bb7e1f0271b8e3866d8f84964501fd624612fe.tar.gz |
item_func.cc:
fix for bug#8461
BUG 8461 - TRUNCATE returns incorrect result if 2nd argument is negative
Reason: Both TRUNCATE/ROUND converts INTEGERS to DOUBLE and back to INTEGERS
Changed the integer routine to work on integers only.
This bug affects 4.1, 5.0 and 5.1
Fixing in 4.1 will need to change the routine to handle different types individually.
5.0 did had different routines for different types already just the INTEGER routine was bad.
sql/item_func.cc:
fix for bug#8461
BUG 8461 - TRUNCATE returns incorrect result if 2nd argument is negative
Reason: TRUNCATE converts INTEGERS to DOUBLE and back to INTEGERS
Both ROUND and TRUNCATE are affected by this.
Changed the integer routine to work on integers only.
This bug affects 4.1 5,0 and 5
Fixing in 4.1 will need to change the routine to handle different types individually.
Diffstat (limited to 'mysql-test/r/func_math.result')
-rw-r--r-- | mysql-test/r/func_math.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index fba274b9bb1..1507f959ae6 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -203,3 +203,18 @@ NULL Warnings: Error 1365 Division by 0 set sql_mode=''; +select round(111,-10); +round(111,-10) +0 +select round(-5000111000111000155,-1); +round(-5000111000111000155,-1) +-5000111000111000160 +select round(15000111000111000155,-1); +round(15000111000111000155,-1) +15000111000111000160 +select truncate(-5000111000111000155,-1); +truncate(-5000111000111000155,-1) +-5000111000111000150 +select truncate(15000111000111000155,-1); +truncate(15000111000111000155,-1) +15000111000111000150 |