projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b90887
)
A subplan invoked within an aggregate function's argument should
author
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 8 Mar 2001 01:49:01 +0000
(
01:49
+0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 8 Mar 2001 01:49:01 +0000
(
01:49
+0000)
be allowed to receive ungrouped variables of the current query level.
Curious that no one reported this bug before...
src/backend/optimizer/util/clauses.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/optimizer/util/clauses.c
b/src/backend/optimizer/util/clauses.c
index 5ab45f67ac2001f355e92d3a78c0896ad9bc3948..9a3ac105365a435ed8f2d4a61474854280bee3bc 100644
(file)
--- a/
src/backend/optimizer/util/clauses.c
+++ b/
src/backend/optimizer/util/clauses.c
@@
-542,6
+542,14
@@
check_subplans_for_ungrouped_vars_walker(Node *node,
if (node == NULL)
return false;
+ /*
+ * If we find an aggregate function, do not recurse into its
+ * arguments. Subplans invoked within aggregate calls are allowed
+ * to receive ungrouped variables.
+ */
+ if (IsA(node, Aggref))
+ return false;
+
/*
* We can ignore Vars other than in subplan args lists, since the
* parser already checked 'em.