Skip to content

Commit 0cd7878

Browse files
committed
Rename a function to avoid naming conflict in parallel regression tests.
Commit 31a8918 added some tests in plpgsql.sql that used a function rather unthinkingly named "foo()". However, rangefuncs.sql has some much older tests that create a function of that name, and since these test scripts run in parallel, there is a chance of failures if the timing is just right. Use another name to avoid that. Per buildfarm (failure seen today on "hamerkop", but probably it's happened before and not been noticed).
1 parent 7919398 commit 0cd7878

File tree

2 files changed

+64
-64
lines changed

2 files changed

+64
-64
lines changed

src/test/regress/expected/plpgsql.out

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,112 +3627,112 @@ drop table tabwithcols;
36273627
--
36283628
-- Tests for composite-type results
36293629
--
3630-
create type footype as (x int, y varchar);
3630+
create type compostype as (x int, y varchar);
36313631
-- test: use of variable of composite type in return statement
3632-
create or replace function foo() returns footype as $$
3632+
create or replace function compos() returns compostype as $$
36333633
declare
3634-
v footype;
3634+
v compostype;
36353635
begin
36363636
v := (1, 'hello');
36373637
return v;
36383638
end;
36393639
$$ language plpgsql;
3640-
select foo();
3641-
foo
3640+
select compos();
3641+
compos
36423642
-----------
36433643
(1,hello)
36443644
(1 row)
36453645

36463646
-- test: use of variable of record type in return statement
3647-
create or replace function foo() returns footype as $$
3647+
create or replace function compos() returns compostype as $$
36483648
declare
36493649
v record;
36503650
begin
36513651
v := (1, 'hello'::varchar);
36523652
return v;
36533653
end;
36543654
$$ language plpgsql;
3655-
select foo();
3656-
foo
3655+
select compos();
3656+
compos
36573657
-----------
36583658
(1,hello)
36593659
(1 row)
36603660

36613661
-- test: use of row expr in return statement
3662-
create or replace function foo() returns footype as $$
3662+
create or replace function compos() returns compostype as $$
36633663
begin
36643664
return (1, 'hello'::varchar);
36653665
end;
36663666
$$ language plpgsql;
3667-
select foo();
3668-
foo
3667+
select compos();
3668+
compos
36693669
-----------
36703670
(1,hello)
36713671
(1 row)
36723672

36733673
-- this does not work currently (no implicit casting)
3674-
create or replace function foo() returns footype as $$
3674+
create or replace function compos() returns compostype as $$
36753675
begin
36763676
return (1, 'hello');
36773677
end;
36783678
$$ language plpgsql;
3679-
select foo();
3679+
select compos();
36803680
ERROR: returned record type does not match expected record type
36813681
DETAIL: Returned type unknown does not match expected type character varying in column 2.
3682-
CONTEXT: PL/pgSQL function foo() while casting return value to function's return type
3682+
CONTEXT: PL/pgSQL function compos() while casting return value to function's return type
36833683
-- ... but this does
3684-
create or replace function foo() returns footype as $$
3684+
create or replace function compos() returns compostype as $$
36853685
begin
3686-
return (1, 'hello')::footype;
3686+
return (1, 'hello')::compostype;
36873687
end;
36883688
$$ language plpgsql;
3689-
select foo();
3690-
foo
3689+
select compos();
3690+
compos
36913691
-----------
36923692
(1,hello)
36933693
(1 row)
36943694

3695-
drop function foo();
3695+
drop function compos();
36963696
-- test: return a row expr as record.
3697-
create or replace function foorec() returns record as $$
3697+
create or replace function composrec() returns record as $$
36983698
declare
36993699
v record;
37003700
begin
37013701
v := (1, 'hello');
37023702
return v;
37033703
end;
37043704
$$ language plpgsql;
3705-
select foorec();
3706-
foorec
3705+
select composrec();
3706+
composrec
37073707
-----------
37083708
(1,hello)
37093709
(1 row)
37103710

37113711
-- test: return row expr in return statement.
3712-
create or replace function foorec() returns record as $$
3712+
create or replace function composrec() returns record as $$
37133713
begin
37143714
return (1, 'hello');
37153715
end;
37163716
$$ language plpgsql;
3717-
select foorec();
3718-
foorec
3717+
select composrec();
3718+
composrec
37193719
-----------
37203720
(1,hello)
37213721
(1 row)
37223722

3723-
drop function foorec();
3723+
drop function composrec();
37243724
-- test: row expr in RETURN NEXT statement.
3725-
create or replace function foo() returns setof footype as $$
3725+
create or replace function compos() returns setof compostype as $$
37263726
begin
37273727
for i in 1..3
37283728
loop
37293729
return next (1, 'hello'::varchar);
37303730
end loop;
3731-
return next null::footype;
3732-
return next (2, 'goodbye')::footype;
3731+
return next null::compostype;
3732+
return next (2, 'goodbye')::compostype;
37333733
end;
37343734
$$ language plpgsql;
3735-
select * from foo();
3735+
select * from compos();
37363736
x | y
37373737
---+---------
37383738
1 | hello
@@ -3742,18 +3742,18 @@ select * from foo();
37423742
2 | goodbye
37433743
(5 rows)
37443744

3745-
drop function foo();
3745+
drop function compos();
37463746
-- test: use invalid expr in return statement.
3747-
create or replace function foo() returns footype as $$
3747+
create or replace function compos() returns compostype as $$
37483748
begin
37493749
return 1 + 1;
37503750
end;
37513751
$$ language plpgsql;
3752-
select foo();
3752+
select compos();
37533753
ERROR: cannot return non-composite value from function returning composite type
3754-
CONTEXT: PL/pgSQL function foo() line 3 at RETURN
3755-
drop function foo();
3756-
drop type footype;
3754+
CONTEXT: PL/pgSQL function compos() line 3 at RETURN
3755+
drop function compos();
3756+
drop type compostype;
37573757
--
37583758
-- Tests for 8.4's new RAISE features
37593759
--

src/test/regress/sql/plpgsql.sql

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,22 +2941,22 @@ drop table tabwithcols;
29412941
-- Tests for composite-type results
29422942
--
29432943

2944-
create type footype as (x int, y varchar);
2944+
create type compostype as (x int, y varchar);
29452945

29462946
-- test: use of variable of composite type in return statement
2947-
create or replace function foo() returns footype as $$
2947+
create or replace function compos() returns compostype as $$
29482948
declare
2949-
v footype;
2949+
v compostype;
29502950
begin
29512951
v := (1, 'hello');
29522952
return v;
29532953
end;
29542954
$$ language plpgsql;
29552955

2956-
select foo();
2956+
select compos();
29572957

29582958
-- test: use of variable of record type in return statement
2959-
create or replace function foo() returns footype as $$
2959+
create or replace function compos() returns compostype as $$
29602960
declare
29612961
v record;
29622962
begin
@@ -2965,39 +2965,39 @@ begin
29652965
end;
29662966
$$ language plpgsql;
29672967

2968-
select foo();
2968+
select compos();
29692969

29702970
-- test: use of row expr in return statement
2971-
create or replace function foo() returns footype as $$
2971+
create or replace function compos() returns compostype as $$
29722972
begin
29732973
return (1, 'hello'::varchar);
29742974
end;
29752975
$$ language plpgsql;
29762976

2977-
select foo();
2977+
select compos();
29782978

29792979
-- this does not work currently (no implicit casting)
2980-
create or replace function foo() returns footype as $$
2980+
create or replace function compos() returns compostype as $$
29812981
begin
29822982
return (1, 'hello');
29832983
end;
29842984
$$ language plpgsql;
29852985

2986-
select foo();
2986+
select compos();
29872987

29882988
-- ... but this does
2989-
create or replace function foo() returns footype as $$
2989+
create or replace function compos() returns compostype as $$
29902990
begin
2991-
return (1, 'hello')::footype;
2991+
return (1, 'hello')::compostype;
29922992
end;
29932993
$$ language plpgsql;
29942994

2995-
select foo();
2995+
select compos();
29962996

2997-
drop function foo();
2997+
drop function compos();
29982998

29992999
-- test: return a row expr as record.
3000-
create or replace function foorec() returns record as $$
3000+
create or replace function composrec() returns record as $$
30013001
declare
30023002
v record;
30033003
begin
@@ -3006,46 +3006,46 @@ begin
30063006
end;
30073007
$$ language plpgsql;
30083008

3009-
select foorec();
3009+
select composrec();
30103010

30113011
-- test: return row expr in return statement.
3012-
create or replace function foorec() returns record as $$
3012+
create or replace function composrec() returns record as $$
30133013
begin
30143014
return (1, 'hello');
30153015
end;
30163016
$$ language plpgsql;
30173017

3018-
select foorec();
3018+
select composrec();
30193019

3020-
drop function foorec();
3020+
drop function composrec();
30213021

30223022
-- test: row expr in RETURN NEXT statement.
3023-
create or replace function foo() returns setof footype as $$
3023+
create or replace function compos() returns setof compostype as $$
30243024
begin
30253025
for i in 1..3
30263026
loop
30273027
return next (1, 'hello'::varchar);
30283028
end loop;
3029-
return next null::footype;
3030-
return next (2, 'goodbye')::footype;
3029+
return next null::compostype;
3030+
return next (2, 'goodbye')::compostype;
30313031
end;
30323032
$$ language plpgsql;
30333033

3034-
select * from foo();
3034+
select * from compos();
30353035

3036-
drop function foo();
3036+
drop function compos();
30373037

30383038
-- test: use invalid expr in return statement.
3039-
create or replace function foo() returns footype as $$
3039+
create or replace function compos() returns compostype as $$
30403040
begin
30413041
return 1 + 1;
30423042
end;
30433043
$$ language plpgsql;
30443044

3045-
select foo();
3045+
select compos();
30463046

3047-
drop function foo();
3048-
drop type footype;
3047+
drop function compos();
3048+
drop type compostype;
30493049

30503050
--
30513051
-- Tests for 8.4's new RAISE features

0 commit comments

Comments
 (0)