PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 ExecReScanWorkTableScan (WorkTableScanState *node)
 

Function Documentation

◆ ExecInitWorkTableScan()

WorkTableScanState * ExecInitWorkTableScan ( WorkTableScan node,
EState estate,
int  eflags 
)

Definition at line 130 of file nodeWorktablescan.c.

131{
132 WorkTableScanState *scanstate;
133
134 /* check for unsupported flags */
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}
#define Assert(condition)
Definition: c.h:812
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:224
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1998
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1942
const TupleTableSlotOps TTSOpsMinimalTuple
Definition: execTuples.c:86
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:485
#define EXEC_FLAG_BACKWARD
Definition: executor.h:68
#define EXEC_FLAG_MARK
Definition: executor.h:69
static TupleTableSlot * ExecWorkTableScan(PlanState *pstate)
#define makeNode(_type_)
Definition: nodes.h:155
#define innerPlan(node)
Definition: plannodes.h:182
#define outerPlan(node)
Definition: plannodes.h:183
bool resultopsset
Definition: execnodes.h:1211
ExprState * qual
Definition: execnodes.h:1147
Plan * plan
Definition: execnodes.h:1126
EState * state
Definition: execnodes.h:1128
bool resultopsfixed
Definition: execnodes.h:1207
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1132
PlanState ps
Definition: execnodes.h:1573
RecursiveUnionState * rustate
Definition: execnodes.h:2061

References Assert, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), PlanState::ExecProcNode, ExecWorkTableScan(), innerPlan, makeNode, outerPlan, PlanState::plan, ScanState::ps, PlanState::qual, PlanState::resultopsfixed, PlanState::resultopsset, WorkTableScanState::rustate, WorkTableScan::scan, WorkTableScanState::ss, PlanState::state, and TTSOpsMinimalTuple.

Referenced by ExecInitNode().

◆ ExecReScanWorkTableScan()

void ExecReScanWorkTableScan ( WorkTableScanState node)

Definition at line 191 of file nodeWorktablescan.c.

192{
193 if (node->ss.ps.ps_ResultTupleSlot)
195
196 ExecScanReScan(&node->ss);
197
198 /* No need (or way) to rescan if ExecWorkTableScan not called yet */
199 if (node->rustate)
201}
void ExecScanReScan(ScanState *node)
Definition: execScan.c:297
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:1164
Tuplestorestate * working_table
Definition: execnodes.h:1520
void tuplestore_rescan(Tuplestorestate *state)
Definition: tuplestore.c:1285
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:454

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

Referenced by ExecReScan().