aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeLimit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeLimit.c')
-rw-r--r--src/backend/executor/nodeLimit.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/executor/nodeLimit.c b/src/backend/executor/nodeLimit.c
index 29d2deac23b..56d98b4490b 100644
--- a/src/backend/executor/nodeLimit.c
+++ b/src/backend/executor/nodeLimit.c
@@ -354,6 +354,12 @@ ExecInitLimit(Limit *node, EState *estate, int eflags)
ExecAssignExprContext(estate, &limitstate->ps);
/*
+ * initialize outer plan
+ */
+ outerPlan = outerPlan(node);
+ outerPlanState(limitstate) = ExecInitNode(outerPlan, estate, eflags);
+
+ /*
* initialize child expressions
*/
limitstate->limitOffset = ExecInitExpr((Expr *) node->limitOffset,
@@ -362,21 +368,15 @@ ExecInitLimit(Limit *node, EState *estate, int eflags)
(PlanState *) limitstate);
/*
- * Tuple table initialization (XXX not actually used...)
+ * Initialize result slot and type. (XXX not actually used, but upper
+ * nodes access it to get this node's result tupledesc...)
*/
- ExecInitResultTupleSlot(estate, &limitstate->ps);
-
- /*
- * then initialize outer plan
- */
- outerPlan = outerPlan(node);
- outerPlanState(limitstate) = ExecInitNode(outerPlan, estate, eflags);
+ ExecInitResultTupleSlotTL(estate, &limitstate->ps);
/*
* limit nodes do no projections, so initialize projection info for this
* node appropriately
*/
- ExecAssignResultTypeFromTL(&limitstate->ps);
limitstate->ps.ps_ProjInfo = NULL;
return limitstate;