aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execProcnode.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1998-02-13 03:26:53 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1998-02-13 03:26:53 +0000
commit1a105cefbd4769a1ef857f94a71faed6cb76717b (patch)
tree2c9b0cf10965e5e1d31106451552aad0c7c7e18d /src/backend/executor/execProcnode.c
parent13637df458b1d5a4f773bd17d3b894d9ff27197b (diff)
downloadpostgresql-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/execProcnode.c')
-rw-r--r--src/backend/executor/execProcnode.c55
1 files changed, 45 insertions, 10 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index a2bd3e6ca6d..017fdfba4d1 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.7 1998/01/07 21:02:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.8 1998/02/13 03:26:40 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -89,6 +89,7 @@
#include "executor/nodeHash.h"
#include "executor/nodeHashjoin.h"
#include "executor/nodeTee.h"
+#include "executor/nodeSubplan.h"
/* ------------------------------------------------------------------------
* ExecInitNode
@@ -106,6 +107,7 @@ bool
ExecInitNode(Plan *node, EState *estate, Plan *parent)
{
bool result;
+ List *subp;
/* ----------------
* do nothing when we get to the end
@@ -114,7 +116,14 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent)
*/
if (node == NULL)
return FALSE;
-
+
+ foreach (subp, node->initPlan)
+ {
+ result = ExecInitSubPlan ((SubPlan*) lfirst (subp), estate, node);
+ if ( result == FALSE )
+ return (FALSE);
+ }
+
switch (nodeTag(node))
{
/* ----------------
@@ -190,10 +199,19 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent)
break;
default:
- elog(DEBUG, "ExecInitNode: node not yet supported: %d",
- nodeTag(node));
+ elog(ERROR, "ExecInitNode: node %d unsupported", nodeTag(node));
result = FALSE;
}
+
+ if ( result != FALSE )
+ {
+ foreach (subp, node->subPlan)
+ {
+ result = ExecInitSubPlan ((SubPlan*) lfirst (subp), estate, node);
+ if ( result == FALSE )
+ return (FALSE);
+ }
+ }
return result;
}
@@ -217,7 +235,10 @@ ExecProcNode(Plan *node, Plan *parent)
*/
if (node == NULL)
return NULL;
-
+
+ if ( node->chgParam != NULL ) /* something changed */
+ ExecReScan (node, NULL, parent); /* let ReScan handle this */
+
switch (nodeTag(node))
{
/* ----------------
@@ -293,9 +314,8 @@ ExecProcNode(Plan *node, Plan *parent)
break;
default:
- elog(DEBUG, "ExecProcNode: node not yet supported: %d",
- nodeTag(node));
- result = FALSE;
+ elog(ERROR, "ExecProcNode: node %d unsupported", nodeTag(node));
+ result = NULL;
}
return result;
@@ -389,6 +409,8 @@ ExecCountSlotsNode(Plan *node)
void
ExecEndNode(Plan *node, Plan *parent)
{
+ List *subp;
+
/* ----------------
* do nothing when we get to the end
* of a leaf on tree.
@@ -396,6 +418,20 @@ ExecEndNode(Plan *node, Plan *parent)
*/
if (node == NULL)
return;
+
+ foreach (subp, node->initPlan)
+ {
+ ExecEndSubPlan ((SubPlan*) lfirst (subp));
+ }
+ foreach (subp, node->subPlan)
+ {
+ ExecEndSubPlan ((SubPlan*) lfirst (subp));
+ }
+ if ( node->chgParam != NULL )
+ {
+ freeList (node->chgParam);
+ node->chgParam = NULL;
+ }
switch (nodeTag(node))
{
@@ -476,8 +512,7 @@ ExecEndNode(Plan *node, Plan *parent)
break;
default:
- elog(DEBUG, "ExecEndNode: node not yet supported",
- nodeTag(node));
+ elog(ERROR, "ExecEndNode: node %d unsupported", nodeTag(node));
break;
}
}