forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit043f6ff
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 parentc29a6dd commit043f6ff
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 | |
---|---|---|---|
| |||
4060 | 4060 |
| |
4061 | 4061 |
| |
4062 | 4062 |
| |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
4063 | 4085 |
| |
4064 | 4086 |
| |
4065 | 4087 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1134 | 1134 |
| |
1135 | 1135 |
| |
1136 | 1136 |
| |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1137 | 1145 |
| |
1138 | 1146 |
| |
1139 | 1147 |
| |
|
0 commit comments
Comments
(0)