forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8d4bb31
committed
Fix race condition in DELETE RETURNING.
When RETURNING is specified, ExecDelete would return a virtual-tuple slotthat could contain pointers into an already-unpinned disk buffer. Anotherprocess could change the buffer contents before we get around to using thedata, resulting in garbage results or even a crash. This seems of fairlylow probability, which may explain why there are no known field reports ofthe problem, but it's definitely possible. Fix by forcing the result slotto be "materialized" before we release pin on the disk buffer.Back-patch to 9.0; in earlier branches there is no bug becauseExecProcessReturning sent the tuple to the destination immediately. Also,this is already fixed in HEAD as part of the writable-foreign-tables patch(where the fix is necessary for DELETE RETURNING to work at all withpostgres_fdw).1 parent1dd9238 commit8d4bb31
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
394 | 394 |
| |
395 | 395 |
| |
396 | 396 |
| |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
397 | 403 |
| |
398 | 404 |
| |
399 | 405 |
| |
|
0 commit comments
Comments
(0)