1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

A join patch for MCOL-4609, MCOL-4610, MCOL-4619, MCOL-4650, MCOL-4651

This patch is fixing the following bugs:

- MCOL-4609 TreeNode::getIntVal() does not round: implicit DECIMAL->INT cast is not MariaDB compatible
- MCOL-4610 TreeNode::getUintVal() looses precision for narrow decimal
- MCOL-4619 TreeNode::getUintVal() does not round: Implicit DECIMAL->UINT conversion is not like in InnoDB
- MCOL-4650 TreeNode::getIntVal() looses precision for narrow decimal
- MCOL-4651 SEC_TO_TIME(hugePositiveDecimal) returns a negative time
This commit is contained in:
Alexander Barkov
2021-03-30 15:08:36 +04:00
parent cf46db946b
commit 30fe666a8f
5 changed files with 233 additions and 50 deletions

View File

@@ -1120,18 +1120,11 @@ int64_t Func_cast_decimal::getIntVal(Row& row,
bool& isNull,
CalpontSystemCatalog::ColType& operationColType)
{
IDB_Decimal decimal = Func_cast_decimal::getDecimalVal(row,
parm,
isNull,
operationColType);
if (decimal.isTSInt128ByPrecision())
{
return static_cast<int64_t>(decimal.getIntegralPart());
}
return (int64_t) decimal.value / helpers::powerOf10_c[decimal.scale];
return decimal.toSInt64Round();
}