Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef48a05

Browse files
committed
Improve new AND CHAIN tests
Tweak the tests so that we're not just testing the default setting of transaction_read_only. Reported-by: fn ln <[email protected]>
1 parent 2403e54 commit ef48a05

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/regress/expected/transactions.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,15 +940,15 @@ ERROR: RELEASE SAVEPOINT can only be used in transaction blocks
940940
-- but this is OK, because the BEGIN converts it to a regular xact
941941
SELECT 1\; BEGIN\; SAVEPOINT sp\; ROLLBACK TO SAVEPOINT sp\; COMMIT;
942942
-- Tests for AND CHAIN in implicit transaction blocks
943-
SET TRANSACTION READ WRITE\; COMMIT AND CHAIN; -- error
943+
SET TRANSACTION READ ONLY\; COMMIT AND CHAIN; -- error
944944
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
945945
SHOW transaction_read_only;
946946
transaction_read_only
947947
-----------------------
948948
off
949949
(1 row)
950950

951-
SET TRANSACTION READ WRITE\; ROLLBACK AND CHAIN; -- error
951+
SET TRANSACTION READ ONLY\; ROLLBACK AND CHAIN; -- error
952952
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
953953
SHOW transaction_read_only;
954954
transaction_read_only

src/test/regress/sql/transactions.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,10 @@ SELECT 1\; BEGIN\; SAVEPOINT sp\; ROLLBACK TO SAVEPOINT sp\; COMMIT;
542542

543543
-- Tests for AND CHAIN in implicit transaction blocks
544544

545-
SET TRANSACTION READ WRITE\; COMMIT AND CHAIN; -- error
545+
SET TRANSACTION READ ONLY\; COMMIT AND CHAIN; -- error
546546
SHOW transaction_read_only;
547547

548-
SET TRANSACTION READ WRITE\; ROLLBACK AND CHAIN; -- error
548+
SET TRANSACTION READ ONLY\; ROLLBACK AND CHAIN; -- error
549549
SHOW transaction_read_only;
550550

551551
CREATE TABLE abc (a int);

0 commit comments

Comments
 (0)