Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1822005

Browse files
committed
Fix platform dependant regression output triggered by 69f4b9c.
Due to the changed costing in that commit hash-aggregates started to be used, which results in big-endian vs. little-endian output differences. Disable hash-aggs for those tests. Author: Andres Freund, with input from Tom Lane Discussion: https://postgr.es/m/[email protected]
1 parent ea15e18 commit 1822005

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/test/regress/expected/tsrf.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC;
115115
(9 rows)
116116

117117
-- SRFs are computed after aggregation
118+
SET enable_hashagg TO 0; -- stable output order
118119
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa;
119120
dataa | count | min | max | unnest
120121
-------+-------+-----+-----+--------
@@ -127,17 +128,18 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few
127128
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, unnest('{1,1,3}'::int[]);
128129
dataa | count | min | max | unnest
129130
-------+-------+-----+-----+--------
130-
a | 1 | 1 | 1 | 3
131131
a | 2 | 1 | 1 | 1
132+
a | 1 | 1 | 1 | 3
132133
(2 rows)
133134

134135
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, 5;
135136
dataa | count | min | max | unnest
136137
-------+-------+-----+-----+--------
137-
a | 1 | 1 | 1 | 3
138138
a | 2 | 1 | 1 | 1
139+
a | 1 | 1 | 1 | 3
139140
(2 rows)
140141

142+
RESET enable_hashagg;
141143
-- check HAVING works when GROUP BY does [not] reference SRF output
142144
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
143145
dataa | generate_series | count

src/test/regress/sql/tsrf.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ SELECT few.id, generate_series(1,3) g FROM few ORDER BY id, generate_series(1,3)
3131
SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC;
3232

3333
-- SRFs are computed after aggregation
34+
SET enable_hashagg TO 0; -- stable output order
3435
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa;
3536
-- unless referenced in GROUP BY clause
3637
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, unnest('{1,1,3}'::int[]);
3738
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, 5;
39+
RESET enable_hashagg;
3840

3941
-- check HAVING works when GROUP BY does [not] reference SRF output
4042
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;

0 commit comments

Comments
 (0)