forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita4aa854
committed
Fix bogus handling of "postponed" lateral quals.
When pulling a "postponed" qual from a LATERAL subquery up into the qualsof an outer join, we must make sure that the postponed qual is includedin those seen by make_outerjoininfo(). Otherwise we might compute atoo-small min_lefthand or min_righthand for the outer join, leading to"JOIN qualification cannot refer to other relations" failures fromdistribute_qual_to_rels. Subtler errors in the created plan seem possible,too, if the extra qual would only affect join ordering constraints.Per bug #9041 from David Leverton. Back-patch to 9.3.1 parente3ec801 commita4aa854
File tree
3 files changed
+59
-27
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+59
-27
lines changedLines changed: 29 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
797 | 797 |
| |
798 | 798 |
| |
799 | 799 |
| |
| 800 | + | |
800 | 801 |
| |
801 | 802 |
| |
802 | 803 |
| |
| |||
895 | 896 |
| |
896 | 897 |
| |
897 | 898 |
| |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
898 | 925 |
| |
899 | 926 |
| |
900 | 927 |
| |
| |||
910 | 937 |
| |
911 | 938 |
| |
912 | 939 |
| |
913 |
| - | |
| 940 | + | |
914 | 941 |
| |
915 | 942 |
| |
916 | 943 |
| |
| |||
923 | 950 |
| |
924 | 951 |
| |
925 | 952 |
| |
926 |
| - | |
927 |
| - | |
928 |
| - | |
929 |
| - | |
930 |
| - | |
931 |
| - | |
932 |
| - | |
933 |
| - | |
934 |
| - | |
935 |
| - | |
936 |
| - | |
937 |
| - | |
938 |
| - | |
939 |
| - | |
940 |
| - | |
941 |
| - | |
942 |
| - | |
943 |
| - | |
944 |
| - | |
945 |
| - | |
946 |
| - | |
947 |
| - | |
948 |
| - | |
949 |
| - | |
950 |
| - | |
951 | 953 |
| |
952 |
| - | |
| 954 | + | |
953 | 955 |
| |
954 | 956 |
| |
955 | 957 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4012 | 4012 |
| |
4013 | 4013 |
| |
4014 | 4014 |
| |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
| 4022 | + | |
| 4023 | + | |
| 4024 | + | |
| 4025 | + | |
| 4026 | + | |
| 4027 | + | |
| 4028 | + | |
| 4029 | + | |
| 4030 | + | |
| 4031 | + | |
| 4032 | + | |
| 4033 | + | |
| 4034 | + | |
| 4035 | + | |
| 4036 | + | |
4015 | 4037 |
| |
4016 | 4038 |
| |
4017 | 4039 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1120 | 1120 |
| |
1121 | 1121 |
| |
1122 | 1122 |
| |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1123 | 1131 |
| |
1124 | 1132 |
| |
1125 | 1133 |
| |
|
0 commit comments
Comments
(0)