forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4b8860e
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 parentd93c056 commit4b8860e
1 file changed
+4
-4
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
546 | 546 |
| |
547 | 547 |
| |
548 | 548 |
| |
549 |
| - | |
550 |
| - | |
| 549 | + | |
| 550 | + | |
551 | 551 |
| |
552 |
| - | |
| 552 | + | |
553 | 553 |
| |
554 | 554 |
| |
555 | 555 |
| |
| |||
563 | 563 |
| |
564 | 564 |
| |
565 | 565 |
| |
566 |
| - | |
| 566 | + | |
567 | 567 |
| |
568 | 568 |
| |
569 | 569 |
| |
|
0 commit comments
Comments
(0)