1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Merge pull request #494 from mariadb-corporation/MCOL-1433

MCOL-1433 Fix several functions for TIME handling
This commit is contained in:
David.Hall
2018-06-11 10:20:49 -05:00
committed by GitHub
18 changed files with 380 additions and 174 deletions

View File

@@ -77,6 +77,8 @@ int64_t Func_monthname::getIntVal(rowgroup::Row& row,
CalpontSystemCatalog::ColType& op_ct)
{
int64_t val = 0;
DateTime aDateTime;
Time aTime;
switch (parm[0]->data()->resultType().colDataType)
{
@@ -88,6 +90,16 @@ int64_t Func_monthname::getIntVal(rowgroup::Row& row,
val = parm[0]->data()->getIntVal(row, isNull);
return (unsigned)((val >> 44) & 0xf);
// Time adds to now() and then gets value
case CalpontSystemCatalog::TIME:
aDateTime = static_cast<DateTime>(nowDatetime());
aTime = parm[0]->data()->getTimeIntVal(row, isNull);
aTime.day = 0;
val = addTime(aDateTime, aTime);
return (unsigned)((val >> 44) & 0xf);
break;
case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::TEXT:
case CalpontSystemCatalog::VARCHAR: