summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authoribabaev@bk-internal.mysql.com <>2007-05-28 00:05:38 +0200
committeribabaev@bk-internal.mysql.com <>2007-05-28 00:05:38 +0200
commit040e46fc1c3d9d6c4dba1f652bc26ffbd0af64be (patch)
tree88e9d6e9af319de1b0c833c9bb011ed5025ac543 /strings
parentd542298098864075d3a0c8c0a68c7dc47fe771b9 (diff)
parentbed482c2f98d15c8d7963e2f3c6e4d1e8f8485e0 (diff)
downloadmariadb-git-040e46fc1c3d9d6c4dba1f652bc26ffbd0af64be.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into bk-internal.mysql.com:/data0/bk/mysql-5.0-opt
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 1ae75167794..f1f02f3a071 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1517,9 +1517,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;