aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execScan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-12-05 15:50:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-12-05 15:50:39 +0000
commit1fd0c59e25063e664f8a5cee6f723470c5979544 (patch)
treed7c1ba5ee25323021a65d0e419299162a9db9c19 /src/backend/executor/execScan.c
parent0f3b83edfaf65b6105b455f601c11af6e12170ca (diff)
downloadpostgresql-1fd0c59e25063e664f8a5cee6f723470c5979544.tar.gz
postgresql-1fd0c59e25063e664f8a5cee6f723470c5979544.zip
Phase 1 of read-only-plans project: cause executor state nodes to point
to plan nodes, not vice-versa. All executor state nodes now inherit from struct PlanState. Copying of plan trees has been simplified by not storing a list of SubPlans in Plan nodes (eliminating duplicate links). The executor still needs such a list, but it can build it during ExecutorStart since it has to scan the plan tree anyway. No initdb forced since no stored-on-disk structures changed, but you will need a full recompile because of node-numbering changes.
Diffstat (limited to 'src/backend/executor/execScan.c')
-rw-r--r--src/backend/executor/execScan.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/backend/executor/execScan.c b/src/backend/executor/execScan.c
index 9fd7c4fb00c..6944e03e9bc 100644
--- a/src/backend/executor/execScan.c
+++ b/src/backend/executor/execScan.c
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.21 2002/09/02 02:47:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.22 2002/12/05 15:50:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,10 +44,9 @@
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecScan(Scan *node,
+ExecScan(ScanState *node,
ExecScanAccessMtd accessMtd) /* function returning a tuple */
{
- CommonScanState *scanstate;
EState *estate;
ExprContext *econtext;
List *qual;
@@ -57,23 +56,22 @@ ExecScan(Scan *node,
/*
* Fetch data from node
*/
- estate = node->plan.state;
- scanstate = node->scanstate;
- econtext = scanstate->cstate.cs_ExprContext;
- qual = node->plan.qual;
+ estate = node->ps.state;
+ econtext = node->ps.ps_ExprContext;
+ qual = node->ps.qual;
/*
* Check to see if we're still projecting out tuples from a previous
* scan tuple (because there is a function-returning-set in the
* projection expressions). If so, try to project another one.
*/
- if (scanstate->cstate.cs_TupFromTlist)
+ if (node->ps.ps_TupFromTlist)
{
- resultSlot = ExecProject(scanstate->cstate.cs_ProjInfo, &isDone);
+ resultSlot = ExecProject(node->ps.ps_ProjInfo, &isDone);
if (isDone == ExprMultipleResult)
return resultSlot;
/* Done with that source tuple... */
- scanstate->cstate.cs_TupFromTlist = false;
+ node->ps.ps_TupFromTlist = false;
}
/*
@@ -104,7 +102,7 @@ ExecScan(Scan *node,
if (TupIsNull(slot))
{
return ExecStoreTuple(NULL,
- scanstate->cstate.cs_ProjInfo->pi_slot,
+ node->ps.ps_ProjInfo->pi_slot,
InvalidBuffer,
true);
}
@@ -130,10 +128,10 @@ ExecScan(Scan *node,
* return it --- unless we find we can project no tuples from
* this scan tuple, in which case continue scan.
*/
- resultSlot = ExecProject(scanstate->cstate.cs_ProjInfo, &isDone);
+ resultSlot = ExecProject(node->ps.ps_ProjInfo, &isDone);
if (isDone != ExprEndResult)
{
- scanstate->cstate.cs_TupFromTlist = (isDone == ExprMultipleResult);
+ node->ps.ps_TupFromTlist = (isDone == ExprMultipleResult);
return resultSlot;
}
}