]> granicus.if.org Git - postgresql/blobdiff - src/backend/executor/nodeAppend.c
Make some small planner API cleanups.
[postgresql] / src / backend / executor / nodeAppend.c
index 86a68d30201e39d459ee70a3603656d89ec8d6b2..f3be2429dbeb122d186e941d26b2094982441bdc 100644 (file)
@@ -3,7 +3,7 @@
  * nodeAppend.c
  *       routines to handle append nodes.
  *
- * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -112,12 +112,6 @@ ExecInitAppend(Append *node, EState *estate, int eflags)
        /* check for unsupported flags */
        Assert(!(eflags & EXEC_FLAG_MARK));
 
-       /*
-        * Lock the non-leaf tables in the partition tree controlled by this node.
-        * It's a no-op for non-partitioned parent tables.
-        */
-       ExecLockNonLeafAppendTables(node->partitioned_rels, estate);
-
        /*
         * create new AppendState for our append node
         */
@@ -129,7 +123,7 @@ ExecInitAppend(Append *node, EState *estate, int eflags)
        appendstate->as_whichplan = INVALID_SUBPLAN_INDEX;
 
        /* If run-time partition pruning is enabled, then set that up now */
-       if (node->part_prune_infos != NIL)
+       if (node->part_prune_info != NULL)
        {
                PartitionPruneState *prunestate;
 
@@ -138,7 +132,7 @@ ExecInitAppend(Append *node, EState *estate, int eflags)
 
                /* Create the working data structure for pruning. */
                prunestate = ExecCreatePartitionPruneState(&appendstate->ps,
-                                                                                                  node->part_prune_infos);
+                                                                                                  node->part_prune_info);
                appendstate->as_prune_state = prunestate;
 
                /* Perform an initial partition prune, if required. */
@@ -202,7 +196,11 @@ ExecInitAppend(Append *node, EState *estate, int eflags)
        /*
         * Initialize result tuple type and slot.
         */
-       ExecInitResultTupleSlotTL(estate, &appendstate->ps);
+       ExecInitResultTupleSlotTL(&appendstate->ps, &TTSOpsVirtual);
+
+       /* node returns slots from each of its subnodes, therefore not fixed */
+       appendstate->ps.resultopsset = true;
+       appendstate->ps.resultopsfixed = false;
 
        appendplanstates = (PlanState **) palloc(nplans *
                                                                                         sizeof(PlanState *));
@@ -335,12 +333,6 @@ ExecEndAppend(AppendState *node)
         */
        for (i = 0; i < nplans; i++)
                ExecEndNode(appendplans[i]);
-
-       /*
-        * release any resources associated with run-time pruning
-        */
-       if (node->as_prune_state)
-               ExecDestroyPartitionPruneState(node->as_prune_state);
 }
 
 void