aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execQual.c8
-rw-r--r--src/backend/executor/nodeSubplan.c43
2 files changed, 15 insertions, 36 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 971773b1212..49986de2748 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.121 2002/12/15 16:17:45 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.122 2003/01/10 21:08:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2023,8 +2023,8 @@ ExecInitExpr(Expr *node, PlanState *parent)
sstate->sub_estate = NULL;
sstate->planstate = NULL;
- sstate->oper = (List *)
- ExecInitExpr((Expr *) subplan->oper, parent);
+ sstate->exprs = (List *)
+ ExecInitExpr((Expr *) subplan->exprs, parent);
sstate->args = (List *)
ExecInitExpr((Expr *) subplan->args, parent);
@@ -2156,7 +2156,7 @@ ExecInitExprInitPlan(SubPlan *node, PlanState *parent)
sstate->sub_estate = NULL;
sstate->planstate = NULL;
- sstate->oper = (List *) ExecInitExpr((Expr *) node->oper, parent);
+ sstate->exprs = (List *) ExecInitExpr((Expr *) node->exprs, parent);
sstate->args = (List *) ExecInitExpr((Expr *) node->args, parent);
sstate->xprstate.expr = (Expr *) node;
diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c
index c9a02814bff..40eca6749ec 100644
--- a/src/backend/executor/nodeSubplan.c
+++ b/src/backend/executor/nodeSubplan.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.41 2003/01/09 20:50:50 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.42 2003/01/10 21:08:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -110,6 +110,7 @@ ExecSubPlan(SubPlanState *node,
Datum rowresult = BoolGetDatum(!useOr);
bool rownull = false;
int col = 1;
+ List *plst;
if (subLinkType == EXISTS_SUBLINK)
{
@@ -155,45 +156,19 @@ ExecSubPlan(SubPlanState *node,
* For ALL, ANY, and MULTIEXPR sublinks, iterate over combining
* operators for columns of tuple.
*/
- foreach(lst, node->oper)
+ plst = subplan->paramIds;
+ foreach(lst, node->exprs)
{
ExprState *exprstate = (ExprState *) lfirst(lst);
- OpExpr *expr = (OpExpr *) exprstate->expr;
- Param *prm = lsecond(expr->args);
+ int paramid = lfirsti(plst);
ParamExecData *prmdata;
Datum expresult;
bool expnull;
/*
- * The righthand side of the expression should be either a
- * Param or a function call or RelabelType node taking a Param
- * as arg (these nodes represent run-time type coercions
- * inserted by the parser to get to the input type needed by
- * the operator). Find the Param node and insert the actual
- * righthand-side value into the param's econtext slot.
- *
- * XXX possible improvement: could make a list of the ParamIDs
- * at startup time, instead of repeating this check at each row.
+ * Load up the Param representing this column of the sub-select.
*/
- if (!IsA(prm, Param))
- {
- switch (nodeTag(prm))
- {
- case T_FuncExpr:
- prm = lfirst(((FuncExpr *) prm)->args);
- break;
- case T_RelabelType:
- prm = (Param *) (((RelabelType *) prm)->arg);
- break;
- default:
- /* will fail below */
- break;
- }
- if (!IsA(prm, Param))
- elog(ERROR, "ExecSubPlan: failed to find placeholder for subplan result");
- }
- Assert(prm->paramkind == PARAM_EXEC);
- prmdata = &(econtext->ecxt_param_exec_vals[prm->paramid]);
+ prmdata = &(econtext->ecxt_param_exec_vals[paramid]);
Assert(prmdata->execPlan == NULL);
prmdata->value = heap_getattr(tup, col, tdesc,
&(prmdata->isnull));
@@ -236,6 +211,8 @@ ExecSubPlan(SubPlanState *node,
break; /* needn't look at any more columns */
}
}
+
+ plst = lnext(plst);
col++;
}
@@ -312,6 +289,8 @@ ExecInitSubPlan(SubPlanState *node, EState *estate)
*/
node->needShutdown = false;
node->curTuple = NULL;
+ node->hashtable = NULL;
+ node->hashnulls = NULL;
/*
* create an EState for the subplan