Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08dc2af

Browse files
author
Neil Conway
committed
Tweak the PL/PgSQL regression tests to catch the recently reported bug
in parsing cursor declarations.
1 parent323f0a6 commit08dc2af

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 nextfrom test1;
19281928

1929-
createfunctionrefcursor_test2(int) returnsbooleanas $$
1929+
createfunctionrefcursor_test2(int,int) returnsbooleanas $$
19301930
declare
1931-
c1 cursor (paraminteger) forselect*from rc_testwhere a>param;
1931+
c1 cursor (param1int, param2int) forselect*from rc_testwhere a>param1and 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)

[8]ページ先頭

©2009-2025 Movatter.jp