#include "nodes/execnodes.h"

Go to the source code of this file.
Functions | |
| ForeignScanState * | ExecInitForeignScan (ForeignScan *node, EState *estate, int eflags) |
| TupleTableSlot * | ExecForeignScan (ForeignScanState *node) |
| void | ExecEndForeignScan (ForeignScanState *node) |
| void | ExecReScanForeignScan (ForeignScanState *node) |
| void ExecEndForeignScan | ( | ForeignScanState * | node | ) |
Definition at line 183 of file nodeForeignscan.c.
References FdwRoutine::EndForeignScan, ExecClearTuple(), ExecCloseScanRelation(), ExecFreeExprContext(), ForeignScanState::fdwroutine, ScanState::ps, PlanState::ps_ResultTupleSlot, ForeignScanState::ss, ScanState::ss_currentRelation, and ScanState::ss_ScanTupleSlot.
Referenced by ExecEndNode().
{
/* Let the FDW shut down */
node->fdwroutine->EndForeignScan(node);
/* Free the exprcontext */
ExecFreeExprContext(&node->ss.ps);
/* clean out the tuple table */
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/* close the relation. */
ExecCloseScanRelation(node->ss.ss_currentRelation);
}
| TupleTableSlot* ExecForeignScan | ( | ForeignScanState * | node | ) |
Definition at line 89 of file nodeForeignscan.c.
References ExecScan(), ForeignNext(), and ForeignRecheck().
Referenced by ExecProcNode().
{
return ExecScan((ScanState *) node,
(ExecScanAccessMtd) ForeignNext,
(ExecScanRecheckMtd) ForeignRecheck);
}
| ForeignScanState* ExecInitForeignScan | ( | ForeignScan * | node, | |
| EState * | estate, | |||
| int | eflags | |||
| ) |
Definition at line 102 of file nodeForeignscan.c.
References Assert, FdwRoutine::BeginForeignScan, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecAssignResultTypeFromTL(), ExecAssignScanProjectionInfo(), ExecAssignScanType(), ExecInitExpr(), ExecInitResultTupleSlot(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), ForeignScanState::fdw_state, ForeignScanState::fdwroutine, GetFdwRoutineForRelation(), makeNode, Scan::plan, PlanState::plan, ScanState::ps, PlanState::ps_TupFromTlist, Plan::qual, PlanState::qual, RelationGetDescr, ForeignScan::scan, Scan::scanrelid, ForeignScanState::ss, ScanState::ss_currentRelation, PlanState::state, Plan::targetlist, and PlanState::targetlist.
Referenced by ExecInitNode().
{
ForeignScanState *scanstate;
Relation currentRelation;
FdwRoutine *fdwroutine;
/* check for unsupported flags */
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
/*
* create state structure
*/
scanstate = makeNode(ForeignScanState);
scanstate->ss.ps.plan = (Plan *) node;
scanstate->ss.ps.state = estate;
/*
* Miscellaneous initialization
*
* create expression context for node
*/
ExecAssignExprContext(estate, &scanstate->ss.ps);
scanstate->ss.ps.ps_TupFromTlist = false;
/*
* initialize child expressions
*/
scanstate->ss.ps.targetlist = (List *)
ExecInitExpr((Expr *) node->scan.plan.targetlist,
(PlanState *) scanstate);
scanstate->ss.ps.qual = (List *)
ExecInitExpr((Expr *) node->scan.plan.qual,
(PlanState *) scanstate);
/*
* tuple table initialization
*/
ExecInitResultTupleSlot(estate, &scanstate->ss.ps);
ExecInitScanTupleSlot(estate, &scanstate->ss);
/*
* open the base relation and acquire appropriate lock on it.
*/
currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
scanstate->ss.ss_currentRelation = currentRelation;
/*
* get the scan type from the relation descriptor. (XXX at some point we
* might want to let the FDW editorialize on the scan tupdesc.)
*/
ExecAssignScanType(&scanstate->ss, RelationGetDescr(currentRelation));
/*
* Initialize result tuple type and projection info.
*/
ExecAssignResultTypeFromTL(&scanstate->ss.ps);
ExecAssignScanProjectionInfo(&scanstate->ss);
/*
* Acquire function pointers from the FDW's handler, and init fdw_state.
*/
fdwroutine = GetFdwRoutineForRelation(currentRelation, true);
scanstate->fdwroutine = fdwroutine;
scanstate->fdw_state = NULL;
/*
* Tell the FDW to initiate the scan.
*/
fdwroutine->BeginForeignScan(scanstate, eflags);
return scanstate;
}
| void ExecReScanForeignScan | ( | ForeignScanState * | node | ) |
Definition at line 206 of file nodeForeignscan.c.
References ExecScanReScan(), ForeignScanState::fdwroutine, FdwRoutine::ReScanForeignScan, and ForeignScanState::ss.
Referenced by ExecReScan().
{
node->fdwroutine->ReScanForeignScan(node);
ExecScanReScan(&node->ss);
}
1.7.1