File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -746,6 +746,36 @@ savings | 600| 1200
746
746
(2 rows)
747
747
748
748
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
+
749
779
starting permutation: upsert1 upsert2 c1 c2 read
750
780
step upsert1:
751
781
WITH upsert AS
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ setup { BEGIN ISOLATION LEVEL READ COMMITTED; }
76
76
step wx1 { UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance ; }
77
77
# wy1 then wy2 checks the case where quals pass then fail
78
78
step 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 * ; }
79
81
80
82
step wxext1 { UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance ; }
81
83
step tocds1 { UPDATE accounts SET accountid = 'cds' WHERE accountid = 'checking' ; }
@@ -353,6 +355,8 @@ permutation wx1 delwcte c1 c2 read
353
355
# test that a delete to a self-modified row throws error when
354
356
# previously updated by a different cid
355
357
permutation 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
356
360
357
361
permutation upsert1 upsert2 c1 c2 read
358
362
permutation readp1 writep1 readp2 c1 c2
You can’t perform that action at this time.
0 commit comments