- Notifications
You must be signed in to change notification settings - Fork28
Commit71404af
committed
Fix EvalPlanQual bug when query contains both locked and not-locked rels.
In commitafb9249, we (probably I) made ExecLockRows assignnull test tuples to all relations of the query while setting up to do anEvalPlanQual recheck for a newly-updated locked row. This was sheerestbrain fade: we should only set test tuples for relations that are lockableby the LockRows node, and in particular empty test tuples are only sensiblefor inheritance child relations that weren't the source of the currenttuple from their inheritance tree. Setting a null test tuple for anunrelated table causes it to return NULLs when it should not, as exhibitedin bug #14034 from Bronislav Houdek. To add insult to injury, doing it thewrong way required two loops where one would suffice; so the corrected codeis even a bit shorter and faster.Add a regression test case based on his example, and back-patch to 9.5where the bug was introduced.1 parentf6bd0da commit71404af
File tree
3 files changed
+60
-22
lines changed- src
- backend/executor
- test/isolation
- expected
- specs
3 files changed
+60
-22
lines changedLines changed: 18 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
262 | 262 |
| |
263 | 263 |
| |
264 | 264 |
| |
265 |
| - | |
266 |
| - | |
267 | 265 |
| |
268 | 266 |
| |
269 | 267 |
| |
270 | 268 |
| |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
275 |
| - | |
276 |
| - | |
277 |
| - | |
278 |
| - | |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 |
| - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
288 | 274 |
| |
289 | 275 |
| |
290 | 276 |
| |
| |||
293 | 279 |
| |
294 | 280 |
| |
295 | 281 |
| |
296 |
| - | |
| 282 | + | |
297 | 283 |
| |
298 | 284 |
| |
299 | 285 |
| |
| 286 | + | |
300 | 287 |
| |
301 | 288 |
| |
302 | 289 |
| |
303 |
| - | |
304 |
| - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
305 | 301 |
| |
306 | 302 |
| |
307 | 303 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + |
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 |
| |
20 | 25 |
| |
21 | 26 |
| |
22 | 27 |
| |
23 | 28 |
| |
24 | 29 |
| |
| 30 | + | |
25 | 31 |
| |
26 | 32 |
| |
27 | 33 |
| |
| |||
64 | 70 |
| |
65 | 71 |
| |
66 | 72 |
| |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
67 | 82 |
| |
68 | 83 |
| |
69 | 84 |
| |
| |||
81 | 96 |
| |
82 | 97 |
| |
83 | 98 |
| |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
84 | 106 |
| |
85 | 107 |
| |
86 | 108 |
| |
| |||
95 | 117 |
| |
96 | 118 |
| |
97 | 119 |
| |
| 120 | + |
0 commit comments
Comments
(0)