Skip to content
Snippets Groups Projects
Commit dfaf9fbc authored by Tom Lane's avatar Tom Lane
Browse files

Add a regression test case to catch breakage of GROUP BY

and aggregate functions in queries that use inheritance.
parent b4210ae0
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,13 @@ SELECT class, c FROM e_star* x WHERE x.c NOTNULL;
SELECT * FROM f_star* x WHERE x.c ISNULL;
-- grouping and aggregation on inherited sets have been busted in the past...
SELECT sum(a) FROM a_star*;
SELECT class, sum(a) FROM a_star* GROUP BY class;
ALTER TABLE f_star RENAME COLUMN f TO ff;
ALTER TABLE e_star* RENAME COLUMN e TO ee;
......
......@@ -178,6 +178,23 @@ f | | | |((11111111,33333333),(22222222,44444444))
f | | | |
(8 rows)
QUERY: SELECT sum(a) FROM a_star*;
sum
---
355
(1 row)
QUERY: SELECT class, sum(a) FROM a_star* GROUP BY class;
class|sum
-----+---
a | 3
b | 7
c | 11
d | 84
e | 66
f |184
(6 rows)
QUERY: ALTER TABLE f_star RENAME COLUMN f TO ff;
QUERY: ALTER TABLE e_star* RENAME COLUMN e TO ee;
QUERY: ALTER TABLE d_star* RENAME COLUMN d TO dd;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment