forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit15907c3
committed
Fix dangling-pointer problem in before-row update trigger processing.
ExecUpdate checked for whether ExecBRUpdateTriggers had returned a newtuple value by seeing if the returned tuple was pointer-equal to the oldone. But the "old one" was in estate->es_junkFilter's result slot, whichwould be scribbled on if we had done an EvalPlanQual update in response toa concurrent update of the target tuple; therefore we were comparing adangling pointer to a live one. Given the right set of circumstances wecould get a false match, resulting in not forcing the tuple to be stored inthe slot we thought it was stored in. In the case reported by Maxim Bogukin bug #5798, this led to "cannot extract system attribute from virtualtuple" failures when trying to do "RETURNING ctid". I believe there is avery-low-probability chance of more serious errors, such as generatingincorrect index entries based on the original rather than thetrigger-modified version of the row.In HEAD, change all of ExecBRInsertTriggers, ExecIRInsertTriggers,ExecBRUpdateTriggers, and ExecIRUpdateTriggers so that they continue tohave similar APIs. In the back branches I just changedExecBRUpdateTriggers, since there is no bug in the ExecBRInsertTriggerscase.1 parentb22e2d6 commit15907c3
File tree
3 files changed
+47
-33
lines changed- src
- backend
- commands
- executor
- include/commands
3 files changed
+47
-33
lines changedLines changed: 40 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2172 | 2172 |
| |
2173 | 2173 |
| |
2174 | 2174 |
| |
2175 |
| - | |
| 2175 | + | |
2176 | 2176 |
| |
2177 | 2177 |
| |
2178 |
| - | |
| 2178 | + | |
2179 | 2179 |
| |
2180 | 2180 |
| |
2181 | 2181 |
| |
2182 | 2182 |
| |
| 2183 | + | |
| 2184 | + | |
2183 | 2185 |
| |
2184 | 2186 |
| |
2185 | 2187 |
| |
2186 |
| - | |
2187 | 2188 |
| |
2188 | 2189 |
| |
2189 | 2190 |
| |
| |||
2194 | 2195 |
| |
2195 | 2196 |
| |
2196 | 2197 |
| |
2197 |
| - | |
| 2198 | + | |
2198 | 2199 |
| |
2199 |
| - | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
2200 | 2207 |
| |
2201 | 2208 |
| |
2202 |
| - | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
2203 | 2214 |
| |
2204 | 2215 |
| |
2205 | 2216 |
| |
| |||
2226 | 2237 |
| |
2227 | 2238 |
| |
2228 | 2239 |
| |
2229 |
| - | |
| 2240 | + | |
2230 | 2241 |
| |
2231 | 2242 |
| |
2232 |
| - | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
2233 | 2247 |
| |
2234 | 2248 |
| |
2235 |
| - | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
2236 | 2267 |
| |
2237 | 2268 |
| |
2238 | 2269 |
| |
|
Lines changed: 5 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
453 | 453 |
| |
454 | 454 |
| |
455 | 455 |
| |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
| 456 | + | |
| 457 | + | |
460 | 458 |
| |
461 |
| - | |
| 459 | + | |
462 | 460 |
| |
463 | 461 |
| |
464 |
| - | |
465 |
| - | |
466 |
| - | |
467 |
| - | |
468 |
| - | |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
| 462 | + | |
| 463 | + | |
481 | 464 |
| |
482 | 465 |
| |
483 | 466 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
152 |
| - | |
| 152 | + | |
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 |
| - | |
| 156 | + | |
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
|
0 commit comments
Comments
(0)