From: Pavan Deolasee Date: Fri, 25 Aug 2017 05:56:38 +0000 (+0530) Subject: Accept errors in tidscan regression test X-Git-Tag: XL_10_R1BETA1~155 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=a506209646f89b80e753316faa09474f4d91a8ba;p=postgres-xl.git Accept errors in tidscan regression test We don't support BACKWARD scan of RemoteSubplan and neither support WHERE CURRENT OF. So accept errors arising out of these limitations. These test case changes are new in XL10 and hence we did not see these failures in the earlier releases of XL. --- diff --git a/src/test/regress/expected/tidscan.out b/src/test/regress/expected/tidscan.out index bd1fae084a..3355409f8a 100644 --- a/src/test/regress/expected/tidscan.out +++ b/src/test/regress/expected/tidscan.out @@ -118,18 +118,13 @@ FETCH ALL FROM c; (0,1) | 3 (3 rows) +-- XL does not support BACKWARD scan of RemoteSubplan/RemoteSubquery and +-- hence the next statement fails FETCH BACKWARD 1 FROM c; - ctid | id --------+---- - (0,2) | 2 -(1 row) - +ERROR: cursor can only scan forward +HINT: Declare it with SCROLL option to enable backward scan. FETCH FIRST FROM c; - ctid | id --------+---- - (0,1) | 1 -(1 row) - +ERROR: current transaction is aborted, commands ignored until end of transaction block ROLLBACK; -- tidscan via CURRENT OF BEGIN; @@ -148,47 +143,24 @@ FETCH NEXT FROM c; -- perform update EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) +-- XL does not support WHERE CURRENT OF and hence the next +-- statement fails UPDATE tidscan SET id = -id WHERE CURRENT OF c RETURNING *; - QUERY PLAN ---------------------------------------------------- - Update on tidscan (actual rows=1 loops=1) - -> Tid Scan on tidscan (actual rows=1 loops=1) - TID Cond: CURRENT OF c -(3 rows) - +ERROR: WHERE CURRENT OF clause not yet supported FETCH NEXT FROM c; - ctid | id --------+---- - (0,3) | 3 -(1 row) - +ERROR: current transaction is aborted, commands ignored until end of transaction block -- perform update EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) UPDATE tidscan SET id = -id WHERE CURRENT OF c RETURNING *; - QUERY PLAN ---------------------------------------------------- - Update on tidscan (actual rows=1 loops=1) - -> Tid Scan on tidscan (actual rows=1 loops=1) - TID Cond: CURRENT OF c -(3 rows) - +ERROR: current transaction is aborted, commands ignored until end of transaction block SELECT * FROM tidscan; - id ----- - 1 - -2 - -3 -(3 rows) - +ERROR: current transaction is aborted, commands ignored until end of transaction block -- position cursor past any rows FETCH NEXT FROM c; - ctid | id -------+---- -(0 rows) - +ERROR: current transaction is aborted, commands ignored until end of transaction block -- should error out EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) UPDATE tidscan SET id = -id WHERE CURRENT OF c RETURNING *; -ERROR: cursor "c" is not positioned on a row +ERROR: current transaction is aborted, commands ignored until end of transaction block ROLLBACK; DROP TABLE tidscan; diff --git a/src/test/regress/sql/tidscan.sql b/src/test/regress/sql/tidscan.sql index c9d632e49d..16acf2819e 100644 --- a/src/test/regress/sql/tidscan.sql +++ b/src/test/regress/sql/tidscan.sql @@ -41,6 +41,8 @@ BEGIN; DECLARE c CURSOR FOR SELECT ctid, * FROM tidscan WHERE ctid = ANY(ARRAY['(0,1)', '(0,2)']::tid[]); FETCH ALL FROM c; +-- XL does not support BACKWARD scan of RemoteSubplan/RemoteSubquery and +-- hence the next statement fails FETCH BACKWARD 1 FROM c; FETCH FIRST FROM c; ROLLBACK; @@ -52,6 +54,8 @@ FETCH NEXT FROM c; -- skip one row FETCH NEXT FROM c; -- perform update EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) +-- XL does not support WHERE CURRENT OF and hence the next +-- statement fails UPDATE tidscan SET id = -id WHERE CURRENT OF c RETURNING *; FETCH NEXT FROM c; -- perform update