*
* At ExecutorStart()
* ----------------
- * - ExecInitSeqScan() calls ExecInitScanTupleSlot() and
- * ExecInitResultTupleSlotTL() to construct TupleTableSlots
- * for the tuples returned by the access methods and the
- * tuples resulting from performing target list projections.
+
+ * - ExecInitSeqScan() calls ExecInitScanTupleSlot() to construct a
+ * TupleTableSlots for the tuples returned by the access method, and
+ * ExecInitResultTypeTL() to define the node's return
+ * type. ExecAssignScanProjectionInfo() will, if necessary, create
+ * another TupleTableSlot for the tuples resulting from performing
+ * target list projections.
*
* During ExecutorRun()
* ----------------
* - SeqNext() calls ExecStoreBufferHeapTuple() to place the tuple
- * returned by the access methods into the scan tuple slot.
+ * returned by the access method into the scan tuple slot.
*
- * - ExecSeqScan() calls ExecStoreHeapTuple() to take the result
- * tuple from ExecProject() and place it into the result tuple slot.
+ * - ExecSeqScan() (via ExecScan), if necessary, calls ExecProject(),
+ * putting the result of the projection in the result tuple slot. If
+ * not necessary, it directly returns the slot returned by SeqNext().
*
* - ExecutePlan() calls the output function.
*
* ----------------------------------------------------------------
*/
-/* --------------------------------
- * ExecInit{Result,Scan,Extra}TupleSlot[TL]
- *
- * These are convenience routines to initialize the specified slot
- * in nodes inheriting the appropriate state. ExecInitExtraTupleSlot
- * is used for initializing special-purpose slots.
- * --------------------------------
- */
-
/* ----------------
- * ExecInitResultTupleSlotTL
+ * ExecInitResultTypeTL
*
- * Initialize result tuple slot, using the plan node's targetlist.
+ * Initialize result type, using the plan node's targetlist.
* ----------------
*/
void
-ExecInitResultTupleSlotTL(EState *estate, PlanState *planstate)
+ExecInitResultTypeTL(PlanState *planstate)
{
bool hasoid;
TupleDesc tupDesc;
}
tupDesc = ExecTypeFromTL(planstate->plan->targetlist, hasoid);
+ planstate->ps_ResultTupleDesc = tupDesc;
+}
- planstate->ps_ResultTupleSlot = ExecAllocTableSlot(&estate->es_tupleTable, tupDesc);
+/* --------------------------------
+ * ExecInit{Result,Scan,Extra}TupleSlot[TL]
+ *
+ * These are convenience routines to initialize the specified slot
+ * in nodes inheriting the appropriate state. ExecInitExtraTupleSlot
+ * is used for initializing special-purpose slots.
+ * --------------------------------
+ */
+
+/* ----------------
+ * ExecInitResultTupleSlotTL
+ *
+ * Initialize result tuple slot, using the tuple descriptor previously
+ * computed with ExecInitResultTypeTL().
+ * ----------------
+ */
+void
+ExecInitResultSlot(PlanState *planstate)
+{
+ TupleTableSlot *slot;
+
+ slot = ExecAllocTableSlot(&planstate->state->es_tupleTable,
+ planstate->ps_ResultTupleDesc);
+ planstate->ps_ResultTupleSlot = slot;
+}
+
+/* ----------------
+ * ExecInitResultTupleSlotTL
+ *
+ * Initialize result tuple slot, using the plan node's targetlist.
+ * ----------------
+ */
+void
+ExecInitResultTupleSlotTL(PlanState *planstate)
+{
+ ExecInitResultTypeTL(planstate);
+ ExecInitResultSlot(planstate);
}
/* ----------------
TupleDesc
ExecGetResultType(PlanState *planstate)
{
- TupleTableSlot *slot = planstate->ps_ResultTupleSlot;
-
- return slot->tts_tupleDescriptor;
+ return planstate->ps_ResultTupleDesc;
}
inputDesc))
planstate->ps_ProjInfo = NULL;
else
+ {
+ if (!planstate->ps_ResultTupleSlot)
+ ExecInitResultSlot(planstate);
ExecAssignProjectionInfo(planstate, inputDesc);
+ }
}
static bool
/*
* Initialize result type, slot and projection.
*/
- ExecInitResultTupleSlotTL(estate, &aggstate->ss.ps);
+ ExecInitResultTupleSlotTL(&aggstate->ss.ps);
ExecAssignProjectionInfo(&aggstate->ss.ps, NULL);
/*
/*
* Initialize result tuple type and slot.
*/
- ExecInitResultTupleSlotTL(estate, &appendstate->ps);
+ ExecInitResultTupleSlotTL(&appendstate->ps);
appendplanstates = (PlanState **) palloc(nplans *
sizeof(PlanState *));
/*
* clear out tuple table slots
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
ExecGetResultType(scanstate->cteplanstate));
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
{
Tuplestorestate *tuplestorestate = node->leader->cte_table;
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecScanReScan(&node->ss);
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &css->ss.ps);
+ ExecInitResultTupleSlotTL(&css->ss.ps);
ExecAssignScanProjectionInfoWithVarno(&css->ss, tlistvarno);
/* initialize child expressions */
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfoWithVarno(&scanstate->ss, tlistvarno);
/*
ExecFreeExprContext(&node->ss.ps);
/* clean out the tuple table */
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
}
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
int i;
Bitmapset *chgparam = node->ss.ps.chgParam;
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
for (i = 0; i < node->nfuncs; i++)
{
FunctionScanPerFuncState *fs = &node->funcstates[i];
tupDesc = ExecGetResultType(outerPlanState(gatherstate));
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &gatherstate->ps);
+ ExecInitResultTypeTL(&gatherstate->ps);
ExecConditionalAssignProjectionInfo(&gatherstate->ps, tupDesc, OUTER_VAR);
/*
ExecEndNode(outerPlanState(node)); /* let children clean up first */
ExecShutdownGather(node);
ExecFreeExprContext(&node->ps);
- ExecClearTuple(node->ps.ps_ResultTupleSlot);
+ if (node->ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ps.ps_ResultTupleSlot);
}
/*
gm_state->tupDesc = tupDesc;
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &gm_state->ps);
+ ExecInitResultTypeTL(&gm_state->ps);
ExecConditionalAssignProjectionInfo(&gm_state->ps, tupDesc, OUTER_VAR);
/*
ExecEndNode(outerPlanState(node)); /* let children clean up first */
ExecShutdownGatherMerge(node);
ExecFreeExprContext(&node->ps);
- ExecClearTuple(node->ps.ps_ResultTupleSlot);
+ if (node->ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ps.ps_ResultTupleSlot);
}
/* ----------------------------------------------------------------
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &grpstate->ss.ps);
+ ExecInitResultTupleSlotTL(&grpstate->ss.ps);
ExecAssignProjectionInfo(&grpstate->ss.ps, NULL);
/*
* initialize our result slot and type. No need to build projection
* because this node doesn't do projections.
*/
- ExecInitResultTupleSlotTL(estate, &hashstate->ps);
+ ExecInitResultTupleSlotTL(&hashstate->ps);
hashstate->ps.ps_ProjInfo = NULL;
/*
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &hjstate->js.ps);
+ ExecInitResultTupleSlotTL(&hjstate->js.ps);
ExecAssignProjectionInfo(&hjstate->js.ps, NULL);
/*
/*
* clear out tuple table slots
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
ExecInitScanTupleSlot(estate, &indexstate->ss, tupDesc);
/*
- * Initialize result slot, type and projection info. The node's
- * targetlist will contain Vars with varno = INDEX_VAR, referencing the
- * scan tuple.
+ * Initialize result type and projection info. The node's targetlist will
+ * contain Vars with varno = INDEX_VAR, referencing the scan tuple.
*/
- ExecInitResultTupleSlotTL(estate, &indexstate->ss.ps);
+ ExecInitResultTypeTL(&indexstate->ss.ps);
ExecAssignScanProjectionInfoWithVarno(&indexstate->ss, INDEX_VAR);
/*
/*
* clear out tuple table slots
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
RelationGetDescr(currentRelation));
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &indexstate->ss.ps);
+ ExecInitResultTypeTL(&indexstate->ss.ps);
ExecAssignScanProjectionInfo(&indexstate->ss);
/*
(PlanState *) limitstate);
/*
- * Initialize result slot and type. (XXX not actually used, but upper
- * nodes access it to get this node's result tupledesc...)
+ * Initialize result type.
*/
- ExecInitResultTupleSlotTL(estate, &limitstate->ps);
+ ExecInitResultTypeTL(&limitstate->ps);
/*
* limit nodes do no projections, so initialize projection info for this
*/
/*
- * Tuple table initialization (XXX not actually used, but upper nodes
- * access it to get this node's result tupledesc...)
+ * Initialize result type.
*/
- ExecInitResultTupleSlotTL(estate, &lrstate->ps);
+ ExecInitResultTypeTL(&lrstate->ps);
/*
* then initialize outer plan
*
* material nodes only return tuples from their materialized relation.
*/
- ExecInitResultTupleSlotTL(estate, &matstate->ss.ps);
+ ExecInitResultTupleSlotTL(&matstate->ss.ps);
matstate->ss.ps.ps_ProjInfo = NULL;
/*
* Miscellaneous initialization
*
* MergeAppend nodes do have Result slots, which hold pointers to tuples,
- * so we have to initialize them.
+ * so we have to initialize them. FIXME
*/
- ExecInitResultTupleSlotTL(estate, &mergestate->ps);
+ ExecInitResultTupleSlotTL(&mergestate->ps);
/*
* call ExecInitNode on each of the valid plans to be executed and save
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &mergestate->js.ps);
+ ExecInitResultTupleSlotTL(&mergestate->js.ps);
ExecAssignProjectionInfo(&mergestate->js.ps, NULL);
/*
mtstate->ps.plan->targetlist = (List *) linitial(node->returningLists);
/* Set up a slot for the output of the RETURNING projection(s) */
- ExecInitResultTupleSlotTL(estate, &mtstate->ps);
+ ExecInitResultTupleSlotTL(&mtstate->ps);
slot = mtstate->ps.ps_ResultTupleSlot;
/* Need an econtext too */
* expects one (maybe should change that?).
*/
mtstate->ps.plan->targetlist = NIL;
- ExecInitResultTupleSlotTL(estate, &mtstate->ps);
+ ExecInitResultTypeTL(&mtstate->ps);
mtstate->ps.ps_ExprContext = NULL;
}
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ps.ps_ResultTupleSlot);
+ if (node->ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ps.ps_ResultTupleSlot);
/*
* Terminate EPQ execution if active
ExecAssignExprContext(estate, &scanstate->ss.ps);
/*
- * Tuple table and result type initialization. The scan tuple type is
- * specified for the tuplestore.
+ * The scan tuple type is specified for the tuplestore.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
ExecInitScanTupleSlot(estate, &scanstate->ss, scanstate->tupdesc);
/*
- * initialize child expressions
+ * Initialize result type and projection.
*/
- scanstate->ss.ps.qual =
- ExecInitQual(node->scan.plan.qual, (PlanState *) scanstate);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
+ ExecAssignScanProjectionInfo(&scanstate->ss);
/*
- * Initialize projection.
+ * initialize child expressions
*/
- ExecAssignScanProjectionInfo(&scanstate->ss);
+ scanstate->ss.ps.qual =
+ ExecInitQual(node->scan.plan.qual, (PlanState *) scanstate);
return scanstate;
}
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
}
{
Tuplestorestate *tuplestorestate = node->relation;
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecScanReScan(&node->ss);
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &nlstate->js.ps);
+ ExecInitResultTupleSlotTL(&nlstate->js.ps);
ExecAssignProjectionInfo(&nlstate->js.ps, NULL);
/*
/*
* tuple table and result type initialization
*/
- ExecInitResultTupleSlotTL(estate, &state->ps);
+ ExecInitResultTupleSlotTL(&state->ps);
/* Create workspace for per-tlist-entry expr state & SRF-is-done state */
state->nelems = list_length(node->plan.targetlist);
* RecursiveUnion nodes still have Result slots, which hold pointers to
* tuples, so we have to initialize them.
*/
- ExecInitResultTupleSlotTL(estate, &rustate->ps);
+ ExecInitResultTypeTL(&rustate->ps);
/*
* Initialize result tuple type. (Note: we have to set up the result type
if (node->tableContext)
MemoryContextDelete(node->tableContext);
- /*
- * clean out the upper tuple table
- */
- ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
/*
* close down subplans
*/
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &resstate->ps);
+ ExecInitResultTupleSlotTL(&resstate->ps);
ExecAssignProjectionInfo(&resstate->ps, NULL);
/*
RelationGetDescr(scanstate->ss.ss_currentRelation));
/*
- * Initialize result slot, type and projection. tuple table and result
- * tuple initialization
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
RelationGetDescr(scanstate->ss.ss_currentRelation));
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
* Initialize result slot and type. Setop nodes do no projections, so
* initialize projection info for this node appropriately.
*/
- ExecInitResultTupleSlotTL(estate, &setopstate->ps);
+ ExecInitResultTupleSlotTL(&setopstate->ps);
setopstate->ps.ps_ProjInfo = NULL;
/*
* Initialize return slot and type. No need to initialize projection info
* because this node doesn't do projections.
*/
- ExecInitResultTupleSlotTL(estate, &sortstate->ss.ps);
+ ExecInitResultTupleSlotTL(&sortstate->ss.ps);
sortstate->ss.ps.ps_ProjInfo = NULL;
SO1_printf("ExecInitSort: %s\n",
subquerystate->subplan = ExecInitNode(node->subplan, estate, eflags);
/*
- * Initialize scan slot and type (needed by ExecInitResultTupleSlotTL)
+ * Initialize scan slot and type (needed by ExecAssignScanProjectionInfo)
*/
ExecInitScanTupleSlot(estate, &subquerystate->ss,
ExecGetResultType(subquerystate->subplan));
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &subquerystate->ss.ps);
+ ExecInitResultTypeTL(&subquerystate->ss.ps);
ExecAssignScanProjectionInfo(&subquerystate->ss);
/*
/*
* clean out the upper tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
ExecInitScanTupleSlot(estate, &scanstate->ss, tupdesc);
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/*
{
Bitmapset *chgparam = node->ss.ps.chgParam;
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecScanReScan(&node->ss);
/*
/*
* clear out tuple table slots
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
}
RelationGetDescr(currentRelation));
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &tidstate->ss.ps);
+ ExecInitResultTypeTL(&tidstate->ss.ps);
ExecAssignScanProjectionInfo(&tidstate->ss);
/*
* Initialize result slot and type. Unique nodes do no projections, so
* initialize projection info for this node appropriately.
*/
- ExecInitResultTupleSlotTL(estate, &uniquestate->ps);
+ ExecInitResultTupleSlotTL(&uniquestate->ps);
uniquestate->ps.ps_ProjInfo = NULL;
/*
ExecInitScanTupleSlot(estate, &scanstate->ss, tupdesc);
/*
- * Initialize result slot, type and projection.
+ * Initialize result type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
}
void
ExecReScanValuesScan(ValuesScanState *node)
{
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecScanReScan(&node->ss);
/*
* Initialize result slot, type and projection.
*/
- ExecInitResultTupleSlotTL(estate, &winstate->ss.ps);
+ ExecInitResultTupleSlotTL(&winstate->ss.ps);
ExecAssignProjectionInfo(&winstate->ss.ps, NULL);
/* Set up data for comparing tuples */
/*
* tuple table initialization
*/
- ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
+ ExecInitResultTypeTL(&scanstate->ss.ps);
ExecInitScanTupleSlot(estate, &scanstate->ss, NULL);
/*
/*
* clean out the tuple table
*/
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
}
void
ExecReScanWorkTableScan(WorkTableScanState *node)
{
- ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+ if (node->ss.ps.ps_ResultTupleSlot)
+ ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecScanReScan(&node->ss);
/*
* s from functions in execTuples.c
*/
-extern void ExecInitResultTupleSlotTL(EState *estate, PlanState *planstate);
+extern void ExecInitResultTypeTL(PlanState *planstate);
+extern void ExecInitResultSlot(PlanState *planstate);
+extern void ExecInitResultTupleSlotTL(PlanState *planstate);
extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupleDesc);
extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate,
TupleDesc tupleDesc);
/*
* Other run-time state needed by most if not all node types.
*/
+ TupleDesc ps_ResultTupleDesc; /* node's return type */
TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */
ExprContext *ps_ExprContext; /* node's expression-evaluation context */
ProjectionInfo *ps_ProjInfo; /* info for doing tuple projection */