From 4191601f56ed46b6fd151ae18ce4675c2305af64 Mon Sep 17 00:00:00 2001 From: "okbob@github.com" Date: Sun, 26 Jul 2020 21:20:37 +0200 Subject: [PATCH] move polymorhic function test to common part --- expected/plpgsql_check_active-12.out | 12 ------------ expected/plpgsql_check_active-14.out | 11 ----------- expected/plpgsql_check_active.out | 12 ++++++++++++ expected/plpgsql_check_active_1.out | 12 ++++++++++++ expected/plpgsql_check_active_2.out | 12 ++++++++++++ expected/plpgsql_check_active_3.out | 12 ++++++++++++ expected/plpgsql_check_active_4.out | 12 ++++++++++++ expected/plpgsql_check_active_5.out | 12 ++++++++++++ sql/plpgsql_check_active-12.sql | 11 ----------- sql/plpgsql_check_active-14.sql | 9 --------- sql/plpgsql_check_active.sql | 11 +++++++++++ 11 files changed, 83 insertions(+), 43 deletions(-) diff --git a/expected/plpgsql_check_active-12.out b/expected/plpgsql_check_active-12.out index f58c32b..99644f8 100644 --- a/expected/plpgsql_check_active-12.out +++ b/expected/plpgsql_check_active-12.out @@ -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); diff --git a/expected/plpgsql_check_active-14.out b/expected/plpgsql_check_active-14.out index 65b2bbc..432f3a3 100644 --- a/expected/plpgsql_check_active-14.out +++ b/expected/plpgsql_check_active-14.out @@ -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) - diff --git a/expected/plpgsql_check_active.out b/expected/plpgsql_check_active.out index 67d1cf6..ff98380 100644 --- a/expected/plpgsql_check_active.out +++ b/expected/plpgsql_check_active.out @@ -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); diff --git a/expected/plpgsql_check_active_1.out b/expected/plpgsql_check_active_1.out index 83454f5..b85ec51 100644 --- a/expected/plpgsql_check_active_1.out +++ b/expected/plpgsql_check_active_1.out @@ -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); diff --git a/expected/plpgsql_check_active_2.out b/expected/plpgsql_check_active_2.out index 6df2516..fae4fdc 100644 --- a/expected/plpgsql_check_active_2.out +++ b/expected/plpgsql_check_active_2.out @@ -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); diff --git a/expected/plpgsql_check_active_3.out b/expected/plpgsql_check_active_3.out index 39d2026..5e3b36c 100644 --- a/expected/plpgsql_check_active_3.out +++ b/expected/plpgsql_check_active_3.out @@ -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); diff --git a/expected/plpgsql_check_active_4.out b/expected/plpgsql_check_active_4.out index 58e0a84..2c9e4bf 100644 --- a/expected/plpgsql_check_active_4.out +++ b/expected/plpgsql_check_active_4.out @@ -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); diff --git a/expected/plpgsql_check_active_5.out b/expected/plpgsql_check_active_5.out index a8eff75..961a556 100644 --- a/expected/plpgsql_check_active_5.out +++ b/expected/plpgsql_check_active_5.out @@ -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); diff --git a/sql/plpgsql_check_active-12.sql b/sql/plpgsql_check_active-12.sql index cd87597..6a9aa03 100644 --- a/sql/plpgsql_check_active-12.sql +++ b/sql/plpgsql_check_active-12.sql @@ -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); diff --git a/sql/plpgsql_check_active-14.sql b/sql/plpgsql_check_active-14.sql index 6651ca7..aa3ad64 100644 --- a/sql/plpgsql_check_active-14.sql +++ b/sql/plpgsql_check_active-14.sql @@ -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)'); diff --git a/sql/plpgsql_check_active.sql b/sql/plpgsql_check_active.sql index a230555..ff7f790 100644 --- a/sql/plpgsql_check_active.sql +++ b/sql/plpgsql_check_active.sql @@ -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);