Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 08dc2af

Browse files
author
Neil Conway
committed
Tweak the PL/PgSQL regression tests to catch the recently reported bug
in parsing cursor declarations.
1 parent 323f0a6 commit 08dc2af

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/test/regress/expected/plpgsql.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,12 +2268,12 @@ commit;
22682268
-- should fail
22692269
fetch next from test1;
22702270
ERROR: cursor "test1" does not exist
2271-
create function refcursor_test2(int) returns boolean as $$
2271+
create function refcursor_test2(int, int) returns boolean as $$
22722272
declare
2273-
c1 cursor (param integer) for select * from rc_test where a > param;
2273+
c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2;
22742274
nonsense record;
22752275
begin
2276-
open c1($1);
2276+
open c1($1, $2);
22772277
fetch c1 into nonsense;
22782278
close c1;
22792279
if found then
@@ -2283,8 +2283,8 @@ begin
22832283
end if;
22842284
end
22852285
$$ language 'plpgsql';
2286-
select refcursor_test2(20000) as "Should be false",
2287-
refcursor_test2(20) as "Should be true";
2286+
select refcursor_test2(20000, 20000) as "Should be false",
2287+
refcursor_test2(20, 20) as "Should be true";
22882288
Should be false | Should be true
22892289
-----------------+----------------
22902290
f | t

src/test/regress/sql/plpgsql.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,12 +1926,12 @@ commit;
19261926
-- should fail
19271927
fetch next from test1;
19281928

1929-
create function refcursor_test2(int) returns boolean as $$
1929+
create function refcursor_test2(int, int) returns boolean as $$
19301930
declare
1931-
c1 cursor (param integer) for select * from rc_test where a > param;
1931+
c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2;
19321932
nonsense record;
19331933
begin
1934-
open c1($1);
1934+
open c1($1, $2);
19351935
fetch c1 into nonsense;
19361936
close c1;
19371937
if found then
@@ -1942,8 +1942,8 @@ begin
19421942
end
19431943
$$ language 'plpgsql';
19441944

1945-
select refcursor_test2(20000) as "Should be false",
1946-
refcursor_test2(20) as "Should be true";
1945+
select refcursor_test2(20000, 20000) as "Should be false",
1946+
refcursor_test2(20, 20) as "Should be true";
19471947

19481948
--
19491949
-- tests for "raise" processing

0 commit comments

Comments
 (0)