You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MCOL-4236 Change ceil(datetime) to return datetime type
This commit is contained in:
@@ -143,37 +143,25 @@ int64_t Func_ceil::getIntVal(Row& row,
|
|||||||
|
|
||||||
case CalpontSystemCatalog::DATE:
|
case CalpontSystemCatalog::DATE:
|
||||||
{
|
{
|
||||||
Date d (parm[0]->data()->getDateIntVal(row, isNull));
|
ret = parm[0]->data()->getDateIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = d.convertToMySQLint();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::DATETIME:
|
case CalpontSystemCatalog::DATETIME:
|
||||||
{
|
{
|
||||||
DateTime dt(parm[0]->data()->getDatetimeIntVal(row, isNull));
|
ret = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = dt.convertToMySQLint();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::TIMESTAMP:
|
case CalpontSystemCatalog::TIMESTAMP:
|
||||||
{
|
{
|
||||||
TimeStamp dt(parm[0]->data()->getTimestampIntVal(row, isNull));
|
ret = parm[0]->data()->getTimestampIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = dt.convertToMySQLint(timeZone());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::TIME:
|
case CalpontSystemCatalog::TIME:
|
||||||
{
|
{
|
||||||
Time dt(parm[0]->data()->getTimeIntVal(row, isNull));
|
ret = parm[0]->data()->getTimeIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = dt.convertToMySQLint();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -248,8 +236,10 @@ uint64_t Func_ceil::getUintVal(Row& row,
|
|||||||
|
|
||||||
case CalpontSystemCatalog::DATE:
|
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));
|
Date d (parm[0]->data()->getDateIntVal(row, isNull));
|
||||||
|
|
||||||
if (!isNull)
|
if (!isNull)
|
||||||
ret = d.convertToMySQLint();
|
ret = d.convertToMySQLint();
|
||||||
}
|
}
|
||||||
@@ -257,28 +247,19 @@ uint64_t Func_ceil::getUintVal(Row& row,
|
|||||||
|
|
||||||
case CalpontSystemCatalog::DATETIME:
|
case CalpontSystemCatalog::DATETIME:
|
||||||
{
|
{
|
||||||
DateTime dt(parm[0]->data()->getDatetimeIntVal(row, isNull));
|
ret = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = dt.convertToMySQLint();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::TIMESTAMP:
|
case CalpontSystemCatalog::TIMESTAMP:
|
||||||
{
|
{
|
||||||
TimeStamp dt(parm[0]->data()->getTimestampIntVal(row, isNull));
|
ret = parm[0]->data()->getTimestampIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = dt.convertToMySQLint(timeZone());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::TIME:
|
case CalpontSystemCatalog::TIME:
|
||||||
{
|
{
|
||||||
Time dt(parm[0]->data()->getTimeIntVal(row, isNull));
|
ret = parm[0]->data()->getTimeIntVal(row, isNull);
|
||||||
|
|
||||||
if (!isNull)
|
|
||||||
ret = dt.convertToMySQLint();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user