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 case

This commit is contained in:
Andrew Hutchings
2018-04-30 10:41:52 +01:00
parent fc05a9c6c2
commit a5f2f80bed
2 changed files with 46 additions and 5 deletions

View File

@ -65,8 +65,6 @@ inline uint64_t simple_case_cmp(Row& row,
case execplan::CalpontSystemCatalog::INT:
case execplan::CalpontSystemCatalog::BIGINT:
case execplan::CalpontSystemCatalog::DATE:
case execplan::CalpontSystemCatalog::DATETIME:
case execplan::CalpontSystemCatalog::TIME:
{
int64_t ev = parm[n]->data()->getIntVal(row, isNull);
@ -87,6 +85,49 @@ inline uint64_t simple_case_cmp(Row& row,
break;
}
case execplan::CalpontSystemCatalog::DATETIME:
{
int64_t ev = parm[n]->data()->getDatetimeIntVal(row, isNull);
if (isNull)
break;
for (i = 1; i <= whereCount; i++)
{
if (ev == parm[i]->data()->getDatetimeIntVal(row, isNull) && !isNull)
{
foundIt = true;
break;
}
else
isNull = false;
}
break;
}
case execplan::CalpontSystemCatalog::TIME:
{
int64_t ev = parm[n]->data()->getTimeIntVal(row, isNull);
if (isNull)
break;
for (i = 1; i <= whereCount; i++)
{
if (ev == parm[i]->data()->getTimeIntVal(row, isNull) && !isNull)
{
foundIt = true;
break;
}
else
isNull = false;
}
break;
}
case execplan::CalpontSystemCatalog::UBIGINT:
case execplan::CalpontSystemCatalog::UINT:
case execplan::CalpontSystemCatalog::UMEDINT:
@ -514,7 +555,7 @@ int64_t Func_simple_case::getTimeIntVal(rowgroup::Row& row,
if (isNull)
return joblist::TIMENULL;
return parm[i + 1]->data()->getTimeIntVal(row, isNull);
return parm[i]->data()->getTimeIntVal(row, isNull);
}
@ -653,7 +694,7 @@ int64_t Func_searched_case::getTimeIntVal(rowgroup::Row& row,
if (isNull)
return joblist::TIMENULL;
return parm[i + 1]->data()->getTimeIntVal(row, isNull);
return parm[i]->data()->getTimeIntVal(row, isNull);
}
} // namespace funcexp