Always copy MultiPlan in GetMultiPlan

release-7.0
Marco Slot 2017-09-12 11:38:29 -07:00 committed by Burak Yucesoy
parent 0012d70b1b
commit d8bb32bd5a
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;
}