Skip to content

Commit 73ada4c

Browse files
craig[bot]yuzefovich
andcommitted
Merge #160050
160050: roachtest/pg_regress: accept recent diff r=yuzefovich a=yuzefovich Fixes: #158487. Release note: None Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
2 parents ee56624 + 09d521f commit 73ada4c

File tree

17 files changed

+663
-668
lines changed

17 files changed

+663
-668
lines changed

pkg/cmd/roachtest/testdata/pg_regress/aggregates.diffs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
14461446
--
14471447
-- Test combinations of DISTINCT and/or ORDER BY
14481448
--
1449-
@@ -1595,246 +1418,186 @@
1449+
@@ -1595,246 +1418,182 @@
14501450

14511451
select array_agg(distinct a order by a)
14521452
from (values (1),(2),(1),(3),(null),(2)) v(a);
@@ -1786,7 +1786,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
17861786
-- string_agg tests
17871787
select string_agg(a,',') from (values('aaaa'),('bbbb'),('cccc')) g(a);
17881788
string_agg
1789-
@@ -1862,25 +1625,29 @@
1789+
@@ -1862,25 +1621,29 @@
17901790

17911791
-- check some implicit casting cases, as per bug #5564
17921792
select string_agg(distinct f1, ',' order by f1) from varchar_tbl; -- ok
@@ -1832,7 +1832,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
18321832
-- string_agg bytea tests
18331833
create table bytea_test_table(v bytea);
18341834
select string_agg(v, '') from bytea_test_table;
1835-
@@ -1922,11 +1689,60 @@
1835+
@@ -1922,11 +1685,60 @@
18361836
select (case x % 4 when 1 then null else x end), x % 10
18371837
from generate_series(1,5000) x;
18381838
set parallel_setup_cost TO 0;
@@ -1893,7 +1893,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
18931893
-- create a view as we otherwise have to repeat this query a few times.
18941894
create view v_pagg_test AS
18951895
select
1896-
@@ -1954,66 +1770,92 @@
1896+
@@ -1954,66 +1766,92 @@
18971897
) a1
18981898
) a2
18991899
group by y;
@@ -2031,7 +2031,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
20312031
drop table pagg_test;
20322032
-- FILTER tests
20332033
select min(unique1) filter (where unique1 > 100) from tenk1;
2034-
@@ -2023,13 +1865,9 @@
2034+
@@ -2023,13 +1861,9 @@
20352035
(1 row)
20362036

20372037
select sum(1/ten) filter (where ten > 0) from tenk1;
@@ -2047,7 +2047,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
20472047
ten | sum
20482048
-----+-----
20492049
0 |
2050-
@@ -2045,17 +1883,14 @@
2050+
@@ -2045,17 +1879,14 @@
20512051
(10 rows)
20522052

20532053
select ten, sum(distinct four) filter (where four > 10) from onek a
@@ -2072,7 +2072,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
20722072
select max(foo COLLATE "C") filter (where (bar collate "POSIX") > '0')
20732073
from (values ('a', 'b')) AS v(foo,bar);
20742074
max
2075-
@@ -2064,11 +1899,7 @@
2075+
@@ -2064,11 +1895,7 @@
20762076
(1 row)
20772077

20782078
select any_value(v) filter (where v > 2) from (values (1), (2), (3)) as v (v);
@@ -2085,7 +2085,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
20852085
-- outer reference in FILTER (PostgreSQL extension)
20862086
select (select count(*)
20872087
from (values (1)) t0(inner_c))
2088-
@@ -2117,11 +1948,10 @@
2088+
@@ -2117,11 +1944,10 @@
20892089
select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1)
20902090
from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
20912091
generate_series(1,2) i;
@@ -2101,7 +2101,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
21012101
-- check handling of bare boolean Var in FILTER
21022102
select max(0) filter (where b1) from bool_test;
21032103
max
2104-
@@ -2137,78 +1967,49 @@
2104+
@@ -2137,78 +1963,49 @@
21052105

21062106
-- check for correct detection of nested-aggregate errors in FILTER
21072107
select max(unique1) filter (where sum(ten) > 0) from tenk1;
@@ -2196,7 +2196,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
21962196
select percentile_disc(0.5) within group (order by thousand) from tenk1;
21972197
percentile_disc
21982198
-----------------
2199-
@@ -2217,161 +2018,97 @@
2199+
@@ -2217,161 +2014,97 @@
22002200

