diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-02-13 03:26:53 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-02-13 03:26:53 +0000 |
commit | 1a105cefbd4769a1ef857f94a71faed6cb76717b (patch) | |
tree | 2c9b0cf10965e5e1d31106451552aad0c7c7e18d /src/backend/executor/nodeResult.c | |
parent | 13637df458b1d5a4f773bd17d3b894d9ff27197b (diff) | |
download | postgresql-1a105cefbd4769a1ef857f94a71faed6cb76717b.tar.gz postgresql-1a105cefbd4769a1ef857f94a71faed6cb76717b.zip |
Support for subselects.
ExecReScan for nodeAgg, nodeHash, nodeHashjoin, nodeNestloop and nodeResult.
Fixed ExecReScan for nodeMaterial.
Get rid of #ifdef INDEXSCAN_PATCH.
Get rid of ExecMarkPos and ExecRestrPos in nodeNestloop.
Diffstat (limited to 'src/backend/executor/nodeResult.c')
-rw-r--r-- | src/backend/executor/nodeResult.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/src/backend/executor/nodeResult.c b/src/backend/executor/nodeResult.c index 78f8c762619..7dcb9376ca0 100644 --- a/src/backend/executor/nodeResult.c +++ b/src/backend/executor/nodeResult.c @@ -27,7 +27,7 @@ * SeqScan (emp.all) * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeResult.c,v 1.5 1997/09/08 21:43:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeResult.c,v 1.6 1998/02/13 03:26:52 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -58,8 +58,6 @@ ExecResult(Result *node) TupleTableSlot *resultSlot; Plan *outerPlan; ExprContext *econtext; - Node *qual; - bool qualResult; bool isDone; ProjectionInfo *projInfo; @@ -79,26 +77,16 @@ ExecResult(Result *node) * check tautological qualifications like (2 > 1) * ---------------- */ - qual = node->resconstantqual; - if (qual != NULL) + if (resstate->rs_checkqual) { - qualResult = ExecQual((List *) qual, econtext); - /* ---------------- - * if we failed the constant qual, then there - * is no need to continue processing because regardless of - * what happens, the constant qual will be false.. - * ---------------- - */ + bool qualResult = ExecQual((List *) node->resconstantqual, econtext); + + resstate->rs_checkqual = false; if (qualResult == false) + { + resstate->rs_done = true; return NULL; - - /* ---------------- - * our constant qualification succeeded so now we - * throw away the qual because we know it will always - * succeed. - * ---------------- - */ - node->resconstantqual = NULL; + } } if (resstate->cstate.cs_TupFromTlist) @@ -204,9 +192,10 @@ ExecInitResult(Result *node, EState *estate, Plan *parent) * ---------------- */ resstate = makeNode(ResultState); - resstate->rs_done = 0; + resstate->rs_done = false; + resstate->rs_checkqual = (node->resconstantqual == NULL) ? false : true; node->resstate = resstate; - + /* ---------------- * Miscellanious initialization * @@ -243,12 +232,6 @@ ExecInitResult(Result *node, EState *estate, Plan *parent) ExecAssignResultTypeFromTL((Plan *) node, &resstate->cstate); ExecAssignProjectionInfo((Plan *) node, &resstate->cstate); - /* ---------------- - * set "are we done yet" to false - * ---------------- - */ - resstate->rs_done = 0; - return TRUE; } @@ -294,3 +277,21 @@ ExecEndResult(Result *node) */ ExecClearTuple(resstate->cstate.cs_ResultTupleSlot); } + +void +ExecReScanResult(Result *node, ExprContext *exprCtxt, Plan *parent) +{ + ResultState *resstate = node->resstate; + + resstate->rs_done = false; + resstate->cstate.cs_TupFromTlist = false; + resstate->rs_checkqual = (node->resconstantqual == NULL) ? false : true; + + /* + * if chgParam of subnode is not null then plan + * will be re-scanned by first ExecProcNode. + */ + if (((Plan*) node)->lefttree->chgParam == NULL) + ExecReScan (((Plan*) node)->lefttree, exprCtxt, (Plan *) node); + +} |