Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4cb0d28

Browse files
maksm90Commitfest Bot
authored and
Commitfest Bot
committed
Adjust regression tests
1 parent c99e9a4 commit 4cb0d28

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

src/test/regress/expected/join.out

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5384,14 +5384,14 @@ select * from
53845384
(select 1 as id) as xx
53855385
left join
53865386
(tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
5387-
on (xx.id = coalesce(yy.id));
5388-
QUERY PLAN
5389-
---------------------------------------
5387+
on (xx.id = coalesce(yy.id, 0));
5388+
QUERY PLAN
5389+
----------------------------------------
53905390
Nested Loop Left Join
53915391
-> Result
53925392
-> Hash Full Join
53935393
Hash Cond: (a1.unique1 = (1))
5394-
Filter: (1 = COALESCE((1)))
5394+
Filter: (1 = COALESCE((1), 0))
53955395
-> Seq Scan on tenk1 a1
53965396
-> Hash
53975397
-> Result
@@ -5401,7 +5401,7 @@ select * from
54015401
(select 1 as id) as xx
54025402
left join
54035403
(tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
5404-
on (xx.id = coalesce(yy.id));
5404+
on (xx.id = coalesce(yy.id, 0));
54055405
id | unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 | id
54065406
----+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------+----
54075407
1 | 1 | 2838 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | EFEAAA | OOOOxx | 1
@@ -8169,20 +8169,20 @@ select * from int4_tbl i left join
81698169

81708170
explain (verbose, costs off)
81718171
select * from int4_tbl i left join
8172-
lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
8173-
QUERY PLAN
8174-
-------------------------------------
8172+
lateral (select coalesce(i, row(0)::int4_tbl) from int2_tbl j where i.f1 = j.f1) k on true;
8173+
QUERY PLAN
8174+
------------------------------------------------------
81758175
Nested Loop Left Join
8176-
Output: i.f1, (COALESCE(i.*))
8176+
Output: i.f1, (COALESCE(i.*, '(0)'::int4_tbl))
81778177
-> Seq Scan on public.int4_tbl i
81788178
Output: i.f1, i.*
81798179
-> Seq Scan on public.int2_tbl j
8180-
Output: j.f1, COALESCE(i.*)
8180+
Output: j.f1, COALESCE(i.*, '(0)'::int4_tbl)
81818181
Filter: (i.f1 = j.f1)
81828182
(7 rows)
81838183

81848184
select * from int4_tbl i left join
8185-
lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
8185+
lateral (select coalesce(i, row(0)::int4_tbl) from int2_tbl j where i.f1 = j.f1) k on true;
81868186
f1 | coalesce
81878187
-------------+----------
81888188
0 | (0)
@@ -9351,14 +9351,14 @@ CREATE STATISTICS group_tbl_stat (ndistinct) ON a, b FROM group_tbl;
93519351
ANALYZE group_tbl;
93529352
EXPLAIN (COSTS OFF)
93539353
SELECT 1 FROM group_tbl t1
9354-
LEFT JOIN (SELECT a c1, COALESCE(a) c2 FROM group_tbl t2) s ON TRUE
9354+
LEFT JOIN (SELECT a c1, COALESCE(a, 0) c2 FROM group_tbl t2) s ON TRUE
93559355
GROUP BY s.c1, s.c2;
9356-
QUERY PLAN
9357-
--------------------------------------------
9356+
QUERY PLAN
9357+
---------------------------------------------
93589358
Group
9359-
Group Key: t2.a, (COALESCE(t2.a))
9359+
Group Key: t2.a, (COALESCE(t2.a, 0))
93609360
-> Sort
9361-
Sort Key: t2.a, (COALESCE(t2.a))
9361+
Sort Key: t2.a, (COALESCE(t2.a, 0))
93629362
-> Nested Loop Left Join
93639363
-> Seq Scan on group_tbl t1
93649364
-> Seq Scan on group_tbl t2

src/test/regress/expected/subselect.out

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,30 +2127,30 @@ explain (verbose, costs off)
21272127
select ss2.* from
21282128
int8_tbl t1 left join
21292129
(int8_tbl t2 left join
2130-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
2130+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
21312131
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
21322132
on t1.q2 = ss2.q1
21332133
order by 1, 2, 3;
2134-
QUERY PLAN
2135-
----------------------------------------------------------------
2134+
QUERY PLAN
2135+
-----------------------------------------------------------------------------
21362136
Sort
2137-
Output: (COALESCE(t3.q1)), t4.q1, t4.q2
2138-
Sort Key: (COALESCE(t3.q1)), t4.q1, t4.q2
2137+
Output: (COALESCE(t3.q1, '0'::bigint)), t4.q1, t4.q2
2138+
Sort Key: (COALESCE(t3.q1, '0'::bigint)), t4.q1, t4.q2
21392139
-> Hash Right Join
2140-
Output: (COALESCE(t3.q1)), t4.q1, t4.q2
2140+
Output: (COALESCE(t3.q1, '0'::bigint)), t4.q1, t4.q2
21412141
Hash Cond: (t4.q1 = t1.q2)
21422142
-> Hash Join
2143-
Output: (COALESCE(t3.q1)), t4.q1, t4.q2
2143+
Output: (COALESCE(t3.q1, '0'::bigint)), t4.q1, t4.q2
21442144
Hash Cond: (t2.q2 = t4.q1)
21452145
-> Hash Left Join
2146-
Output: t2.q2, (COALESCE(t3.q1))
2146+
Output: t2.q2, (COALESCE(t3.q1, '0'::bigint))
21472147
Hash Cond: (t2.q1 = t3.q2)
21482148
-> Seq Scan on public.int8_tbl t2
21492149
Output: t2.q1, t2.q2
21502150
-> Hash
2151-
Output: t3.q2, (COALESCE(t3.q1))
2151+
Output: t3.q2, (COALESCE(t3.q1, '0'::bigint))
21522152
-> Seq Scan on public.int8_tbl t3
2153-
Output: t3.q2, COALESCE(t3.q1)
2153+
Output: t3.q2, COALESCE(t3.q1, '0'::bigint)
21542154
-> Hash
21552155
Output: t4.q1, t4.q2
21562156
-> Seq Scan on public.int8_tbl t4
@@ -2164,7 +2164,7 @@ order by 1, 2, 3;
21642164
select ss2.* from
21652165
int8_tbl t1 left join
21662166
(int8_tbl t2 left join
2167-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
2167+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
21682168
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
21692169
on t1.q2 = ss2.q1
21702170
order by 1, 2, 3;
@@ -2201,32 +2201,32 @@ explain (verbose, costs off)
22012201
select ss2.* from
22022202
int8_tbl t1 left join
22032203
(int8_tbl t2 left join
2204-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
2204+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
22052205
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
22062206
on t1.q2 = ss2.q1
22072207
order by 1, 2, 3;
2208-
QUERY PLAN
2209-
----------------------------------------------------------------
2208+
QUERY PLAN
2209+
-----------------------------------------------------------------------------
22102210
Sort
2211-
Output: ((COALESCE(t3.q1))), t4.q1, t4.q2
2212-
Sort Key: ((COALESCE(t3.q1))), t4.q1, t4.q2
2211+
Output: ((COALESCE(t3.q1, '0'::bigint))), t4.q1, t4.q2
2212+
Sort Key: ((COALESCE(t3.q1, '0'::bigint))), t4.q1, t4.q2
22132213
-> Hash Right Join
2214-
Output: ((COALESCE(t3.q1))), t4.q1, t4.q2
2214+
Output: ((COALESCE(t3.q1, '0'::bigint))), t4.q1, t4.q2
22152215
Hash Cond: (t4.q1 = t1.q2)
22162216
-> Nested Loop
2217-
Output: t4.q1, t4.q2, ((COALESCE(t3.q1)))
2217+
Output: t4.q1, t4.q2, ((COALESCE(t3.q1, '0'::bigint)))
22182218
Join Filter: (t2.q2 = t4.q1)
22192219
-> Hash Left Join
2220-
Output: t2.q2, (COALESCE(t3.q1))
2220+
Output: t2.q2, (COALESCE(t3.q1, '0'::bigint))
22212221
Hash Cond: (t2.q1 = t3.q2)
22222222
-> Seq Scan on public.int8_tbl t2
22232223
Output: t2.q1, t2.q2
22242224
-> Hash
2225-
Output: t3.q2, (COALESCE(t3.q1))
2225+
Output: t3.q2, (COALESCE(t3.q1, '0'::bigint))
22262226
-> Seq Scan on public.int8_tbl t3
2227-
Output: t3.q2, COALESCE(t3.q1)
2227+
Output: t3.q2, COALESCE(t3.q1, '0'::bigint)
22282228
-> Seq Scan on public.int8_tbl t4
2229-
Output: t4.q1, t4.q2, (COALESCE(t3.q1))
2229+
Output: t4.q1, t4.q2, (COALESCE(t3.q1, '0'::bigint))
22302230
-> Hash
22312231
Output: t1.q2
22322232
-> Seq Scan on public.int8_tbl t1
@@ -2236,7 +2236,7 @@ order by 1, 2, 3;
22362236
select ss2.* from
22372237
int8_tbl t1 left join
22382238
(int8_tbl t2 left join
2239-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
2239+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
22402240
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
22412241
on t1.q2 = ss2.q1
22422242
order by 1, 2, 3;

src/test/regress/sql/join.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,13 +1902,13 @@ select * from
19021902
(select 1 as id) as xx
19031903
left join
19041904
(tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
1905-
on (xx.id = coalesce(yy.id));
1905+
on (xx.id = coalesce(yy.id, 0));
19061906

19071907
select * from
19081908
(select 1 as id) as xx
19091909
left join
19101910
(tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
1911-
on (xx.id = coalesce(yy.id));
1911+
on (xx.id = coalesce(yy.id, 0));
19121912

19131913
--
19141914
-- test ability to push constants through outer join clauses
@@ -3094,9 +3094,9 @@ select * from int4_tbl i left join
30943094
lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
30953095
explain (verbose, costs off)
30963096
select * from int4_tbl i left join
3097-
lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
3097+
lateral (select coalesce(i, row(0)::int4_tbl) from int2_tbl j where i.f1 = j.f1) k on true;
30983098
select * from int4_tbl i left join
3099-
lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
3099+
lateral (select coalesce(i, row(0)::int4_tbl) from int2_tbl j where i.f1 = j.f1) k on true;
31003100
explain (verbose, costs off)
31013101
select * from int4_tbl a,
31023102
lateral (
@@ -3562,7 +3562,7 @@ ANALYZE group_tbl;
35623562

35633563
EXPLAIN (COSTS OFF)
35643564
SELECT 1 FROM group_tbl t1
3565-
LEFT JOIN (SELECT a c1, COALESCE(a) c2 FROM group_tbl t2) s ON TRUE
3565+
LEFT JOIN (SELECT a c1, COALESCE(a, 0) c2 FROM group_tbl t2) s ON TRUE
35663566
GROUP BY s.c1, s.c2;
35673567

35683568
DROP TABLE group_tbl;

src/test/regress/sql/subselect.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,15 +1041,15 @@ explain (verbose, costs off)
10411041
select ss2.* from
10421042
int8_tbl t1 left join
10431043
(int8_tbl t2 left join
1044-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
1044+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
10451045
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
10461046
on t1.q2 = ss2.q1
10471047
order by 1, 2, 3;
10481048

10491049
select ss2.* from
10501050
int8_tbl t1 left join
10511051
(int8_tbl t2 left join
1052-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
1052+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 inner join
10531053
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
10541054
on t1.q2 = ss2.q1
10551055
order by 1, 2, 3;
@@ -1059,15 +1059,15 @@ explain (verbose, costs off)
10591059
select ss2.* from
10601060
int8_tbl t1 left join
10611061
(int8_tbl t2 left join
1062-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
1062+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
10631063
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
10641064
on t1.q2 = ss2.q1
10651065
order by 1, 2, 3;
10661066

10671067
select ss2.* from
10681068
int8_tbl t1 left join
10691069
(int8_tbl t2 left join
1070-
(select coalesce(q1) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
1070+
(select coalesce(q1, 0) as x, * from int8_tbl t3) ss1 on t2.q1 = ss1.q2 left join
10711071
lateral (select ss1.x as y, * from int8_tbl t4) ss2 on t2.q2 = ss2.q1)
10721072
on t1.q2 = ss2.q1
10731073
order by 1, 2, 3;

0 commit comments

Comments
 (0)