Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ffc2aa

Browse files
committed
Add EvalPlanQual delete returning isolation test
Author: Andres FreundReviewed-by: Pavel BorisovDiscussion:https://www.postgresql.org/message-id/flat/CAPpHfdua-YFw3XTprfutzGp28xXLigFtzNbuFY8yPhqeq6X5kg%40mail.gmail.com
1 parent87985cc commit8ffc2aa

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

‎src/test/isolation/expected/eval-plan-qual.out

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
749779
starting permutation: upsert1 upsert2 c1 c2 read
750780
step upsert1:
751781
WITH upsert AS

‎src/test/isolation/specs/eval-plan-qual.spec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ setup{ BEGIN ISOLATION LEVEL READ COMMITTED; }
7676
stepwx1{UPDATEaccountsSETbalance=balance-200WHEREaccountid='checking'RETURNINGbalance; }
7777
# wy1 then wy2 checks the case where quals pass then fail
7878
stepwy1{UPDATEaccountsSETbalance=balance+500WHEREaccountid='checking'RETURNINGbalance; }
79+
# wx2 then wb1 checks the case of re-fetching up-to-date values for DELETE ... RETURNING ...
80+
stepwb1{DELETEFROMaccountsWHEREbalance=600RETURNING*; }
7981

8082
stepwxext1{UPDATEaccounts_extSETbalance=balance-200WHEREaccountid='checking'RETURNINGbalance; }
8183
steptocds1{UPDATEaccountsSETaccountid='cds'WHEREaccountid='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
355357
permutationwx1delwctefailc1c2read
358+
# test that a delete re-fetches up-to-date values for returning clause
359+
permutationreadwx2wb1c2c1read
356360

357361
permutationupsert1upsert2c1c2read
358362
permutationreadp1writep1readp2c1c2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp