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

@ -121,28 +121,8 @@ string Func_sec_to_time::getStrVal(rowgroup::Row& row,
case execplan::CalpontSystemCatalog::DECIMAL:
case execplan::CalpontSystemCatalog::UDECIMAL:
{
const string& valStr = parm[0]->data()->getStrVal(row, isNull);
val = parm[0]->data()->getIntVal(row, isNull);
size_t x = valStr.find(".");
if (x < string::npos)
{
string tmp = valStr.substr(x + 1, 1);
char* ptr = &tmp[0];
int i = atoi(ptr);
if (i >= 5)
{
if (val > 0)
val += 1;
else
val -= 1;
}
}
}
break;
val = parm[0]->data()->getDecimalVal(row, isNull).toSInt64Round();
break;
case execplan::CalpontSystemCatalog::CHAR:
case execplan::CalpontSystemCatalog::VARCHAR: