mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-28 11:55:03 +03:00 
			
		
		
		
	Tweak the PL/PgSQL regression tests to catch the recently reported bug
in parsing cursor declarations.
This commit is contained in:
		| @@ -2268,12 +2268,12 @@ commit; | |||||||
| -- should fail | -- should fail | ||||||
| fetch next from test1; | fetch next from test1; | ||||||
| ERROR:  cursor "test1" does not exist | ERROR:  cursor "test1" does not exist | ||||||
| create function refcursor_test2(int) returns boolean as $$ | create function refcursor_test2(int, int) returns boolean as $$ | ||||||
| declare | declare | ||||||
|     c1 cursor (param integer) for select * from rc_test where a > param; |     c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2; | ||||||
|     nonsense record; |     nonsense record; | ||||||
| begin | begin | ||||||
|     open c1($1); |     open c1($1, $2); | ||||||
|     fetch c1 into nonsense; |     fetch c1 into nonsense; | ||||||
|     close c1; |     close c1; | ||||||
|     if found then |     if found then | ||||||
| @@ -2283,8 +2283,8 @@ begin | |||||||
|     end if; |     end if; | ||||||
| end | end | ||||||
| $$ language 'plpgsql'; | $$ language 'plpgsql'; | ||||||
| select refcursor_test2(20000) as "Should be false", | select refcursor_test2(20000, 20000) as "Should be false", | ||||||
|        refcursor_test2(20) as "Should be true"; |        refcursor_test2(20, 20) as "Should be true"; | ||||||
|  Should be false | Should be true  |  Should be false | Should be true  | ||||||
| -----------------+---------------- | -----------------+---------------- | ||||||
|  f               | t |  f               | t | ||||||
|   | |||||||
| @@ -1926,12 +1926,12 @@ commit; | |||||||
| -- should fail | -- should fail | ||||||
| fetch next from test1; | fetch next from test1; | ||||||
|  |  | ||||||
| create function refcursor_test2(int) returns boolean as $$ | create function refcursor_test2(int, int) returns boolean as $$ | ||||||
| declare | declare | ||||||
|     c1 cursor (param integer) for select * from rc_test where a > param; |     c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2; | ||||||
|     nonsense record; |     nonsense record; | ||||||
| begin | begin | ||||||
|     open c1($1); |     open c1($1, $2); | ||||||
|     fetch c1 into nonsense; |     fetch c1 into nonsense; | ||||||
|     close c1; |     close c1; | ||||||
|     if found then |     if found then | ||||||
| @@ -1942,8 +1942,8 @@ begin | |||||||
| end | end | ||||||
| $$ language 'plpgsql'; | $$ language 'plpgsql'; | ||||||
|  |  | ||||||
| select refcursor_test2(20000) as "Should be false", | select refcursor_test2(20000, 20000) as "Should be false", | ||||||
|        refcursor_test2(20) as "Should be true"; |        refcursor_test2(20, 20) as "Should be true"; | ||||||
|  |  | ||||||
| -- | -- | ||||||
| -- tests for "raise" processing | -- tests for "raise" processing | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user