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

MCOL-1402 Fix addtime/subtime

The changes to addtime/subtime for TIME datatype broke the handling of
the adding and subtracting of time. This fixes that.
This commit is contained in:
Andrew Hutchings
2018-05-09 20:34:56 +01:00
parent 24b8c790d5
commit 305bae1bcb
2 changed files with 27 additions and 31 deletions

View File

@ -2769,7 +2769,8 @@ int64_t DataConvert::stringToTime(const string& data)
if (*end != '\0')
return -1;
hour = day * 24;
day = -1;
time = data.substr(pos + 1, data.length() - pos - 1);
}
else
@ -2795,11 +2796,11 @@ int64_t DataConvert::stringToTime(const string& data)
if (pos == string::npos)
{
hour = atoi(hms.c_str());
hour += atoi(hms.c_str());
}
else
{
hour = atoi(hms.substr(0, pos).c_str());
hour += atoi(hms.substr(0, pos).c_str());
ms = hms.substr(pos + 1, hms.length() - pos - 1);
}