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

Fix from_unixtime when used with numeric operator

This commit is contained in:
David Hall
2016-05-06 13:47:26 -05:00
parent 8b22aa01f8
commit 7f1cb2be07

View File

@@ -145,7 +145,18 @@ int64_t Func_from_unixtime::getIntVal(rowgroup::Row& row,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
return getDatetimeIntVal(row, parm, isNull, ct);
DateTime dt = getDateTime(row, parm, isNull);
if (*reinterpret_cast<int64_t*>(&dt) == 0)
{
isNull = true;
return 0;
}
char buf[32]; // actual string guaranteed to be 22
snprintf( buf, 32, "%04d%02d%02d%02d%02d%02",
dt.year, dt.month, dt.day, dt.hour,
dt.minute, dt.second );
return atoll(buf);
// return getDatetimeIntVal(row, parm, isNull, ct);
}
double Func_from_unixtime::getDoubleVal(rowgroup::Row& row,