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 negative zero hours

Also fix some functions that were not behaving correctly
This commit is contained in:
Andrew Hutchings
2018-04-30 22:08:10 +01:00
parent 3c090647af
commit dfc351b730
10 changed files with 148 additions and 36 deletions

View File

@ -128,10 +128,18 @@ int64_t Func_hour::getIntVal(rowgroup::Row& row,
if (isTime)
{
// If negative, mask so it doesn't turn positive
bool isNeg = false;
int64_t mask = 0;
if ((val >> 40) & 0x800)
mask = 0xfffffffffffff000;
if (!mask && (val >> 63))
{
isNeg = true;
}
val = mask | ((val >> 40) & 0xfff);
if (isNeg)
val*= -1;
}
else
{