1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Merge branch 'MCOL-3435' into MCOL-3492

This commit is contained in:
David Hall
2019-09-12 09:58:30 -05:00

View File

@@ -514,11 +514,24 @@ void WindowFunctionStep::checkWindowFunction(CalpontSelectExecutionPlan* csep, J
// no group by by inserting a group by for window parameters.
if (hasAggregation)
{
uint32_t tupleKey = getTupleKey(jobInfo, *j, true);
if (find(jobInfo.groupByColVec.begin(), jobInfo.groupByColVec.end(), tupleKey)
== jobInfo.groupByColVec.end())
// If an argument is an AggregateColumn, don't group by it.
if (dynamic_cast<AggregateColumn*>(j->get()) == NULL)
{
jobInfo.groupByColVec.push_back(tupleKey);
bool bFound = false;
for (std::vector<SRCP>::iterator igpc = csep->groupByCols().begin();
igpc < csep->groupByCols().end();
++igpc)
{
if (*igpc->get() == *j->get())
{
bFound = true;
break;
}
}
if (!bFound)
{
csep->groupByCols().push_back(*j);
}
}
}
}