- Notifications
You must be signed in to change notification settings - Fork5
Commitc12f02f
committed
Don't apply sortgroupref labels to a tlist that might not match.
If we need to use a gating Result node for pseudoconstant quals,create_scan_plan() intentionally suppresses use_physical_tlist's checkson whether there are matches for sortgroupref labels, on the grounds thatwe don't need matches because we can label the Result's projection outputproperly. However, it then called apply_pathtarget_labeling_to_tlistanyway. This oversight was harmless when written, but in commitaeb9ae6I made that function throw an error if there was no match. Thus, thecombination of a table scan, pseudoconstant quals, and a non-simple-Varsortgroupref column threw the dreaded "ORDER/GROUP BY expression not foundin targetlist" error. To fix, just skip applying the labeling in thiscase. Per report from Rushabh Lathia.Report: <CAGPqQf2iLB8t6t-XrL-zR233DFTXxEsfVZ4WSqaYfLupEoDxXA@mail.gmail.com>1 parent957616d commitc12f02f
File tree
3 files changed
+34
-4
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+34
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
548 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
549 | 554 | | |
550 | 555 | | |
551 | 556 | | |
| |||
557 | 562 | | |
558 | 563 | | |
559 | 564 | | |
560 | | - | |
561 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
562 | 568 | | |
563 | 569 | | |
564 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
754 | 773 | | |
755 | 774 | | |
756 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
273 | 278 | | |
274 | 279 | | |
275 | 280 | | |
| |||
0 commit comments
Comments
(0)