1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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.
This commit is contained in:
Tom Lane
2002-12-14 00:17:59 +00:00
parent 29cdab3d53
commit 2d8d66628a
24 changed files with 355 additions and 356 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.41 2002/12/12 15:49:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.42 2002/12/14 00:17:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -65,7 +65,7 @@ static Node *flatten_join_alias_vars_mutator(Node *node,
* NOTE: this is used on not-yet-planned expressions. It may therefore find
* bare SubLinks, and if so it needs to recurse into them to look for uplevel
* references to the desired rtable level! But when we find a completed
* SubPlanExpr, we only need to look at the parameters passed to the subplan.
* SubPlan, we only need to look at the parameters passed to the subplan.
*/
List *
pull_varnos(Node *node)
@ -111,9 +111,9 @@ pull_varnos_walker(Node *node, pull_varnos_context *context)
* executed by the outer query. But short-circuit recursion into
* the subquery itself, which would be a waste of effort.
*/
SubPlanExpr *subplan = (SubPlanExpr *) node;
SubPlan *subplan = (SubPlan *) node;
if (pull_varnos_walker((Node *) subplan->sublink->oper,
if (pull_varnos_walker((Node *) subplan->oper,
context))
return true;
if (pull_varnos_walker((Node *) subplan->args,
@ -146,7 +146,7 @@ pull_varnos_walker(Node *node, pull_varnos_context *context)
* NOTE: this is used on not-yet-planned expressions. It may therefore find
* bare SubLinks, and if so it needs to recurse into them to look for uplevel
* references to the desired rtable entry! But when we find a completed
* SubPlanExpr, we only need to look at the parameters passed to the subplan.
* SubPlan, we only need to look at the parameters passed to the subplan.
*/
bool
contain_var_reference(Node *node, int varno, int varattno, int levelsup)
@ -194,9 +194,9 @@ contain_var_reference_walker(Node *node,
* executed by the outer query. But short-circuit recursion into
* the subquery itself, which would be a waste of effort.
*/
SubPlanExpr *subplan = (SubPlanExpr *) node;
SubPlan *subplan = (SubPlan *) node;
if (contain_var_reference_walker((Node *) subplan->sublink->oper,
if (contain_var_reference_walker((Node *) subplan->oper,
context))
return true;
if (contain_var_reference_walker((Node *) subplan->args,