Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f478b4

Browse files
committed
Address portability issues inbfe16d1 test output.
1 parentbfe16d1 commit9f478b4

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
SELECTfew.dataa,count(*),min(id),max(id), unnest('{1,1,3}'::int[])FROM fewWHEREfew.id=1GROUP BYfew.dataa,5;
3838

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

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp