You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Merge pull request #494 from mariadb-corporation/MCOL-1433
MCOL-1433 Fix several functions for TIME handling
This commit is contained in:
@ -54,6 +54,9 @@ int64_t Func_dayname::getIntVal(rowgroup::Row& row,
|
||||
int64_t val = 0;
|
||||
int32_t dayofweek = 0;
|
||||
|
||||
DateTime aDateTime;
|
||||
Time aTime;
|
||||
|
||||
switch (parm[0]->data()->resultType().colDataType)
|
||||
{
|
||||
case CalpontSystemCatalog::DATE:
|
||||
@ -70,6 +73,17 @@ int64_t Func_dayname::getIntVal(rowgroup::Row& row,
|
||||
day = (uint32_t)((val >> 38) & 0x3f);
|
||||
break;
|
||||
|
||||
// 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);
|
||||
year = (uint32_t)((val >> 48) & 0xffff);
|
||||
month = (uint32_t)((val >> 44) & 0xf);
|
||||
day = (uint32_t)((val >> 38) & 0x3f);
|
||||
break;
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
|
Reference in New Issue
Block a user