diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-14 00:17:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-14 00:17:59 +0000 |
commit | 2d8d66628a8ac49deba8483608135b3c358ae729 (patch) | |
tree | 95f321c5fc2035b5110317e25b0449e85065c8a5 /src/backend/executor/execQual.c | |
parent | 29cdab3d531b6f612ab53b93dbb34a131e9cdb1c (diff) |
Clean up plantree representation of SubPlan-s --- SubLink does not appear
in the planned representation of a subplan at all any more, only SubPlan.
This means subselect.c doesn't scribble on its input anymore, which seems
like a good thing; and there are no longer three different possible
interpretations of a SubLink. Simplify node naming and improve comments
in primnodes.h. No change to stored rules, though.
Diffstat (limited to 'src/backend/executor/execQual.c')
-rw-r--r-- | src/backend/executor/execQual.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index b529d045c4d..a3f79c3ac80 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.119 2002/12/13 19:45:52 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.120 2002/12/14 00:17:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1794,8 +1794,8 @@ ExecEvalExpr(ExprState *expression, } break; } - case T_SubPlanExpr: - retDatum = ExecSubPlan((SubPlanExprState *) expression, + case T_SubPlan: + retDatum = ExecSubPlan((SubPlanState *) expression, econtext, isNull); break; @@ -1883,7 +1883,7 @@ ExecEvalExprSwitchContext(ExprState *expression, * executions of the expression are needed. Typically the context will be * the same as the per-query context of the associated ExprContext. * - * Any Aggref and SubplanExpr nodes found in the tree are added to the lists + * Any Aggref and SubPlan nodes found in the tree are added to the lists * of such nodes held by the parent PlanState. Otherwise, we do very little * initialization here other than building the state-node tree. Any nontrivial * work associated with initializing runtime info for a node should happen @@ -2003,31 +2003,26 @@ ExecInitExpr(Expr *node, PlanState *parent) state = (ExprState *) bstate; } break; - case T_SubPlanExpr: + case T_SubPlan: { /* Keep this in sync with ExecInitExprInitPlan, below */ - SubPlanExpr *subplanexpr = (SubPlanExpr *) node; - SubLink *sublink = subplanexpr->sublink; - SubPlanExprState *sstate = makeNode(SubPlanExprState); + SubPlan *subplan = (SubPlan *) node; + SubPlanState *sstate = makeNode(SubPlanState); - Assert(IsA(sublink, SubLink)); if (!parent) - elog(ERROR, "ExecInitExpr: SubPlanExpr not expected here"); + elog(ERROR, "ExecInitExpr: SubPlan not expected here"); /* - * Here we just add the SubPlanExprState nodes to + * Here we just add the SubPlanState nodes to * parent->subPlan. The subplans will be initialized later. */ parent->subPlan = lcons(sstate, parent->subPlan); sstate->planstate = NULL; - sstate->args = (List *) - ExecInitExpr((Expr *) subplanexpr->args, parent); - - if (sublink->lefthand) - elog(ERROR, "ExecInitExpr: sublink has not been transformed"); sstate->oper = (List *) - ExecInitExpr((Expr *) sublink->oper, parent); + ExecInitExpr((Expr *) subplan->oper, parent); + sstate->args = (List *) + ExecInitExpr((Expr *) subplan->args, parent); state = (ExprState *) sstate; } @@ -2145,26 +2140,20 @@ ExecInitExpr(Expr *node, PlanState *parent) * subplan expr, except we do NOT want to add the node to the parent's * subplan list. */ -SubPlanExprState * -ExecInitExprInitPlan(SubPlanExpr *node, PlanState *parent) +SubPlanState * +ExecInitExprInitPlan(SubPlan *node, PlanState *parent) { - SubLink *sublink = node->sublink; - SubPlanExprState *sstate = makeNode(SubPlanExprState); + SubPlanState *sstate = makeNode(SubPlanState); - Assert(IsA(sublink, SubLink)); if (!parent) - elog(ERROR, "ExecInitExpr: SubPlanExpr not expected here"); + elog(ERROR, "ExecInitExpr: SubPlan not expected here"); /* The subplan's state will be initialized later */ sstate->planstate = NULL; + sstate->oper = (List *) ExecInitExpr((Expr *) node->oper, parent); sstate->args = (List *) ExecInitExpr((Expr *) node->args, parent); - if (sublink->lefthand) - elog(ERROR, "ExecInitExpr: sublink has not been transformed"); - - sstate->oper = (List *) ExecInitExpr((Expr *) sublink->oper, parent); - sstate->xprstate.expr = (Expr *) node; return sstate; |