> On 8 Jun 2023, at 16:23, Amit Langote <amitlangote09@gmail.com> wrote:
>
> Here is a new version.
The local planstate variable in the hunk below is shadowing the function
parameter planstate which cause a compiler warning:
@@ -1495,18 +1556,15 @@ ExecEndPlan(PlanState *planstate, EState *estate)
ListCell *l;
/*
- * shut down the node-type-specific query processing
- */
- ExecEndNode(planstate);
-
- /*
- * for subplans too
+ * Shut down the node-type-specific query processing for all nodes that
+ * were initialized during InitPlan(), both in the main plan tree and those
+ * in subplans (es_subplanstates), if any.
*/
- foreach(l, estate->es_subplanstates)
+ foreach(l, estate->es_inited_plannodes)
{
- PlanState *subplanstate = (PlanState *) lfirst(l);
+ PlanState *planstate = (PlanState *) lfirst(l);
--
Daniel Gustafsson