PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
nodeWorktablescan.h File Reference
#include "nodes/execnodes.h"
Include dependency graph for nodeWorktablescan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

WorkTableScanStateExecInitWorkTableScan (WorkTableScan *node, EState *estate, int eflags)
 
void ExecEndWorkTableScan (WorkTableScanState *node)
 
void ExecReScanWorkTableScan (WorkTableScanState *node)
 

Function Documentation

void ExecEndWorkTableScan ( WorkTableScanState node)

Definition at line 186 of file nodeWorktablescan.c.

References ExecClearTuple(), ExecFreeExprContext(), ScanState::ps, PlanState::ps_ResultTupleSlot, WorkTableScanState::ss, and ScanState::ss_ScanTupleSlot.

Referenced by ExecEndNode().

187 {
188  /*
189  * Free exprcontext
190  */
191  ExecFreeExprContext(&node->ss.ps);
192 
193  /*
194  * clean out the tuple table
195  */
198 }
TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: execTuples.c:439
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1103
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:521
PlanState ps
Definition: execnodes.h:1100
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:880
WorkTableScanState* ExecInitWorkTableScan ( WorkTableScan node,
EState estate,
int  eflags 
)

Definition at line 130 of file nodeWorktablescan.c.

References Assert, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecAssignResultTypeFromTL(), ExecInitQual(), ExecInitResultTupleSlot(), ExecInitScanTupleSlot(), PlanState::ExecProcNode, ExecWorkTableScan(), innerPlan, makeNode, outerPlan, Scan::plan, PlanState::plan, ScanState::ps, Plan::qual, PlanState::qual, WorkTableScanState::rustate, WorkTableScan::scan, WorkTableScanState::ss, and PlanState::state.

Referenced by ExecInitNode().

131 {
132  WorkTableScanState *scanstate;
133 
134  /* check for unsupported flags */
135  Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
136 
137  /*
138  * WorkTableScan should not have any children.
139  */
140  Assert(outerPlan(node) == NULL);
141  Assert(innerPlan(node) == NULL);
142 
143  /*
144  * create new WorkTableScanState for node
145  */
146  scanstate = makeNode(WorkTableScanState);
147  scanstate->ss.ps.plan = (Plan *) node;
148  scanstate->ss.ps.state = estate;
149  scanstate->ss.ps.ExecProcNode = ExecWorkTableScan;
150  scanstate->rustate = NULL; /* we'll set this later */
151 
152  /*
153  * Miscellaneous initialization
154  *
155  * create expression context for node
156  */
157  ExecAssignExprContext(estate, &scanstate->ss.ps);
158 
159  /*
160  * initialize child expressions
161  */
162  scanstate->ss.ps.qual =
163  ExecInitQual(node->scan.plan.qual, (PlanState *) scanstate);
164 
165  /*
166  * tuple table initialization
167  */
168  ExecInitResultTupleSlot(estate, &scanstate->ss.ps);
169  ExecInitScanTupleSlot(estate, &scanstate->ss);
170 
171  /*
172  * Initialize result tuple type, but not yet projection info.
173  */
174  ExecAssignResultTypeFromTL(&scanstate->ss.ps);
175 
176  return scanstate;
177 }
List * qual
Definition: plannodes.h:145
Plan plan
Definition: plannodes.h:328
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
Definition: execTuples.c:842
EState * state
Definition: execnodes.h:849
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:160
void ExecAssignResultTypeFromTL(PlanState *planstate)
Definition: execUtils.c:445
PlanState ps
Definition: execnodes.h:1100
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
Definition: execTuples.c:832
#define EXEC_FLAG_BACKWARD
Definition: executor.h:60
#define innerPlan(node)
Definition: plannodes.h:173
#define outerPlan(node)
Definition: plannodes.h:174
RecursiveUnionState * rustate
Definition: execnodes.h:1532
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:853
static TupleTableSlot * ExecWorkTableScan(PlanState *pstate)
Plan * plan
Definition: execnodes.h:847
#define makeNode(_type_)
Definition: nodes.h:557
#define Assert(condition)
Definition: c.h:664
#define EXEC_FLAG_MARK
Definition: executor.h:61
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:423
ExprState * qual
Definition: execnodes.h:865
void ExecReScanWorkTableScan ( WorkTableScanState node)

Definition at line 207 of file nodeWorktablescan.c.

References ExecClearTuple(), ExecScanReScan(), ScanState::ps, PlanState::ps_ResultTupleSlot, WorkTableScanState::rustate, WorkTableScanState::ss, tuplestore_rescan(), and RecursiveUnionState::working_table.

Referenced by ExecReScan().

208 {
210 
211  ExecScanReScan(&node->ss);
212 
213  /* No need (or way) to rescan if ExecWorkTableScan not called yet */
214  if (node->rustate)
216 }
void tuplestore_rescan(Tuplestorestate *state)
Definition: tuplestore.c:1233
TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: execTuples.c:439
PlanState ps
Definition: execnodes.h:1100
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:880
Tuplestorestate * working_table
Definition: execnodes.h:1047
RecursiveUnionState * rustate
Definition: execnodes.h:1532
void ExecScanReScan(ScanState *node)
Definition: execScan.c:329