- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit0ab177b
committed
Remove faulty support for MergeAppend plan with WHERE CURRENT OF.
Somebody extended search_plan_tree() to treat MergeAppend exactlylike Append, which is 100% wrong, because unlike Append we can'tassume that only one input node is actively returning tuples.Hence a cursor using a MergeAppend across a UNION ALL or inheritancetree could falsely match a WHERE CURRENT OF query at a row thatisn't actually the cursor's current output row, but coincidentallyhas the same TID (in a different table) as the current output row.Delete the faulty code; this means that such a case will now returnan error like 'cursor "foo" is not a simply updatable scan of table"bar"', instead of silently misbehaving. Users should not find thatsurprising though, as the same cursor query could have failed that wayalready depending on the chosen plan. (It would fail like that if thesort were done with an explicit Sort node instead of MergeAppend.)Expand the clearly-inadequate commentary to be more explicit aboutwhat this code is doing, in hopes of forestalling future mistakes.It's been like this for awhile, so back-patch to all supportedbranches.Discussion:https://postgr.es/m/482865.1611075182@sss.pgh.pa.us1 parent33a4699 commit0ab177b
1 file changed
+27
-26
lines changedLines changed: 27 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
299 | 303 |
| |
300 | 304 |
| |
301 | 305 |
| |
| |||
314 | 318 |
| |
315 | 319 |
| |
316 | 320 |
| |
317 |
| - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
318 | 324 |
| |
319 | 325 |
| |
320 | 326 |
| |
| |||
339 | 345 |
| |
340 | 346 |
| |
341 | 347 |
| |
342 |
| - | |
343 |
| - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
344 | 368 |
| |
345 | 369 |
| |
346 | 370 |
| |
| |||
362 | 386 |
| |
363 | 387 |
| |
364 | 388 |
| |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
381 |
| - | |
382 |
| - | |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 | 389 |
| |
389 | 390 |
| |
390 | 391 |
| |
|
0 commit comments
Comments
(0)