- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit8e58f80
committed
Fix MakeTransitionCaptureState() to return a consistent result
When an UPDATE trigger referencing a new table and a DELETE triggerreferencing an old table are both present, MakeTransitionCaptureState()returns an inconsistent result for UPDATE commands in its set of flagsand tuplestores holding the TransitionCaptureState for transitiontables.As proved by the test added here, this issue causes a crash in v14 andearlier versions (down to 11, actually, older versions do not supporttriggers on partitioned tables) during cross-partition updates on apartitioned table. v15 and newer versions are safe thanks to7103ebb.This commit fixes the function so that it returns a consistent stateby using portions of the changes made in commit7103ebb for v13 andv14. v15 and newer versions are slightly tweaked to match with theolder versions, mainly for consistency across branches.Author: Kyotaro HoriguchiDiscussion:https://postgr.es/m/20250207.150238.968446820828052276.horikyota.ntt@gmail.comBackpatch-through: 131 parent80b23bf commit8e58f80
File tree
3 files changed
+115
-16
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+115
-16
lines changedLines changed: 20 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4511 | 4511 |
| |
4512 | 4512 |
| |
4513 | 4513 |
| |
4514 |
| - | |
4515 |
| - | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
| 4517 | + | |
4516 | 4518 |
| |
4517 | 4519 |
| |
4518 | 4520 |
| |
| |||
4524 | 4526 |
| |
4525 | 4527 |
| |
4526 | 4528 |
| |
4527 |
| - | |
4528 |
| - | |
| 4529 | + | |
| 4530 | + | |
4529 | 4531 |
| |
4530 | 4532 |
| |
4531 |
| - | |
4532 |
| - | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
4533 | 4536 |
| |
4534 | 4537 |
| |
4535 |
| - | |
4536 |
| - | |
| 4538 | + | |
| 4539 | + | |
4537 | 4540 |
| |
4538 | 4541 |
| |
4539 | 4542 |
| |
4540 |
| - | |
| 4543 | + | |
| 4544 | + | |
4541 | 4545 |
| |
4542 | 4546 |
| |
4543 |
| - | |
| 4547 | + | |
4544 | 4548 |
| |
4545 | 4549 |
| |
4546 | 4550 |
| |
| |||
4570 | 4574 |
| |
4571 | 4575 |
| |
4572 | 4576 |
| |
4573 |
| - | |
| 4577 | + | |
4574 | 4578 |
| |
4575 |
| - | |
| 4579 | + | |
4576 | 4580 |
| |
4577 | 4581 |
| |
4578 | 4582 |
| |
4579 | 4583 |
| |
4580 | 4584 |
| |
4581 | 4585 |
| |
4582 | 4586 |
| |
4583 |
| - | |
4584 |
| - | |
4585 |
| - | |
4586 |
| - | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
4587 | 4591 |
| |
4588 | 4592 |
| |
4589 | 4593 |
| |
|
Lines changed: 49 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2988 | 2988 |
| |
2989 | 2989 |
| |
2990 | 2990 |
| |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
2991 | 3040 |
| |
2992 | 3041 |
| |
2993 | 3042 |
| |
|
Lines changed: 46 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2115 | 2115 |
| |
2116 | 2116 |
| |
2117 | 2117 |
| |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
2118 | 2164 |
| |
2119 | 2165 |
| |
2120 | 2166 |
| |
|
0 commit comments
Comments
(0)