Skip to content

Commit

Permalink
move polymorhic function test to common part
Browse files Browse the repository at this point in the history
  • Loading branch information
okbob committed Jul 26, 2020
1 parent 27ba65e commit 4191601
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 43 deletions.
12 changes: 0 additions & 12 deletions expected/plpgsql_check_active-12.out
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,3 @@ drop function df1(anyelement);
drop function df2(anyelement, jsonb);
drop function df22(jsonb, anyelement);
drop function t1();
-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
11 changes: 0 additions & 11 deletions expected/plpgsql_check_active-14.out
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,3 @@ drop function df1(anyelement);
drop function df2(anyelement, jsonb);
drop function df22(jsonb, anyelement);
drop function t1();
-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

12 changes: 12 additions & 0 deletions expected/plpgsql_check_active.out
Original file line number Diff line number Diff line change
Expand Up @@ -7253,3 +7253,15 @@ select * from plpgsql_check_function('f');
------------------------
(0 rows)

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
12 changes: 12 additions & 0 deletions expected/plpgsql_check_active_1.out
Original file line number Diff line number Diff line change
Expand Up @@ -7263,3 +7263,15 @@ select * from plpgsql_check_function('f');
------------------------
(0 rows)

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
12 changes: 12 additions & 0 deletions expected/plpgsql_check_active_2.out
Original file line number Diff line number Diff line change
Expand Up @@ -7253,3 +7253,15 @@ select * from plpgsql_check_function('f');
------------------------
(0 rows)

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
12 changes: 12 additions & 0 deletions expected/plpgsql_check_active_3.out
Original file line number Diff line number Diff line change
Expand Up @@ -7213,3 +7213,15 @@ select * from plpgsql_check_function('f');
------------------------
(0 rows)

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
12 changes: 12 additions & 0 deletions expected/plpgsql_check_active_4.out
Original file line number Diff line number Diff line change
Expand Up @@ -7263,3 +7263,15 @@ select * from plpgsql_check_function('f');
------------------------
(0 rows)

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
12 changes: 12 additions & 0 deletions expected/plpgsql_check_active_5.out
Original file line number Diff line number Diff line change
Expand Up @@ -7254,3 +7254,15 @@ select * from plpgsql_check_function('f');
------------------------
(0 rows)

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;
select plpgsql_check_function('distinct_array(anyarray)');
plpgsql_check_function
------------------------
(0 rows)

drop function distinct_array(anyarray);
11 changes: 0 additions & 11 deletions sql/plpgsql_check_active-12.sql
Original file line number Diff line number Diff line change
Expand Up @@ -468,14 +468,3 @@ drop function df1(anyelement);
drop function df2(anyelement, jsonb);
drop function df22(jsonb, anyelement);
drop function t1();

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;

select plpgsql_check_function('distinct_array(anyarray)');

drop function distinct_array(anyarray);
9 changes: 0 additions & 9 deletions sql/plpgsql_check_active-14.sql
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,3 @@ drop function df1(anyelement);
drop function df2(anyelement, jsonb);
drop function df22(jsonb, anyelement);
drop function t1();

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;

select plpgsql_check_function('distinct_array(anyarray)');
11 changes: 11 additions & 0 deletions sql/plpgsql_check_active.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4033,3 +4033,14 @@ end;
$$ language plpgsql;

select * from plpgsql_check_function('f');

-- fix issue #63
create or replace function distinct_array(arr anyarray) returns anyarray as $$
begin
return array(select distinct e from unnest(arr) as e);
end;
$$ language plpgsql immutable;

select plpgsql_check_function('distinct_array(anyarray)');

drop function distinct_array(anyarray);

0 comments on commit 4191601

Please sign in to comment.