summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorunknown <ibabaev@bk-internal.mysql.com>2007-06-01 06:33:37 +0200
committerunknown <ibabaev@bk-internal.mysql.com>2007-06-01 06:33:37 +0200
commit81ffede7fc31c092e618469d961600d70831c863 (patch)
treeb88163902b6698fd82cc842101cfa02e2bf660dd /strings/decimal.c
parentc6ff8a6500f6e3e08d01fcf0687f6987e5adefa6 (diff)
parent5d5c66fb66f2c587ce270b624c39662763fa7417 (diff)
downloadmariadb-git-81ffede7fc31c092e618469d961600d70831c863.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-opt client/mysqldump.c: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/field_conv.cc: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/my_decimal.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged strings/decimal.c: Auto merged sql/sql_update.cc: Manual merge
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 ac82e7b16d6..f1753c619d1 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;