77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.22 1999/06/19 03:48:31 tgl Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.23 1999/06/21 01:18:02 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -43,9 +43,7 @@ static bool exprIsAggOrGroupCol_walker(Node *node, List *groupClauses);
4343 * Returns true if any aggregate found.
4444 *
4545 * NOTE: we assume that the given clause has been transformed suitably for
46- * parser output. This means we can use the planner's expression_tree_walker,
47- * except that we have to process SubLink nodes specially, since they haven't
48- * been turned into SubPlan nodes yet.
46+ * parser output. This means we can use the planner's expression_tree_walker.
4947 */
5048static bool
5149contain_agg_clause (Node * clause )
@@ -60,12 +58,6 @@ contain_agg_clause_walker(Node *node, void *context)
6058return false;
6159if (IsA (node ,Aggref ))
6260return true;/* abort the tree traversal and return true */
63- if (IsA (node ,SubLink ))
64- {
65- /* Examine the lefthand side, but not the oper list nor the subquery */
66- SubLink * sublink = (SubLink * )node ;
67- return contain_agg_clause_walker ((Node * )sublink -> lefthand ,context );
68- }
6961return expression_tree_walker (node ,contain_agg_clause_walker ,context );
7062}
7163
@@ -75,16 +67,15 @@ contain_agg_clause_walker(Node *node, void *context)
7567 * other than within the arguments of aggregate functions.
7668 *
7769 * NOTE: we assume that the given clause has been transformed suitably for
78- * parser output. This means we can use the planner's expression_tree_walker,
79- * except that we have to process SubLink nodes specially, since they haven't
80- * been turned into SubPlan nodes yet.
70+ * parser output. This means we can use the planner's expression_tree_walker.
8171 *
82- * NOTE: in the case of a SubLink, we do not descend into the subquery. This
83- * means we will fail to detect ungrouped columns that appear as outer-level
84- * variables within a subquery. That seems unreasonably hard to handle here.
85- * Instead, we expect the planner to check for ungrouped columns after it's
86- * found all the outer-level references inside the subquery and converted
87- * them into a list of parameters for the subquery.
72+ * NOTE: in the case of a SubLink, expression_tree_walker does not descend
73+ * into the subquery. This means we will fail to detect ungrouped columns
74+ * that appear as outer-level variables within a subquery. That case seems
75+ * unreasonably hard to handle here. Instead, we expect the planner to check
76+ * for ungrouped columns after it's found all the outer-level references
77+ * inside the subquery and converted them into a list of parameters for the
78+ * subquery.
8879 */
8980static bool
9081exprIsAggOrGroupCol (Node * expr ,List * groupClauses )
@@ -128,13 +119,6 @@ exprIsAggOrGroupCol_walker(Node *node, List *groupClauses)
128119return false;/* outer-level Var is acceptable */
129120}
130121/* Otherwise, recurse. */
131- if (IsA (node ,SubLink ))
132- {
133- /* Examine the lefthand side, but not the oper list nor the subquery */
134- SubLink * sublink = (SubLink * )node ;
135- return exprIsAggOrGroupCol_walker ((Node * )sublink -> lefthand ,
136- groupClauses );
137- }
138122return expression_tree_walker (node ,exprIsAggOrGroupCol_walker ,
139123 (void * )groupClauses );
140124}