forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd986d4e
committed
Fix crash caused by EPQ happening with a before update trigger present.
When ExecBRUpdateTriggers()'s GetTupleForTrigger() follows an EPQchain the former needs to run the result tuple through the junkfilteragain, and update the slot containing the new version of the tuple tocontain that new version. The input tuple may already be in thejunkfilter's output slot, which used to be OK - we don't need theprevious version anymore. Unfortunatelyff11e7f started to useExecCopySlot() to update newslot, and ExecCopySlot() doesn't supportcopying a slot into itself, leading to a slot in a corruptstate, which then can cause crashes or other symptoms.Fix this by skipping the ExecCopySlot() when copying into itself.While we could have easily made ExecCopySlot() handle that case, itseems better to add an assert forbidding doing so instead. As the goalof copying might be to make the contents of one slot independent fromanother, it seems failure prone to handle doing so silently.A follow-up commit will add tests for the obviously under-coveredcombination of EPQ and triggers. Done as a separate commit as it mightmake sense to backpatch them further than this bug.Also remove confusion with confusing variable names for slots inExecBRDeleteTriggers() and ExecBRUpdateTriggers().Bug: #16036Reported-By: Антон ВласовAuthor: Andres FreundDiscussion:https://postgr.es/m/16036-28184c90d952fb7f@postgresql.orgBackpatch: 12-, whereff11e7f was merged1 parenta586cc4 commitd986d4e
2 files changed
+24
-21
lines changedLines changed: 23 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2773 | 2773 |
| |
2774 | 2774 |
| |
2775 | 2775 |
| |
2776 |
| - | |
| 2776 | + | |
2777 | 2777 |
| |
2778 | 2778 |
| |
2779 |
| - | |
| 2779 | + | |
2780 | 2780 |
| |
2781 | 2781 |
| |
2782 | 2782 |
| |
2783 | 2783 |
| |
2784 | 2784 |
| |
2785 | 2785 |
| |
2786 | 2786 |
| |
2787 |
| - | |
| 2787 | + | |
2788 | 2788 |
| |
2789 |
| - | |
| 2789 | + | |
2790 | 2790 |
| |
2791 | 2791 |
| |
2792 | 2792 |
| |
| |||
3026 | 3026 |
| |
3027 | 3027 |
| |
3028 | 3028 |
| |
3029 |
| - | |
| 3029 | + | |
3030 | 3030 |
| |
3031 | 3031 |
| |
3032 | 3032 |
| |
3033 |
| - | |
| 3033 | + | |
3034 | 3034 |
| |
3035 | 3035 |
| |
3036 | 3036 |
| |
| |||
3045 | 3045 |
| |
3046 | 3046 |
| |
3047 | 3047 |
| |
3048 |
| - | |
| 3048 | + | |
3049 | 3049 |
| |
3050 |
| - | |
| 3050 | + | |
3051 | 3051 |
| |
3052 |
| - | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
3053 | 3056 |
| |
3054 | 3057 |
| |
3055 | 3058 |
| |
| |||
3311 | 3314 |
| |
3312 | 3315 |
| |
3313 | 3316 |
| |
3314 |
| - | |
| 3317 | + | |
3315 | 3318 |
| |
3316 | 3319 |
| |
3317 | 3320 |
| |
3318 |
| - | |
| 3321 | + | |
3319 | 3322 |
| |
3320 | 3323 |
| |
3321 | 3324 |
| |
3322 | 3325 |
| |
3323 | 3326 |
| |
3324 |
| - | |
| 3327 | + | |
3325 | 3328 |
| |
3326 | 3329 |
| |
3327 | 3330 |
| |
| |||
3361 | 3364 |
| |
3362 | 3365 |
| |
3363 | 3366 |
| |
3364 |
| - | |
3365 |
| - | |
3366 |
| - | |
3367 |
| - | |
3368 |
| - | |
3369 |
| - | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
3370 | 3371 |
| |
3371 | 3372 |
| |
3372 | 3373 |
| |
3373 | 3374 |
| |
3374 | 3375 |
| |
3375 |
| - | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
3376 | 3379 |
| |
3377 |
| - | |
3378 |
| - | |
| 3380 | + | |
3379 | 3381 |
| |
3380 | 3382 |
| |
3381 | 3383 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
| 479 | + | |
479 | 480 |
| |
480 | 481 |
| |
481 | 482 |
| |
|
0 commit comments
Comments
(0)