- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitc3928b4
committed
Fix segfault during EvalPlanQual with mix of local and foreign partitions.
It's not sensible to re-evaluate a direct-modify Foreign Update or Deleteduring EvalPlanQual. However, ExecInitForeignScan() can still get calledif a table mixes local and foreign partitions. EvalPlanQualStart() leftthe es_result_relations array uninitialized in the child EPQ EState, butExecInitForeignScan() still expected to find it. That caused a segfault.Fix by skipping the es_result_relations lookup during EvalPlanQualprocessing. To make things a bit more robust, also skip theBeginDirectModify calls, and add a runtime check that ExecForeignScan()is not called on direct-modify foreign scans during EvalPlanQualprocessing.This is new in v14, commit1375422. Before that, EvalPlanQualStart()copied the whole ResultRelInfo array to the EPQ EState. Backpatch to v14.Report and diagnosis by Andrey Lepikhov.Discussion:https://www.postgresql.org/message-id/cb2b808d-cbaa-4772-76ee-c8809bafcf3d%40postgrespro.ru1 parenta6bd28b commitc3928b4
1 file changed
+41
-5
lines changedLines changed: 41 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 |
| |
| 62 | + | |
53 | 63 |
| |
54 | 64 |
| |
55 | 65 |
| |
| |||
223 | 233 |
| |
224 | 234 |
| |
225 | 235 |
| |
226 |
| - | |
227 |
| - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
228 | 245 |
| |
229 |
| - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
230 | 253 |
| |
| 254 | + | |
231 | 255 |
| |
232 | 256 |
| |
233 | 257 |
| |
| |||
238 | 262 |
| |
239 | 263 |
| |
240 | 264 |
| |
241 |
| - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
242 | 274 |
| |
243 | 275 |
| |
244 | 276 |
| |
| |||
255 | 287 |
| |
256 | 288 |
| |
257 | 289 |
| |
| 290 | + | |
258 | 291 |
| |
259 | 292 |
| |
260 | 293 |
| |
261 |
| - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
262 | 298 |
| |
263 | 299 |
| |
264 | 300 |
| |
|
0 commit comments
Comments
(0)