You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Explicit cast of INT_MIN/MAX to double
This commit is contained in:
committed by
Leonid Fedorov
parent
07a7130e2a
commit
c3426dbd69
@ -498,7 +498,9 @@ IDB_Decimal Func_round::getDecimalVal(Row& row, FunctionParm& parm, bool& isNull
|
|||||||
else
|
else
|
||||||
x = ceil(x - 0.5);
|
x = ceil(x - 0.5);
|
||||||
|
|
||||||
decimal.value = static_cast<long>(x <= INT64_MIN ? INT64_MIN : x >= INT64_MAX ? INT64_MAX : int64_t(x));
|
decimal.value = x <= static_cast<double>(INT64_MIN) ? INT64_MIN
|
||||||
|
: x >= static_cast<double>(INT64_MAX) ? INT64_MAX
|
||||||
|
: int64_t(x);
|
||||||
decimal.scale = s;
|
decimal.scale = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,7 +440,9 @@ IDB_Decimal Func_truncate::getDecimalVal(Row& row, FunctionParm& parm, bool& isN
|
|||||||
if (!isNull)
|
if (!isNull)
|
||||||
{
|
{
|
||||||
x *= p;
|
x *= p;
|
||||||
decimal.value = static_cast<long>(x <= INT64_MIN ? INT64_MIN : x >= INT64_MAX ? INT64_MAX : int64_t(x));
|
decimal.value = x <= static_cast<double>(INT64_MIN) ? INT64_MIN
|
||||||
|
: x >= static_cast<double>(INT64_MAX) ? INT64_MAX
|
||||||
|
: int64_t(x);
|
||||||
decimal.scale = s;
|
decimal.scale = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user