1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-392 Fix time_to_sec() for negative time

This commit is contained in:
Andrew Hutchings
2018-05-01 07:25:25 +01:00
parent dfc351b730
commit 4ef4286022

View File

@ -161,7 +161,15 @@ int64_t Func_time_to_sec::getIntVal(rowgroup::Row& row,
return -1;
}
int64_t rtn = (int64_t)(hour * 60 * 60) + (min * 60) + sec;
int64_t rtn;
if (hour < 0)
{
rtn = (int64_t)(hour * 60 * 60) - (min * 60) - sec;
}
else
{
rtn = (int64_t)(hour * 60 * 60) + (min * 60) + sec;
}
if (bIsNegative)
{