summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <tsmith@quadxeon.mysql.com>2007-05-21 20:50:08 +0200
committerunknown <tsmith@quadxeon.mysql.com>2007-05-21 20:50:08 +0200
commit221e23ad721cb98156ff313d6ee924c88765782e (patch)
tree250875cd3699ebe9837bdd77ab3f2b35ff4eb6e0 /strings
parentf40047df9c72d1516d9a2f7d121dc7ce165ef419 (diff)
parent8b33c41554b1f9ac173a047f55fa0c522f28af35 (diff)
downloadmariadb-git-221e23ad721cb98156ff313d6ee924c88765782e.tar.gz
Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/50 configure.in: Auto merged mysql-test/r/strict.result: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/t/type_datetime.test: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 65db68b1b59..1ae75167794 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1083,7 +1083,11 @@ int decimal2longlong(decimal_t *from, longlong *to)
x=x*DIG_BASE - *buf++;
if (unlikely(y < (LONGLONG_MIN/DIG_BASE) || x > y))
{
- *to= from->sign ? y : -y;
+ /*
+ the decimal is bigger than any possible integer
+ return border integer depending on the sign
+ */
+ *to= from->sign ? LONGLONG_MIN : LONGLONG_MAX;
return E_DEC_OVERFLOW;
}
}