Skip to content

Commit 9f478b4

Browse files
committed
Address portability issues in bfe16d1 test output.
1 parent bfe16d1 commit 9f478b4

File tree

2 files changed

+19
-26
lines changed

2 files changed

+19
-26
lines changed

src/test/regress/expected/tsrf.out

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,39 +130,32 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few
130130
(2 rows)
131131

132132
-- check HAVING works when GROUP BY does [not] reference SRF output
133-
SELECT dataa, generate_series(1,3), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
133+
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
134134
dataa | generate_series | count
135135
-------+-----------------+-------
136136
a | 1 | 2
137-
a | 2 | 2
138-
a | 3 | 2
139-
(3 rows)
137+
(1 row)
140138

141-
SELECT dataa, generate_series(1,3), count(*) FROM few GROUP BY 1, 2 HAVING count(*) > 1;
139+
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1, 2 HAVING count(*) > 1;
142140
dataa | generate_series | count
143141
-------+-----------------+-------
144142
a | 1 | 2
145-
a | 2 | 2
146-
a | 3 | 2
147-
(3 rows)
143+
(1 row)
148144

149145
-- it's weird to have GROUP BYs that increase the number of results
150-
SELECT few.dataa, count(*), min(id), max(id) FROM few GROUP BY few.dataa;
151-
dataa | count | min | max
152-
-------+-------+-----+-----
153-
b | 1 | 3 | 3
154-
a | 2 | 1 | 2
146+
SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa ORDER BY 2;
147+
dataa | count
148+
-------+-------
149+
a | 2
150+
(1 row)
151+
152+
SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest('{1,1,3}'::int[]) ORDER BY 2;
153+
dataa | count
154+
-------+-------
155+
a | 2
156+
a | 4
155157
(2 rows)
156158

157-
SELECT few.dataa, count(*), min(id), max(id) FROM few GROUP BY few.dataa, unnest('{1,1,3}'::int[]);
158-
dataa | count | min | max
159-
-------+-------+-----+-----
160-
b | 2 | 3 | 3
161-
a | 4 | 1 | 2
162-
b | 1 | 3 | 3
163-
a | 2 | 1 | 2
164-
(4 rows)
165-
166159
-- SRFs are not allowed in aggregate arguments
167160
SELECT min(generate_series(1, 3)) FROM few;
168161
ERROR: set-valued function called in context that cannot accept a set

src/test/regress/sql/tsrf.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few
3737
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, 5;
3838

3939
-- check HAVING works when GROUP BY does [not] reference SRF output
40-
SELECT dataa, generate_series(1,3), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
41-
SELECT dataa, generate_series(1,3), count(*) FROM few GROUP BY 1, 2 HAVING count(*) > 1;
40+
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
41+
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1, 2 HAVING count(*) > 1;
4242

4343
-- it's weird to have GROUP BYs that increase the number of results
44-
SELECT few.dataa, count(*), min(id), max(id) FROM few GROUP BY few.dataa;
45-
SELECT few.dataa, count(*), min(id), max(id) FROM few GROUP BY few.dataa, unnest('{1,1,3}'::int[]);
44+
SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa ORDER BY 2;
45+
SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest('{1,1,3}'::int[]) ORDER BY 2;
4646

4747
-- SRFs are not allowed in aggregate arguments
4848
SELECT min(generate_series(1, 3)) FROM few;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy