PostgreSQL Source Code  git master
nodeResult.h File Reference
#include "nodes/execnodes.h"
Include dependency graph for nodeResult.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ResultStateExecInitResult (Result *node, EState *estate, int eflags)
 
void ExecEndResult (ResultState *node)
 
void ExecResultMarkPos (ResultState *node)
 
void ExecResultRestrPos (ResultState *node)
 
void ExecReScanResult (ResultState *node)
 

Function Documentation

◆ ExecEndResult()

void ExecEndResult ( ResultState node)

Definition at line 240 of file nodeResult.c.

241 {
242  /*
243  * shut down subplans
244  */
246 }
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:562
#define outerPlanState(node)
Definition: execnodes.h:1219

References ExecEndNode(), and outerPlanState.

Referenced by ExecEndNode().

◆ ExecInitResult()

ResultState* ExecInitResult ( Result node,
EState estate,
int  eflags 
)

Definition at line 180 of file nodeResult.c.

181 {
182  ResultState *resstate;
183 
184  /* check for unsupported flags */
185  Assert(!(eflags & (EXEC_FLAG_MARK | EXEC_FLAG_BACKWARD)) ||
186  outerPlan(node) != NULL);
187 
188  /*
189  * create state structure
190  */
191  resstate = makeNode(ResultState);
192  resstate->ps.plan = (Plan *) node;
193  resstate->ps.state = estate;
194  resstate->ps.ExecProcNode = ExecResult;
195 
196  resstate->rs_done = false;
197  resstate->rs_checkqual = (node->resconstantqual != NULL);
198 
199  /*
200  * Miscellaneous initialization
201  *
202  * create expression context for node
203  */
204  ExecAssignExprContext(estate, &resstate->ps);
205 
206  /*
207  * initialize child nodes
208  */
209  outerPlanState(resstate) = ExecInitNode(outerPlan(node), estate, eflags);
210 
211  /*
212  * we don't use inner plan
213  */
214  Assert(innerPlan(node) == NULL);
215 
216  /*
217  * Initialize result slot, type and projection.
218  */
220  ExecAssignProjectionInfo(&resstate->ps, NULL);
221 
222  /*
223  * initialize child expressions
224  */
225  resstate->ps.qual =
226  ExecInitQual(node->plan.qual, (PlanState *) resstate);
227  resstate->resconstantqual =
228  ExecInitQual((List *) node->resconstantqual, (PlanState *) resstate);
229 
230  return resstate;
231 }
#define Assert(condition)
Definition: c.h:861
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:224
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
const TupleTableSlotOps TTSOpsVirtual
Definition: execTuples.c:84
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1886
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:483
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:538
#define EXEC_FLAG_BACKWARD
Definition: executor.h:68
#define EXEC_FLAG_MARK
Definition: executor.h:69
static TupleTableSlot * ExecResult(PlanState *pstate)
Definition: nodeResult.c:67
#define makeNode(_type_)
Definition: nodes.h:155
#define innerPlan(node)
Definition: plannodes.h:182
#define outerPlan(node)
Definition: plannodes.h:183
Definition: pg_list.h:54
ExprState * qual
Definition: execnodes.h:1144
Plan * plan
Definition: execnodes.h:1123
EState * state
Definition: execnodes.h:1125
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1129
List * qual
Definition: plannodes.h:154
ExprState * resconstantqual
Definition: execnodes.h:1327
bool rs_done
Definition: execnodes.h:1328
PlanState ps
Definition: execnodes.h:1326
bool rs_checkqual
Definition: execnodes.h:1329
Node * resconstantqual
Definition: plannodes.h:200
Plan plan
Definition: plannodes.h:199

References Assert, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecAssignProjectionInfo(), ExecInitNode(), ExecInitQual(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, ExecResult(), innerPlan, makeNode, outerPlan, outerPlanState, PlanState::plan, Result::plan, ResultState::ps, PlanState::qual, Plan::qual, ResultState::resconstantqual, Result::resconstantqual, ResultState::rs_checkqual, ResultState::rs_done, PlanState::state, and TTSOpsVirtual.

Referenced by ExecInitNode().

◆ ExecReScanResult()

void ExecReScanResult ( ResultState node)

Definition at line 249 of file nodeResult.c.

250 {
252 
253  node->rs_done = false;
254  node->rs_checkqual = (node->resconstantqual != NULL);
255 
256  /*
257  * If chgParam of subnode is not null then plan will be re-scanned by
258  * first ExecProcNode.
259  */
260  if (outerPlan && outerPlan->chgParam == NULL)
262 }
void ExecReScan(PlanState *node)
Definition: execAmi.c:76

References ExecReScan(), outerPlan, outerPlanState, ResultState::resconstantqual, ResultState::rs_checkqual, and ResultState::rs_done.

Referenced by ExecReScan().

◆ ExecResultMarkPos()

void ExecResultMarkPos ( ResultState node)

Definition at line 146 of file nodeResult.c.

147 {
149 
150  if (outerPlan != NULL)
152  else
153  elog(DEBUG2, "Result nodes do not support mark/restore");
154 }
#define DEBUG2
Definition: elog.h:29
#define elog(elevel,...)
Definition: elog.h:225
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:326

References DEBUG2, elog, ExecMarkPos(), outerPlan, and outerPlanState.

Referenced by ExecMarkPos().

◆ ExecResultRestrPos()

void ExecResultRestrPos ( ResultState node)

Definition at line 161 of file nodeResult.c.

162 {
164 
165  if (outerPlan != NULL)
167  else
168  elog(ERROR, "Result nodes do not support mark/restore");
169 }
#define ERROR
Definition: elog.h:39
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:375

References elog, ERROR, ExecRestrPos(), outerPlan, and outerPlanState.

Referenced by ExecRestrPos().