summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorholyfoot/hf@hfmain.(none) <>2007-05-21 22:24:31 +0500
committerholyfoot/hf@hfmain.(none) <>2007-05-21 22:24:31 +0500
commit8fcd446b20ecc961bb8c6827835d6e97f6f647f7 (patch)
treee6159e899d8caf84076c1ce4f026423779d94741 /strings/decimal.c
parentc4d3178eca6f9ee91e5f251b8bc40363525f643d (diff)
parent84a572aabf092a799a81e065d79caa88fdf46ef3 (diff)
downloadmariadb-git-8fcd446b20ecc961bb8c6827835d6e97f6f647f7.tar.gz
Merge mysql.com:/home/hf/work/27984/my50-27984
into mysql.com:/home/hf/work/27984/my51-27984
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 0768c8cd4ca..09d535f3f22 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1523,9 +1523,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
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;