Plan CTEs when subquery pushdown is on

pull/1869/head
Marco Slot 2017-12-17 21:49:36 +01:00
parent 686b079272
commit e3b953b8e3
1 changed files with 11 additions and 11 deletions

View File

@ -140,6 +140,17 @@ RecursivelyPlanSubqueriesAndCTEs(Query *query,
DeferredErrorMessage *error = NULL; DeferredErrorMessage *error = NULL;
RecursivePlanningContext context; RecursivePlanningContext context;
context.level = 0;
context.planId = planId;
context.subPlanList = NIL;
context.plannerRestrictionContext = plannerRestrictionContext;
error = RecursivelyPlanCTEs(query, &context);
if (error != NULL)
{
return error;
}
if (SubqueryPushdown) if (SubqueryPushdown)
{ {
/* /*
@ -155,17 +166,6 @@ RecursivelyPlanSubqueriesAndCTEs(Query *query,
return NULL; return NULL;
} }
context.level = 0;
context.planId = planId;
context.subPlanList = NIL;
context.plannerRestrictionContext = plannerRestrictionContext;
error = RecursivelyPlanCTEs(query, &context);
if (error != NULL)
{
return error;
}
/* XXX: plan subqueries */ /* XXX: plan subqueries */
*subPlanList = context.subPlanList; *subPlanList = context.subPlanList;