aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeSort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeSort.c')
-rw-r--r--src/backend/executor/nodeSort.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c
index d61c859fce6..73f16c9abaa 100644
--- a/src/backend/executor/nodeSort.c
+++ b/src/backend/executor/nodeSort.c
@@ -199,14 +199,6 @@ ExecInitSort(Sort *node, EState *estate, int eflags)
*/
/*
- * tuple table initialization
- *
- * sort nodes only return scan tuples from their sorted relation.
- */
- ExecInitResultTupleSlot(estate, &sortstate->ss.ps);
- ExecInitScanTupleSlot(estate, &sortstate->ss);
-
- /*
* initialize child nodes
*
* We shield the child node from the need to support REWIND, BACKWARD, or
@@ -217,11 +209,15 @@ ExecInitSort(Sort *node, EState *estate, int eflags)
outerPlanState(sortstate) = ExecInitNode(outerPlan(node), estate, eflags);
/*
- * initialize tuple type. no need to initialize projection info because
+ * Initialize scan slot and type.
+ */
+ ExecCreateScanSlotFromOuterPlan(estate, &sortstate->ss);
+
+ /*
+ * Initialize return slot and type. No need to initialize projection info because
* this node doesn't do projections.
*/
- ExecAssignResultTypeFromTL(&sortstate->ss.ps);
- ExecAssignScanTypeFromOuterPlan(&sortstate->ss);
+ ExecInitResultTupleSlotTL(estate, &sortstate->ss.ps);
sortstate->ss.ps.ps_ProjInfo = NULL;
SO1_printf("ExecInitSort: %s\n",