PostgreSQL Source Code  git master
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

◆ ExecEndWorkTableScan()

void ExecEndWorkTableScan ( WorkTableScanState node)

Definition at line 191 of file nodeWorktablescan.c.

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

Referenced by ExecEndNode().

192 {
193  /*
194  * Free exprcontext
195  */
196  ExecFreeExprContext(&node->ss.ps);
197 
198  /*
199  * clean out the tuple table
200  */
201  if (node->ss.ps.ps_ResultTupleSlot)
204 }
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:426
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1334
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:614
PlanState ps
Definition: execnodes.h:1331
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:978

◆ ExecInitWorkTableScan()

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(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), PlanState::ExecProcNode, ExecWorkTableScan(), innerPlan, makeNode, outerPlan, Scan::plan, PlanState::plan, ScanState::ps, Plan::qual, PlanState::qual, PlanState::resultopsfixed, PlanState::resultopsset, WorkTableScanState::rustate, WorkTableScan::scan, WorkTableScanState::ss, PlanState::state, and TTSOpsMinimalTuple.

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  * tuple table initialization
161  */
162  ExecInitResultTypeTL(&scanstate->ss.ps);
163 
164  /* signal that return type is not yet known */
165  scanstate->ss.ps.resultopsset = true;
166  scanstate->ss.ps.resultopsfixed = false;
167 
168  ExecInitScanTupleSlot(estate, &scanstate->ss, NULL, &TTSOpsMinimalTuple);
169 
170  /*
171  * initialize child expressions
172  */
173  scanstate->ss.ps.qual =
174  ExecInitQual(node->scan.plan.qual, (PlanState *) scanstate);
175 
176  /*
177  * Do not yet initialize projection info, see ExecWorkTableScan() for
178  * details.
179  */
180 
181  return scanstate;
182 }
List * qual
Definition: plannodes.h:141
Plan plan
Definition: plannodes.h:340
EState * state
Definition: execnodes.h:942
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:207
PlanState ps
Definition: execnodes.h:1331
#define EXEC_FLAG_BACKWARD
Definition: executor.h:58
#define innerPlan(node)
Definition: plannodes.h:169
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1776
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1720
bool resultopsset
Definition: execnodes.h:1023
#define outerPlan(node)
Definition: plannodes.h:170
RecursiveUnionState * rustate
Definition: execnodes.h:1774
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:946
static TupleTableSlot * ExecWorkTableScan(PlanState *pstate)
Plan * plan
Definition: execnodes.h:940
#define makeNode(_type_)
Definition: nodes.h:573
#define Assert(condition)
Definition: c.h:732
#define EXEC_FLAG_MARK
Definition: executor.h:59
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:444
ExprState * qual
Definition: execnodes.h:961
bool resultopsfixed
Definition: execnodes.h:1019
const TupleTableSlotOps TTSOpsMinimalTuple
Definition: execTuples.c:86

◆ ExecReScanWorkTableScan()

void ExecReScanWorkTableScan ( WorkTableScanState node)

Definition at line 213 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().

214 {
215  if (node->ss.ps.ps_ResultTupleSlot)
217 
218  ExecScanReScan(&node->ss);
219 
220  /* No need (or way) to rescan if ExecWorkTableScan not called yet */
221  if (node->rustate)
223 }
void tuplestore_rescan(Tuplestorestate *state)
Definition: tuplestore.c:1233
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:426
PlanState ps
Definition: execnodes.h:1331
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:978
Tuplestorestate * working_table
Definition: execnodes.h:1278
RecursiveUnionState * rustate
Definition: execnodes.h:1774
void ExecScanReScan(ScanState *node)
Definition: execScan.c:299