1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-2149 Fix cpimport decimal saturation

If we saturate int64_t during string -> decimal conversion then end
processing there instead of continuing. This preserves a good saturation
value.
This commit is contained in:
Andrew Hutchings
2019-02-08 17:55:50 +00:00
parent c5a3902bb2
commit f805478eb9

View File

@ -188,10 +188,17 @@ long long Convertor::convertDecimalString(
dval *= 10; dval *= 10;
// range check against int64 // range check against int64
if (dval > LLONG_MAX || dval < LLONG_MIN) if (dval > LLONG_MAX)
{
errno = ERANGE; errno = ERANGE;
else return LLONG_MAX;
errno = 0; }
if (dval < LLONG_MIN)
{
errno = ERANGE;
return LLONG_MIN;
}
errno = 0;
ret = dval; ret = dval;