Skip to content

Commit bb29e79

Browse files
committed
fix regress tests
1 parent 7ae6b26 commit bb29e79

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

expected/plpgsql_check_active.out

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9692,3 +9692,23 @@ select * from plpgsql_check_function('volatility_check()');
96929692
(3 rows)
96939693

96949694
drop 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;

expected/plpgsql_check_active_2.out

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9691,3 +9691,23 @@ select * from plpgsql_check_function('volatility_check()');
96919691
(3 rows)
96929692

96939693
drop 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;

expected/plpgsql_check_active_3.out

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9692,3 +9692,23 @@ select * from plpgsql_check_function('volatility_check()');
96929692
(3 rows)
96939693

96949694
drop 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;

0 commit comments

Comments
 (0)