forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdeadbf4
committed
Fix corner case where SELECT FOR UPDATE could return a row twice.
In READ COMMITTED mode, if a SELECT FOR UPDATE discovers it has to redoWHERE-clause checking on rows that have been updated since the SELECT'ssnapshot, it invokes EvalPlanQual processing to do that. If this firstoccurs within a non-first child table of an inheritance tree, the previouscoding could accidentally re-return a matching row from an earlier,already-scanned child table. (And, to add insult to injury, I think thiscould make it miss returning a row that should have been returned, if theupdated row that this happens on should still have passed the WHERE qual.)Per report from Kyotaro Horiguchi; the added isolation test is based on histest case.This has been broken for quite awhile, so back-patch to all supportedbranches.1 parent2b53d58 commitdeadbf4
File tree
3 files changed
+61
-0
lines changed- src
- backend/executor
- test/isolation
- expected
- specs
3 files changed
+61
-0
lines changedLines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
| 164 | + | |
| 165 | + | |
164 | 166 |
| |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
165 | 187 |
| |
166 | 188 |
| |
167 | 189 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + |
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 |
| |
12 | 20 |
| |
13 | 21 |
| |
14 | 22 |
| |
15 | 23 |
| |
| 24 | + | |
16 | 25 |
| |
17 | 26 |
| |
18 | 27 |
| |
| |||
30 | 39 |
| |
31 | 40 |
| |
32 | 41 |
| |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
33 | 47 |
| |
34 | 48 |
| |
35 | 49 |
| |
| |||
44 | 58 |
| |
45 | 59 |
| |
46 | 60 |
| |
| 61 | + | |
47 | 62 |
| |
48 | 63 |
| |
49 | 64 |
| |
| |||
54 | 69 |
| |
55 | 70 |
| |
56 | 71 |
| |
| 72 | + |
0 commit comments
Comments
(0)