7
7
*
8
8
*
9
9
* 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 $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -43,9 +43,7 @@ static bool exprIsAggOrGroupCol_walker(Node *node, List *groupClauses);
43
43
* Returns true if any aggregate found.
44
44
*
45
45
* 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.
49
47
*/
50
48
static bool
51
49
contain_agg_clause (Node * clause )
@@ -60,12 +58,6 @@ contain_agg_clause_walker(Node *node, void *context)
60
58
return false;
61
59
if (IsA (node , Aggref ))
62
60
return 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
- }
69
61
return expression_tree_walker (node , contain_agg_clause_walker , context );
70
62
}
71
63
@@ -75,16 +67,15 @@ contain_agg_clause_walker(Node *node, void *context)
75
67
* other than within the arguments of aggregate functions.
76
68
*
77
69
* 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.
81
71
*
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.
88
79
*/
89
80
static bool
90
81
exprIsAggOrGroupCol (Node * expr , List * groupClauses )
@@ -128,13 +119,6 @@ exprIsAggOrGroupCol_walker(Node *node, List *groupClauses)
128
119
return false; /* outer-level Var is acceptable */
129
120
}
130
121
/* 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
- }
138
122
return expression_tree_walker (node , exprIsAggOrGroupCol_walker ,
139
123
(void * ) groupClauses );
140
124
}
0 commit comments