1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-02 17:46:37 +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

@ -721,16 +721,7 @@ inline int64_t TreeNode::getIntVal()
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL:
{
if (fResultType.colWidth == datatypes::MAXDECIMALWIDTH)
{
return static_cast<int64_t>(fResult.decimalVal.getIntegralPart());
}
else
{
return (int64_t)(fResult.decimalVal.value / pow((double)10, fResult.decimalVal.scale));
}
}
return fResult.decimalVal.toSInt64Round();
case CalpontSystemCatalog::DATE:
case CalpontSystemCatalog::DATETIME:
@ -775,16 +766,7 @@ inline uint64_t TreeNode::getUintVal()
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL:
{
if (fResultType.colWidth == datatypes::MAXDECIMALWIDTH)
{
return static_cast<uint64_t>(fResult.decimalVal.getIntegralPart());
}
else
{
return (uint64_t)(fResult.decimalVal.value / pow((double)10, fResult.decimalVal.scale));
}
}
return fResult.decimalVal.toUInt64Round();
case CalpontSystemCatalog::DATE:
case CalpontSystemCatalog::DATETIME: