summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/regress/expected/portals_1.out28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/regress/expected/portals_1.out b/src/test/regress/expected/portals_1.out
index f28bb80d86..dd02d5a546 100644
--- a/src/test/regress/expected/portals_1.out
+++ b/src/test/regress/expected/portals_1.out
@@ -1157,6 +1157,10 @@ DECLARE c1 CURSOR FOR SELECT * FROM uctest;
DELETE FROM uctest WHERE CURRENT OF c1; -- fail, no current row
ERROR: WHERE CURRENT OF clause not yet supported
ROLLBACK;
+BEGIN;
+DECLARE c1 CURSOR FOR SELECT MIN(f1) FROM uctest FOR UPDATE;
+ERROR: FOR UPDATE is not allowed with aggregate functions
+ROLLBACK;
-- WHERE CURRENT OF may someday work with views, but today is not that day.
-- For now, just make sure it errors out cleanly.
CREATE VIEW ucview AS SELECT * FROM uctest ORDER BY 1;
@@ -1191,3 +1195,27 @@ DROP TABLE cursor;
DROP VIEW ucview;
DROP TABLE ucchild;
DROP TABLE uctest;
+-- Check rewinding a cursor containing a stable function in LIMIT,
+-- per bug report in 8336843.9833.1399385291498.JavaMail.root@quick
+begin;
+create function nochange(int) returns int
+ as 'select $1 limit 1' language sql stable;
+declare c cursor for select * from int8_tbl limit nochange(3);
+fetch all from c;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+(3 rows)
+
+move backward all in c;
+fetch all from c;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+(3 rows)
+
+rollback;