1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-392 Fix negative time handling

This commit is contained in:
Andrew Hutchings
2018-04-26 14:28:17 +01:00
parent 3c1ebd8b94
commit edb2e2f36d
4 changed files with 44 additions and 9 deletions

View File

@ -165,8 +165,13 @@ int64_t Func_bitand::getIntVal(Row& row,
min = 0,
sec = 0,
msec = 0;
// Handle negative correctly
if ((time >> 40) & 0xf00)
{
hour = 0xfffff000;
}
hour = (uint32_t)((time >> 40) & 0xfff);
hour |= ((time >> 40) & 0xfff);
min = (uint32_t)((time >> 32) & 0xff);
sec = (uint32_t)((time >> 24) & 0xff);
msec = (uint32_t)(time & 0xffffff);