forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit57cd2b6
committed
Fix create_scan_plan's handling of sortgrouprefs for physical tlists.
We should only run apply_pathtarget_labeling_to_tlist if CP_LABEL_TLISTwas specified, because only in that case has use_physical_tlist checkedthat the labeling will succeed; otherwise we may get an "ORDER/GROUP BYexpression not found in targetlist" error. (This subsumes the previoustest about gating_clauses, because we reset "flags" to zero earlierif there are gating clauses to apply.)The only known case in which a failure can occur is with a ProjectSetpath directly atop a table scan path, although it seems likely that thereare other cases or will be such in future. This means that the failureis currently only visible in the v10 branch: 9.6 didn't have ProjectSet,while in v11 and HEAD, apply_scanjoin_target_to_paths for some weirdreason is using create_projection_path not apply_projection_to_path,masking the problem because there's a ProjectionPath in between.Nonetheless this code is clearly wrong on its own terms, so back-patchto 9.6 where this logic was introduced.Per report from Regina Obe.Discussion:https://postgr.es/m/001501d40f88$75186950$5f493bf0$@pcorp.us1 parentff4f889 commit57cd2b6
File tree
3 files changed
+32
-5
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+32
-5
lines changedLines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
579 | 579 |
| |
580 | 580 |
| |
581 | 581 |
| |
582 |
| - | |
583 |
| - | |
| 582 | + | |
| 583 | + | |
584 | 584 |
| |
585 |
| - | |
| 585 | + | |
586 | 586 |
| |
587 | 587 |
| |
588 | 588 |
| |
| |||
596 | 596 |
| |
597 | 597 |
| |
598 | 598 |
| |
599 |
| - | |
| 599 | + | |
600 | 600 |
| |
601 | 601 |
| |
602 | 602 |
| |
| |||
1639 | 1639 |
| |
1640 | 1640 |
| |
1641 | 1641 |
| |
1642 |
| - | |
| 1642 | + | |
1643 | 1643 |
| |
1644 | 1644 |
| |
1645 | 1645 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
421 | 421 |
| |
422 | 422 |
| |
423 | 423 |
| |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
424 | 446 |
| |
425 | 447 |
| |
426 | 448 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 |
| |
92 | 97 |
| |
93 | 98 |
| |
|
0 commit comments
Comments
(0)