diff options
author | unknown <holyfoot/hf@hfmain.(none)> | 2007-05-16 23:01:21 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@hfmain.(none)> | 2007-05-16 23:01:21 +0500 |
commit | f7efc636b131b13880ee78c31ef1c4c93f9c6fcc (patch) | |
tree | 17df03511ee07061a062ea2c79293477f35cf0bc /strings/decimal.c | |
parent | ac811bf0dd811d3cd296f082ab0a671979b79c1e (diff) | |
parent | 1e33cfb36a84b477a468dbcfc1ccc3035a9efb81 (diff) | |
download | mariadb-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.c | 6 |
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; } } |