fix: Add tests for embedding on overloaded functions with a default param

Resolves #1672

Was actually fixed in #1841 / 67c2ed7, this just adds the tests to confirm it.
This commit is contained in:
Laurence Isla
2021-11-19 09:00:16 +01:00
committed by GitHub
parent bf58a3600a
commit 4e07846c5d
2 changed files with 46 additions and 0 deletions
+16
View File
@@ -1323,6 +1323,22 @@ create or replace function test.overloaded(a text, b text, c text) returns text
select a || b || c
$$ language sql;
create or replace function test.overloaded_default(opt_param text default 'Code w7') returns setof test.tasks as $$
select * from test.tasks where name like opt_param;
$$ language sql;
create or replace function test.overloaded_default(must_param int) returns jsonb as $$
select row_to_json(r)::jsonb from (select must_param as val) as r;
$$ language sql;
create or replace function test.overloaded_default(a int, opt_param text default 'Design IOS') returns setof test.tasks as $$
select * from test.tasks where name like opt_param and id > a;
$$ language sql;
create or replace function test.overloaded_default(a int, must_param int) returns jsonb as $$
select row_to_json(r)::jsonb from (select a, must_param as val) as r;
$$ language sql;
create or replace function test.overloaded_html_form() returns setof int as $$
values (1), (2), (3);
$$ language sql;