Always copy MultiPlan in GetMultiPlan

pull/1645/head
Marco Slot 2017-09-12 11:38:29 -07:00
parent e29ebe57fd
commit 5fe0845d7e
1 changed files with 8 additions and 1 deletions

View File

@ -467,7 +467,14 @@ GetMultiPlan(CustomScan *customScan)
node = CheckNodeCopyAndSerialization(node);
multiPlan = (MultiPlan *) node;
/*
* When using prepared statements the same plan gets reused across
* multiple statements and transactions. We make several modifications
* to the MultiPlan during execution such as assigning task placements
* and evaluating functions and parameters. These changes should not
* persist, so we always work on a copy.
*/
multiPlan = (MultiPlan *) copyObject(node);
return multiPlan;
}