1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4236 Change ceil(datetime) to return datetime type

This commit is contained in:
David Hall
2020-08-19 14:29:06 -05:00
parent fd0ef267b5
commit 6075aa337c

View File

@ -143,37 +143,25 @@ int64_t Func_ceil::getIntVal(Row& row,
case CalpontSystemCatalog::DATE:
{
Date d (parm[0]->data()->getDateIntVal(row, isNull));
if (!isNull)
ret = d.convertToMySQLint();
ret = parm[0]->data()->getDateIntVal(row, isNull);
}
break;
case CalpontSystemCatalog::DATETIME:
{
DateTime dt(parm[0]->data()->getDatetimeIntVal(row, isNull));
if (!isNull)
ret = dt.convertToMySQLint();
ret = parm[0]->data()->getDatetimeIntVal(row, isNull);
}
break;
case CalpontSystemCatalog::TIMESTAMP:
{
TimeStamp dt(parm[0]->data()->getTimestampIntVal(row, isNull));
if (!isNull)
ret = dt.convertToMySQLint(timeZone());
ret = parm[0]->data()->getTimestampIntVal(row, isNull);
}
break;
case CalpontSystemCatalog::TIME:
{
Time dt(parm[0]->data()->getTimeIntVal(row, isNull));
if (!isNull)
ret = dt.convertToMySQLint();
ret = parm[0]->data()->getTimeIntVal(row, isNull);
}
break;
@ -248,8 +236,10 @@ uint64_t Func_ceil::getUintVal(Row& row,
case CalpontSystemCatalog::DATE:
{
// For some reason, MDB doesn't return this as a date,
// but datetime is returned as a datetime. Expect
// this to change in the future.
Date d (parm[0]->data()->getDateIntVal(row, isNull));
if (!isNull)
ret = d.convertToMySQLint();
}
@ -257,28 +247,19 @@ uint64_t Func_ceil::getUintVal(Row& row,
case CalpontSystemCatalog::DATETIME:
{
DateTime dt(parm[0]->data()->getDatetimeIntVal(row, isNull));
if (!isNull)
ret = dt.convertToMySQLint();
ret = parm[0]->data()->getDatetimeIntVal(row, isNull);
}
break;
case CalpontSystemCatalog::TIMESTAMP:
{
TimeStamp dt(parm[0]->data()->getTimestampIntVal(row, isNull));
if (!isNull)
ret = dt.convertToMySQLint(timeZone());
ret = parm[0]->data()->getTimestampIntVal(row, isNull);
}
break;
case CalpontSystemCatalog::TIME:
{
Time dt(parm[0]->data()->getTimeIntVal(row, isNull));
if (!isNull)
ret = dt.convertToMySQLint();
ret = parm[0]->data()->getTimeIntVal(row, isNull);
}
break;