Skip to content

Commit ca4bbd3

Browse files
committed
fix regress tests - 9.4 .. 13devel
1 parent aef24a9 commit ca4bbd3

6 files changed

+12781
-114
lines changed

expected/plpgsql_check_active-12.out

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ end;
313313
$$ language plpgsql;
314314
call proc(10);
315315
select * from plpgsql_check_function('proc(int)');
316-
plpgsql_check_function
317-
-------------------------------------------------
318-
warning extra:00000:parameter "a" is never read
316+
plpgsql_check_function
317+
------------------------------------------
318+
warning extra:00000:unused parameter "a"
319319
(1 row)
320320

321321
create or replace procedure testproc()
@@ -360,9 +360,9 @@ $$ language plpgsql;
360360
select * from plpgsql_check_function('proc(int,int, int)');
361361
plpgsql_check_function
362362
-------------------------------------------------
363-
warning extra:00000:parameter "a" is never read
364-
warning extra:00000:parameter "b" is never read
365-
warning extra:00000:parameter "c" is never read
363+
warning extra:00000:unused parameter "a"
364+
warning extra:00000:unused parameter "b"
365+
warning extra:00000:unused parameter "c"
366366
warning extra:00000:unmodified OUT variable "b"
367367
(4 rows)
368368

@@ -373,10 +373,9 @@ begin
373373
end;
374374
$$ language plpgsql;
375375
select * from plpgsql_check_function('proc(int,int, int)');
376-
plpgsql_check_function
377-
-------------------------------------------------
378-
warning extra:00000:parameter "b" is never read
379-
(1 row)
376+
plpgsql_check_function
377+
------------------------
378+
(0 rows)
380379

381380
create or replace procedure testproc()
382381
as $$
@@ -425,37 +424,35 @@ select * from plpgsql_check_function('testproc(int)');
425424
------------------------
426425
(0 rows)
427426

428-
-- check assignement to recfield
429-
create table foo(a int);
430-
create or replace function test_field_assignment()
431-
returns void as $$
432-
declare v foo;
427+
drop procedure testproc(int);
428+
-- should to raise warnings
429+
create or replace procedure testproc2(in p1 int, inout p2 int, in p3 int, inout p4 int)
430+
as $$
433431
begin
434-
v.a := 10;
435-
v.a := current_timestamp;
436-
raise notice '%', v;
432+
raise notice '% %', p1, p3;
437433
end;
438434
$$ language plpgsql;
439-
select * from plpgsql_check_function('test_field_assignment');
440-
plpgsql_check_function
441-
----------------------------------------------------------------------------------
442-
warning:42804:5:assignment:target type is different type than source type
443-
Detail: cast "timestamp with time zone" value to "integer" type
444-
Hint: There are no possible explicit coercion between those types, possibly bug!
445-
Context: at assignment to field "a" of variable "v" declared on line 2
435+
select * from plpgsql_check_function('testproc2');
436+
plpgsql_check_function
437+
--------------------------------------------------
438+
warning extra:00000:unused parameter "p2"
439+
warning extra:00000:unused parameter "p4"
440+
warning extra:00000:unmodified OUT variable "p2"
441+
warning extra:00000:unmodified OUT variable "p4"
446442
(4 rows)
447443

448-
drop table foo;
449-
create table foo(a int, b int);
450-
create or replace function foofunc()
451-
returns void as $$
444+
drop procedure testproc2;
445+
-- should be ok
446+
create or replace procedure testproc3(in p1 int, inout p2 int, in p3 int, inout p4 int)
447+
as $$
452448
begin
453-
-- should be ok
454-
perform * from foo;
449+
p2 := p1;
450+
p4 := p3;
455451
end;
456452
$$ language plpgsql;
457-
select * from plpgsql_check_function('foofunc');
453+
select * from plpgsql_check_function('testproc3');
458454
plpgsql_check_function
459455
------------------------
460456
(0 rows)
461457

458+
drop procedure testproc3;

0 commit comments

Comments
 (0)