summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/transactions.out
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-07-01 20:11:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-07-01 20:11:03 +0000
commitb6197fe06939d35f67abee1ebe62690d43199783 (patch)
treee6c486cb0c2d752f42197f04dddeaaabd2395ec8 /src/test/regress/expected/transactions.out
parente15d0bb8e8d5d6c8c9de8ba80c1756a773dbe445 (diff)
downloadpostgresql-b6197fe06939d35f67abee1ebe62690d43199783.tar.gz
Further review of xact.c state machine for nested transactions. Fix
problems with starting subtransactions inside already-failed transactions. Clean up some comments.
Diffstat (limited to 'src/test/regress/expected/transactions.out')
-rw-r--r--src/test/regress/expected/transactions.out59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/test/regress/expected/transactions.out b/src/test/regress/expected/transactions.out
index 6cc89b5c5e..c2fdc23103 100644
--- a/src/test/regress/expected/transactions.out
+++ b/src/test/regress/expected/transactions.out
@@ -132,6 +132,65 @@ SELECT * FROM barbaz; -- should have 1
1
(1 row)
+-- check that starting a subxact in a failed xact or subxact works
+BEGIN;
+ SELECT 0/0; -- fail the outer xact
+ERROR: division by zero
+ BEGIN;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ COMMIT;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ BEGIN;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ ROLLBACK;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+COMMIT;
+SELECT 1; -- this should work
+ ?column?
+----------
+ 1
+(1 row)
+
+BEGIN;
+ BEGIN;
+ SELECT 1; -- this should work
+ ?column?
+----------
+ 1
+(1 row)
+
+ SELECT 0/0; -- fail the subxact
+ERROR: division by zero
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ BEGIN;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ ROLLBACK;
+ BEGIN;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ COMMIT;
+ SELECT 1; -- this should NOT work
+ERROR: current transaction is aborted, commands ignored until end of transaction block
+ ROLLBACK;
+ SELECT 1; -- this should work
+ ?column?
+----------
+ 1
+(1 row)
+
+COMMIT;
+SELECT 1; -- this should work
+ ?column?
+----------
+ 1
+(1 row)
+
DROP TABLE foo;
DROP TABLE baz;
DROP TABLE barbaz;