summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2007-05-16 23:01:21 +0500
committerunknown <holyfoot/hf@hfmain.(none)>2007-05-16 23:01:21 +0500
commitf7efc636b131b13880ee78c31ef1c4c93f9c6fcc (patch)
tree17df03511ee07061a062ea2c79293477f35cf0bc /strings/decimal.c
parentac811bf0dd811d3cd296f082ab0a671979b79c1e (diff)
parent1e33cfb36a84b477a468dbcfc1ccc3035a9efb81 (diff)
downloadmariadb-git-f7efc636b131b13880ee78c31ef1c4c93f9c6fcc.tar.gz
Merge mysql.com:/home/hf/work/8663/my50-8663
into mysql.com:/home/hf/work/8663/my51-8663 strings/decimal.c: Auto merged mysql-test/r/bigint.result: SCCS merged mysql-test/t/bigint.test: merging
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index b29017aa6cb..0768c8cd4ca 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1089,7 +1089,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;
}
}