summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/aggregates.out
diff options
context:
space:
mode:
authorTom Lane2023-03-13 16:40:28 +0000
committerTom Lane2023-03-13 16:40:28 +0000
commit30dbdbe75384bcb034172c781b24bc982434a967 (patch)
treeabbade9a7c394f76d5e298a55c0d32c86bd1fc04 /src/test/regress/expected/aggregates.out
parent9f8377f7a27910bf0f35bf5169a8046731948a79 (diff)
Fix failure to detect some cases of improperly-nested aggregates.
check_agg_arguments_walker() supposed that it needn't descend into the arguments of a lower-level aggregate function, but this is just wrong in the presence of multiple levels of sub-select. The oversight would lead to executor failures on queries that should be rejected. (Prior to v11, they actually were rejected, thanks to a "redundant" execution-time check.) Per bug #17835 from Anban Company. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/test/regress/expected/aggregates.out')
-rw-r--r--src/test/regress/expected/aggregates.out6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index e074cb71bf6..f0517f95b60 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -1282,6 +1282,12 @@ select (select max(min(unique1)) from int8_tbl) from tenk1;
ERROR: aggregate function calls cannot be nested
LINE 1: select (select max(min(unique1)) from int8_tbl) from tenk1;
^
+select avg((select avg(a1.col1 order by (select avg(a2.col2) from tenk1 a3))
+ from tenk1 a1(col1)))
+from tenk1 a2(col2);
+ERROR: aggregate function calls cannot be nested
+LINE 1: select avg((select avg(a1.col1 order by (select avg(a2.col2)...
+ ^
--
-- Test removal of redundant GROUP BY columns
--