1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-392 Fix greatest() and least() for time

This commit is contained in:
Andrew Hutchings
2018-04-30 08:08:42 +01:00
parent aae2810d73
commit fc05a9c6c2
2 changed files with 16 additions and 8 deletions

View File

@ -188,16 +188,20 @@ int64_t Func_least::getTimeIntVal(rowgroup::Row& row,
execplan::CalpontSystemCatalog::ColType& op_ct)
{
// Strip off unused day
int64_t str = fp[0]->data()->getTimeIntVal(row, isNull) << 12;
int64_t leastStr = fp[0]->data()->getTimeIntVal(row, isNull);
int64_t leastStr = str;
int64_t str = leastStr << 12;
for (uint32_t i = 1; i < fp.size(); i++)
{
int64_t str1 = fp[i]->data()->getTimeIntVal(row, isNull) << 12;
int64_t str1 = fp[i]->data()->getTimeIntVal(row, isNull);
int64_t str2 = str1 << 12;
if ( leastStr > str1 )
if ( str > str1 )
{
leastStr = str1;
str = str2;
}
}
return leastStr;