mirror of https://github.com/citusdata/citus.git
Merge pull request #2444 from citusdata/memory_fix_attempt
Attempt to address planner context crashespull/2446/head
commit
3a97988ada
|
@ -157,6 +157,10 @@ distributed_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
|
|||
|
||||
result = CreateDistributedPlannedStmt(planId, result, originalQuery, parse,
|
||||
boundParams, plannerRestrictionContext);
|
||||
|
||||
setPartitionedTablesInherited = true;
|
||||
AdjustPartitioningForDistributedPlanning(parse,
|
||||
setPartitionedTablesInherited);
|
||||
}
|
||||
}
|
||||
PG_CATCH();
|
||||
|
@ -166,13 +170,6 @@ distributed_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
|
|||
}
|
||||
PG_END_TRY();
|
||||
|
||||
if (needsDistributedPlanning)
|
||||
{
|
||||
setPartitionedTablesInherited = true;
|
||||
|
||||
AdjustPartitioningForDistributedPlanning(parse, setPartitionedTablesInherited);
|
||||
}
|
||||
|
||||
/* remove the context from the context list */
|
||||
PopPlannerRestrictionContext();
|
||||
|
||||
|
@ -1517,6 +1514,13 @@ CurrentPlannerRestrictionContext(void)
|
|||
plannerRestrictionContext =
|
||||
(PlannerRestrictionContext *) linitial(plannerRestrictionContextList);
|
||||
|
||||
if (plannerRestrictionContext == NULL)
|
||||
{
|
||||
ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
|
||||
errmsg("planner restriction context stack was empty"),
|
||||
errdetail("Please report this to the Citus core team.")));
|
||||
}
|
||||
|
||||
return plannerRestrictionContext;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue