1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-240 Fix NULL handling on empty Having clause

During subquery processing it is possible to have an empty Having
clause. When this happens various tree elements are deleted but the
pointers to those tree elements are not set to NULL. So later on in
processing ExeMgr can crash.
This commit is contained in:
Andrew Hutchings
2016-09-08 19:45:40 +01:00
parent 8364c9da52
commit 6c7a34c5fb

View File

@@ -177,6 +177,7 @@ void ssfInHaving(ParseTree* pt, void* obj)
// not a scalar result
// replace simple scalar filter with simple filters
delete pt->data();
pt->data(NULL);
delete parseTree;
jobInfo->constantFalse = true;
}
@@ -677,6 +678,10 @@ void preprocessHavingClause(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
ParseTree* correlatedFilters = NULL;
havings->walk(getCorrelatedFilters, &correlatedFilters);
trim(havings);
if (havings == NULL)
{
csep->having(NULL);
}
if (correlatedFilters != NULL)
{