Commit 37929599 authored by Thomas Munro's avatar Thomas Munro

Fix transaction.sql tests in higher isolation levels.

It seems like a useful sanity check to be able to run "installcheck"
against a cluster running with default_transaction_level set to
serializable or repeatable read.  Only one thing currently fails in
those configurations, so let's fix that.

No back-patch for now, because it fails in many other places in some of
the stable branches.  We'd have to go back and fix those too if we
included this configuration in automated testing.
Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA%2BhUKGJUaHeK%3DHLATxF1JOKDjKJVrBKA-zmbPAebOM0Se2FQRg%40mail.gmail.com
parent 6b67d72b
......@@ -1026,6 +1026,7 @@ SHOW transaction_isolation; -- transaction is active at this point
(1 row)
ROLLBACK;
SET default_transaction_isolation = 'read committed';
-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (17)\; COMMIT\; INSERT INTO abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
......@@ -1043,6 +1044,7 @@ SHOW transaction_isolation; -- out of transaction block
read committed
(1 row)
RESET default_transaction_isolation;
SELECT * FROM abc ORDER BY 1;
a
----
......
......@@ -578,6 +578,8 @@ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (16)\
SHOW transaction_isolation; -- transaction is active at this point
ROLLBACK;
SET default_transaction_isolation = 'read committed';
-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (17)\; COMMIT\; INSERT INTO abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
SHOW transaction_isolation; -- out of transaction block
......@@ -585,6 +587,8 @@ SHOW transaction_isolation; -- out of transaction block
START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (19)\; ROLLBACK\; INSERT INTO abc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
SHOW transaction_isolation; -- out of transaction block
RESET default_transaction_isolation;
SELECT * FROM abc ORDER BY 1;
DROP TABLE abc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment