1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-1433 Fix some functions for TIME

Fixes the following:

* CAST() (as DATE/DATETIME)
* DATE()
* DATE_FORMAT()
* MAKEDATE()
* NULLIF()
* TIMEDIFF()
* TO_DAYS() / DATEDIFF()
This commit is contained in:
Andrew Hutchings
2018-07-12 15:13:43 +01:00
parent 1fa2537575
commit fb8aab959d
7 changed files with 134 additions and 1 deletions

View File

@ -91,6 +91,10 @@ int64_t Func_to_days::getIntVal(rowgroup::Row& row,
int64_t val;
aDateTime = static_cast<DateTime>(nowDatetime());
aTime = parm[0]->data()->getTimeIntVal(row, isNull);
aDateTime.hour = 0;
aDateTime.minute = 0;
aDateTime.second = 0;
aDateTime.msecond = 0;
aTime.day = 0;
val = addTime(aDateTime, aTime);
year = (uint32_t)((val >> 48) & 0xffff);