Commit 18220053 authored by Andres Freund's avatar Andres Freund

Fix platform dependant regression output triggered by 69f4b9c8.

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
parent ea15e186
...@@ -115,6 +115,7 @@ SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC; ...@@ -115,6 +115,7 @@ SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC;
(9 rows) (9 rows)
-- SRFs are computed after aggregation -- 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; 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 dataa | count | min | max | unnest
-------+-------+-----+-----+-------- -------+-------+-----+-----+--------
...@@ -127,17 +128,18 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few ...@@ -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[]); 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 dataa | count | min | max | unnest
-------+-------+-----+-----+-------- -------+-------+-----+-----+--------
a | 1 | 1 | 1 | 3
a | 2 | 1 | 1 | 1 a | 2 | 1 | 1 | 1
a | 1 | 1 | 1 | 3
(2 rows) (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; 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 dataa | count | min | max | unnest
-------+-------+-----+-----+-------- -------+-------+-----+-----+--------
a | 1 | 1 | 1 | 3
a | 2 | 1 | 1 | 1 a | 2 | 1 | 1 | 1
a | 1 | 1 | 1 | 3
(2 rows) (2 rows)
RESET enable_hashagg;
-- check HAVING works when GROUP BY does [not] reference SRF output -- 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; SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
dataa | generate_series | count 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) ...@@ -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; SELECT few.id FROM few ORDER BY id, generate_series(1,3) DESC;
-- SRFs are computed after aggregation -- 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; 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 -- 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, 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; 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 -- 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; SELECT dataa, generate_series(1,1), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment