Fix platform dependant regression output triggered by 69f4b9c85f
.
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/22891.1484791792@sss.pgh.pa.us
This commit is contained in:
parent
ea15e18677
commit
182200531a
|
@ -115,6 +115,7 @@ SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC;
|
|||
(9 rows)
|
||||
|
||||
-- SRFs are computed after aggregation
|
||||
SET enable_hashagg TO 0; -- stable output order
|
||||
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa;
|
||||
dataa | count | min | max | unnest
|
||||
-------+-------+-----+-----+--------
|
||||
|
@ -127,17 +128,18 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few
|
|||
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[]);
|
||||
dataa | count | min | max | unnest
|
||||
-------+-------+-----+-----+--------
|
||||
a | 1 | 1 | 1 | 3
|
||||
a | 2 | 1 | 1 | 1
|
||||
a | 1 | 1 | 1 | 3
|
||||
(2 rows)
|
||||
|
||||
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, 5;
|
||||
dataa | count | min | max | unnest
|
||||
-------+-------+-----+-----+--------
|
||||
a | 1 | 1 | 1 | 3
|
||||
a | 2 | 1 | 1 | 1
|
||||
a | 1 | 1 | 1 | 3
|
||||
(2 rows)
|
||||
|
||||
RESET enable_hashagg;
|
||||
-- check HAVING works when GROUP BY does [not] reference SRF output
|
||||
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
|
||||
dataa | generate_series | count
|
||||
|
|
|
@ -31,10 +31,12 @@ SELECT few.id, generate_series(1,3) g FROM few ORDER BY id, generate_series(1,3)
|
|||
SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC;
|
||||
|
||||
-- SRFs are computed after aggregation
|
||||
SET enable_hashagg TO 0; -- stable output order
|
||||
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa;
|
||||
-- unless referenced in GROUP BY clause
|
||||
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[]);
|
||||
SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, 5;
|
||||
RESET enable_hashagg;
|
||||
|
||||
-- check HAVING works when GROUP BY does [not] reference SRF output
|
||||
SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
|
||||
|
|
Loading…
Reference in New Issue