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

Merge pull request #1568 from dhall-MariaDB/MCOL-4255-dev

MCOL-4255 dev fix ROUND(datecolumn)
This commit is contained in:
Gagan Goel
2020-11-19 18:19:07 -05:00
committed by GitHub

View File

@ -154,7 +154,18 @@ uint64_t Func_round::getUintVal(Row& row,
bool& isNull,
CalpontSystemCatalog::ColType& op_ct)
{
return parm[0]->data()->getUintVal(row, isNull);
uint64_t x;
if (UNLIKELY(op_ct.colDataType == execplan::CalpontSystemCatalog::DATE))
{
IDB_Decimal d = getDecimalVal(row, parm, isNull, op_ct);
x = static_cast<uint64_t>(d.value);
}
else
{
x = parm[0]->data()->getUintVal(row, isNull);
}
return x;
}
@ -528,15 +539,9 @@ IDB_Decimal Func_round::getDecimalVal(Row& row,
{
s = parm[1]->data()->getIntVal(row, isNull);
if ( s > 11 )
s = 0;
if ( s > 0 )
{
for ( int i = 0 ; i < s ; i++)
{
value = value + "0";
}
s = 0; // Dates don't have digits after int part
}
else
{