22012201
select rank(3) within group (order by x)
22022202
from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
@@ -2402,7 +2402,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
24022402
-- deparse and multiple features:
24032403
create view aggordview1 as
24042404
select ten,
2405-
@@ -2380,73 +2117,83 @@
2405+
@@ -2380,73 +2113,83 @@
24062406
rank(5,'AZZZZ',50) within group (order by hundred, string4 desc, hundred)
24072407
from tenk1
24082408
group by ten order by ten;
@@ -2538,7 +2538,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
25382538
create type avg_state as (total bigint, count bigint);
25392539
create or replace function avg_transfn(state avg_state, n int) returns avg_state as
25402540
$$
2541-
@@ -2469,6 +2216,10 @@
2541+
@@ -2469,6 +2212,10 @@
25422542
return null;
25432543
end
25442544
$$ language plpgsql;
@@ -2549,7 +2549,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
25492549
create function avg_finalfn(state avg_state) returns int4 as
25502550
$$
25512551
begin
2552-
@@ -2479,6 +2230,10 @@
2552+
@@ -2479,6 +2226,10 @@
25532553
end if;
25542554
end
25552555
$$ language plpgsql;
@@ -2560,7 +2560,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
25602560
create function sum_finalfn(state avg_state) returns int4 as
25612561
$$
25622562
begin
2563-
@@ -2489,106 +2244,70 @@
2563+
@@ -2489,106 +2240,70 @@
25642564
end if;
25652565
end
25662566
$$ language plpgsql;
@@ -2693,7 +2693,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
26932693
-- test that aggs with the same sfunc and initcond share the same agg state
26942694
create aggregate my_sum_init(int4)
26952695
(
2696-
@@ -2597,6 +2316,12 @@
2696+
@@ -2597,6 +2312,12 @@
26972697
finalfunc = sum_finalfn,
26982698
initcond = '(10,0)'
26992699
);
@@ -2706,7 +2706,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
27062706
create aggregate my_avg_init(int4)
27072707
(
27082708
stype = avg_state,
2709-
@@ -2604,6 +2329,12 @@
2709+
@@ -2604,6 +2325,12 @@
27102710
finalfunc = avg_finalfn,
27112711
initcond = '(10,0)'
27122712
);
@@ -2719,7 +2719,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
27192719
create aggregate my_avg_init2(int4)
27202720
(
27212721
stype = avg_state,
2722-
@@ -2611,30 +2342,28 @@
2722+
@@ -2611,30 +2338,28 @@
27232723
finalfunc = avg_finalfn,
27242724
initcond = '(4,0)'
27252725
);
@@ -2764,7 +2764,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
27642764
create or replace function sum_transfn(state int4, n int4) returns int4 as
27652765
$$
27662766
declare new_state int4;
2767-
@@ -2664,29 +2393,35 @@
2767+
@@ -2664,29 +2389,35 @@
27682768
end if;
27692769
end
27702770
$$ language plpgsql;
@@ -2809,7 +2809,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
28092809
-- test that the aggregate transition logic correctly handles
28102810
-- transition / combine functions returning NULL
28112811
-- First test the case of a normal transition function returning NULL
2812-
@@ -2701,6 +2436,8 @@
2812+
@@ -2701,6 +2432,8 @@
28132813
END IF;
28142814
RETURN NULL;
28152815
END$$;
@@ -2818,7 +2818,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
28182818
CREATE AGGREGATE balk(int4)
28192819
(
28202820
SFUNC = balkifnull(int8, int4),
2821-
@@ -2708,13 +2445,16 @@
2821+
@@ -2708,13 +2441,16 @@
28222822
PARALLEL = SAFE,
28232823
INITCOND = '0'
28242824
);
@@ -2840,7 +2840,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
28402840
-- Secondly test the case of a parallel aggregate combiner function
28412841
-- returning NULL. For that use normal transition function, but a
28422842
-- combiner function returning NULL.
2843-
@@ -2730,6 +2470,23 @@
2843+
@@ -2730,6 +2466,23 @@
28442844
END IF;
28452845
RETURN NULL;
28462846
END$$;
@@ -2864,7 +2864,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
28642864
CREATE AGGREGATE balk(int4)
28652865
(
28662866
SFUNC = int4_sum(int8, int4),
2867-
@@ -2738,26 +2495,27 @@
2867+
@@ -2738,26 +2491,27 @@
28682868
PARALLEL = SAFE,
28692869
INITCOND = '0'
28702870
);
@@ -2906,7 +2906,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
29062906
ROLLBACK;
29072907
-- test multiple usage of an aggregate whose finalfn returns a R/W datum
29082908
BEGIN;
2909-
@@ -2767,6 +2525,8 @@
2909+
@@ -2767,6 +2521,8 @@
29102910
RETURN array_fill(y[1], ARRAY[4]);
29112911
END;
29122912
$$;
@@ -2915,7 +2915,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
29152915
CREATE FUNCTION rwagg_finalfunc(x anyarray) RETURNS anyarray
29162916
LANGUAGE plpgsql STRICT IMMUTABLE AS $$
29172917
DECLARE
2918-
@@ -2777,11 +2537,25 @@
2918+
@@ -2777,11 +2533,25 @@
29192919
RETURN res;
29202920
END;
29212921
$$;
@@ -2941,7 +2941,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
29412941
CREATE FUNCTION eatarray(x real[]) RETURNS real[]
29422942
LANGUAGE plpgsql STRICT IMMUTABLE AS $$
29432943
BEGIN
2944-
@@ -2789,21 +2563,44 @@
2944+
@@ -2789,21 +2559,44 @@
29452945
RETURN x;
29462946
END;
29472947
$$;
@@ -2991,7 +2991,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
29912991
-- variance(int4) covers numeric_poly_combine
29922992
-- sum(int8) covers int8_avg_combine
29932993
-- regr_count(float8, float8) covers int8inc_float8_float8 and aggregates with > 1 arg
2994-
@@ -2813,36 +2610,17 @@
2994+
@@ -2813,36 +2606,17 @@
29952995
UNION ALL SELECT * FROM tenk1
29962996
UNION ALL SELECT * FROM tenk1
29972997
UNION ALL SELECT * FROM tenk1) u;
@@ -3034,7 +3034,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
30343034
-- variance(int8) covers numeric_combine
30353035
-- avg(numeric) covers numeric_avg_combine
30363036
EXPLAIN (COSTS OFF, VERBOSE)
3037-
@@ -2851,46 +2629,22 @@
3037+
@@ -2851,46 +2625,22 @@
30383038
UNION ALL SELECT * FROM tenk1
30393039
UNION ALL SELECT * FROM tenk1
30403040
UNION ALL SELECT * FROM tenk1) u;
@@ -3089,7 +3089,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
30893089
-- Ensure that the STRICT checks for aggregates does not take NULLness
30903090
-- of ORDER BY columns into account. See bug report around
30913091
-- 2a505161-2727-2473-7c46-591ed108ac52@email.cz
3092-
@@ -2929,27 +2683,46 @@
3092+
@@ -2929,27 +2679,46 @@
30933093
-- does not lead to array overflow due to unexpected duplicate hash keys
30943094
-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
30953095
set enable_memoize to off;
@@ -3148,7 +3148,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
31483148
select unique1, count(*), sum(twothousand) from tenk1
31493149
group by unique1
31503150
having sum(fivethous) > 4975
3151-
@@ -3007,36 +2780,84 @@
3151+
@@ -3007,36 +2776,84 @@
31523152
(48 rows)
31533153

31543154
set work_mem to default;
@@ -3242,7 +3242,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
32423242
create table agg_group_2 as
32433243
select * from
32443244
(values (100), (300), (500)) as r(a),
3245-
@@ -3047,30 +2868,58 @@
3245+
@@ -3047,30 +2864,58 @@
32463246
from agg_data_2k
32473247
where g < r.a
32483248
group by g/2) as s;
@@ -3308,7 +3308,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/aggregates.out --
33083308
create table agg_hash_2 as
33093309
select * from
33103310
(values (100), (300), (500)) as r(a),
3311-
@@ -3081,15 +2930,43 @@
3311+
@@ -3081,15 +2926,43 @@
33123312
from agg_data_2k
33133313
where g < r.a
33143314
group by g/2) as s;

0 commit comments

Comments
 (0)