mirror of https://github.com/citusdata/citus.git
Merge pull request #332 from citusdata/bugfix/memory_context_leak
Remove unnecessary memory context switch on the plannerpull/336/head
commit
a55287411b
|
@ -52,19 +52,10 @@ multi_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
|
|||
|
||||
if (NeedsDistributedPlanning(parse))
|
||||
{
|
||||
MemoryContext oldcontext = NULL;
|
||||
MultiPlan *physicalPlan = NULL;
|
||||
|
||||
/* Switch to top level message context */
|
||||
oldcontext = MemoryContextSwitchTo(MessageContext);
|
||||
|
||||
physicalPlan = CreatePhysicalPlan(parse);
|
||||
MultiPlan *physicalPlan = CreatePhysicalPlan(parse);
|
||||
|
||||
/* store required data into the planned statement */
|
||||
result = MultiQueryContainerNode(result, physicalPlan);
|
||||
|
||||
/* Now switch back to original context */
|
||||
MemoryContextSwitchTo(oldcontext);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue