Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-21 22:24:31+05:00, holyfoot@hfmain.(none) +3 -0
Merge mysql.com:/home/hf/work/27984/my50-27984
into mysql.com:/home/hf/work/27984/my51-27984
MERGE: 1.1810.2913.10
mysql-test/r/type_newdecimal.result@stripped, 2007-05-21 22:24:29+05:00,
holyfoot@hfmain.(none) +3 -3
merging
MERGE: 1.36.1.11
mysql-test/t/type_newdecimal.test@stripped, 2007-05-21 22:23:21+05:00,
holyfoot@hfmain.(none) +0 -0
Auto merged
MERGE: 1.33.1.12
strings/decimal.c@stripped, 2007-05-21 22:23:21+05:00, holyfoot@hfmain.(none) +0 -0
Auto merged
MERGE: 1.65.1.15
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: holyfoot
# Host: hfmain.(none)
# Root: /home/hf/work/27984/my51-27984/RESYNC
--- 1.56/mysql-test/r/type_newdecimal.result 2007-05-21 22:24:36 +05:00
+++ 1.57/mysql-test/r/type_newdecimal.result 2007-05-21 22:24:36 +05:00
@@ -1475,6 +1475,9 @@ Error 1264 Out of range value for column
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100)
b;
+a b
+0.9999999999999800000000000000 0.9999999999999800000000000000
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
--- 1.50/mysql-test/t/type_newdecimal.test 2007-05-21 22:24:36 +05:00
+++ 1.51/mysql-test/t/type_newdecimal.test 2007-05-21 22:24:36 +05:00
@@ -1159,6 +1159,11 @@ select cast(a as DECIMAL(3,2)), count(*)
UNION select 12.1234
) t group by 1;
+#
+# Bug #27984 Long Decimal Maths produces truncated results
+#
+
+SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100)
b;
--echo End of 5.0 tests
#
--- 1.84/strings/decimal.c 2007-05-21 22:24:36 +05:00
+++ 1.85/strings/decimal.c 2007-05-21 22:24:36 +05:00
@@ -1523,9 +1523,10 @@ decimal_round(decimal_t *from, decimal_t
dec1 *p0= buf0+intg0+max(frac1, frac0);
dec1 *p1= buf1+intg1+max(frac1, frac0);
- to->buf[0]= 0;
while (buf0 < p0)
*(--p1) = *(--p0);
+ if (unlikely(intg1 > intg0))
+ to->buf[0]= 0;
intg0= intg1;
buf0=to->buf;
| Thread |
|---|
| • bk commit into 5.1 tree (holyfoot:1.2519) | holyfoot | 21 May |