File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9692,3 +9692,23 @@ select * from plpgsql_check_function('volatility_check()');
96929692(3 rows)
96939693
96949694drop function volatility_check();
9695+ -- issue #201 - should not to raise false error, when composite
9696+ -- constant is used and assigned to composite with more fields
9697+ create type t_retcode as (retcode varchar, errmsg varchar, id int);
9698+ create or replace function test_retcode_bad()
9699+ returns void as $$
9700+ declare
9701+ rc t_retcode := row('MO_REG_ERROR');
9702+ begin
9703+ raise notice '%', rc.retcode;
9704+ end;
9705+ $$ language plpgsql;
9706+ select * from plpgsql_check_function('test_retcode_bad');
9707+ plpgsql_check_function
9708+ ------------------------------------------------------------------------------
9709+ warning:00000:4:statement block:too few attributes for composite variable
9710+ Context: during statement block local variable "rc" initialization on line 3
9711+ (2 rows)
9712+
9713+ drop function test_retcode_bad;
9714+ drop type t_retcode;
Original file line number Diff line number Diff line change @@ -9691,3 +9691,23 @@ select * from plpgsql_check_function('volatility_check()');
96919691(3 rows)
96929692
96939693drop function volatility_check();
9694+ -- issue #201 - should not to raise false error, when composite
9695+ -- constant is used and assigned to composite with more fields
9696+ create type t_retcode as (retcode varchar, errmsg varchar, id int);
9697+ create or replace function test_retcode_bad()
9698+ returns void as $$
9699+ declare
9700+ rc t_retcode := row('MO_REG_ERROR');
9701+ begin
9702+ raise notice '%', rc.retcode;
9703+ end;
9704+ $$ language plpgsql;
9705+ select * from plpgsql_check_function('test_retcode_bad');
9706+ plpgsql_check_function
9707+ ------------------------------------------------------------------------------
9708+ warning:00000:4:statement block:too few attributes for composite variable
9709+ Context: during statement block local variable "rc" initialization on line 3
9710+ (2 rows)
9711+
9712+ drop function test_retcode_bad;
9713+ drop type t_retcode;
Original file line number Diff line number Diff line change @@ -9692,3 +9692,23 @@ select * from plpgsql_check_function('volatility_check()');
96929692(3 rows)
96939693
96949694drop function volatility_check();
9695+ -- issue #201 - should not to raise false error, when composite
9696+ -- constant is used and assigned to composite with more fields
9697+ create type t_retcode as (retcode varchar, errmsg varchar, id int);
9698+ create or replace function test_retcode_bad()
9699+ returns void as $$
9700+ declare
9701+ rc t_retcode := row('MO_REG_ERROR');
9702+ begin
9703+ raise notice '%', rc.retcode;
9704+ end;
9705+ $$ language plpgsql;
9706+ select * from plpgsql_check_function('test_retcode_bad');
9707+ plpgsql_check_function
9708+ ------------------------------------------------------------------------------
9709+ warning:00000:4:statement block:too few attributes for composite variable
9710+ Context: during statement block local variable "rc" initialization on line 3
9711+ (2 rows)
9712+
9713+ drop function test_retcode_bad;
9714+ drop type t_retcode;
You can’t perform that action at this time.
0 commit comments