File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -746,6 +746,36 @@ savings | 600| 1200
746746(2 rows)
747747
748748
749+ starting permutation: read wx2 wb1 c2 c1 read
750+ step read: SELECT * FROM accounts ORDER BY accountid;
751+ accountid|balance|balance2
752+ ---------+-------+--------
753+ checking | 600| 1200
754+ savings | 600| 1200
755+ (2 rows)
756+
757+ step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
758+ balance
759+ -------
760+ 1050
761+ (1 row)
762+
763+ step wb1: DELETE FROM accounts WHERE balance = 600 RETURNING *; <waiting ...>
764+ step c2: COMMIT;
765+ step wb1: <... completed>
766+ accountid|balance|balance2
767+ ---------+-------+--------
768+ savings | 600| 1200
769+ (1 row)
770+
771+ step c1: COMMIT;
772+ step read: SELECT * FROM accounts ORDER BY accountid;
773+ accountid|balance|balance2
774+ ---------+-------+--------
775+ checking | 1050| 2100
776+ (1 row)
777+
778+
749779starting permutation: upsert1 upsert2 c1 c2 read
750780step upsert1:
751781 WITH upsert AS
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ setup { BEGIN ISOLATION LEVEL READ COMMITTED; }
7676step wx1 { UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance ; }
7777# wy1 then wy2 checks the case where quals pass then fail
7878step wy1 { UPDATE accounts SET balance = balance + 500 WHERE accountid = 'checking' RETURNING balance ; }
79+ # wx2 then wb1 checks the case of re-fetching up-to-date values for DELETE ... RETURNING ...
80+ step wb1 { DELETE FROM accounts WHERE balance = 600 RETURNING * ; }
7981
8082step wxext1 { UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance ; }
8183step tocds1 { UPDATE accounts SET accountid = 'cds' WHERE accountid = 'checking' ; }
@@ -353,6 +355,8 @@ permutation wx1 delwcte c1 c2 read
353355# test that a delete to a self-modified row throws error when
354356# previously updated by a different cid
355357permutation wx1 delwctefail c1 c2 read
358+ # test that a delete re-fetches up-to-date values for returning clause
359+ permutation read wx2 wb1 c2 c1 read
356360
357361permutation upsert1 upsert2 c1 c2 read
358362permutation readp1 writep1 readp2 c1 c2
You can’t perform that action at this time.
0 commit comments