summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <tsmith@quadxeon.mysql.com>2007-06-05 23:06:43 +0200
committerunknown <tsmith@quadxeon.mysql.com>2007-06-05 23:06:43 +0200
commit6d7cd0b2c03a9e59f52622c44ee4342752cf3be9 (patch)
treeeced4706a6c1c5b6c4505025e6737b5210c29080 /strings
parenta31f2ddea214aa1496ba64c6b2737b5251b7d826 (diff)
parentddf48bed99f612ab30069e89e4e94050931e64a9 (diff)
downloadmariadb-git-6d7cd0b2c03a9e59f52622c44ee4342752cf3be9.tar.gz
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51 client/mysqldump.c: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/innodb_mysql.result: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
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 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;