forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit648bd05
committed
Re-allow duplicate aliases within aliased JOINs.
Although the SQL spec forbids duplicate table aliases, historicallywe've allowed queries like SELECT ... FROM tab1 x CROSS JOIN (tab2 x CROSS JOIN tab3 y) zon the grounds that the aliased join (z) hides the aliases within it,therefore there is no conflict between the two RTEs named "x". TheLATERAL patch broke this, on the misguided basis that "x" could beambiguous if tab3 were a LATERAL subquery. To avoid breaking existingqueries, it's better to allow this situation and complain only iftab3 actually does contain an ambiguous reference. We need only removethe check that was throwing an error, because the column lookup codeis already prepared to handle ambiguous references. Per bug #8444.1 parent705556a commit648bd05
File tree
4 files changed
+52
-4
lines changed- src
- backend/parser
- test/regress
- expected
- sql
4 files changed
+52
-4
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
720 | 720 |
| |
721 | 721 |
| |
722 | 722 |
| |
| 723 | + | |
| 724 | + | |
| 725 | + | |
723 | 726 |
| |
724 | 727 |
| |
725 | 728 |
| |
726 | 729 |
| |
727 | 730 |
| |
728 | 731 |
| |
729 |
| - | |
730 |
| - | |
731 | 732 |
| |
732 | 733 |
| |
733 | 734 |
| |
|
Lines changed: 13 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
133 | 145 |
| |
134 | 146 |
| |
135 | 147 |
| |
| |||
174 | 186 |
| |
175 | 187 |
| |
176 | 188 |
| |
177 |
| - | |
178 |
| - | |
| 189 | + | |
179 | 190 |
| |
180 | 191 |
| |
181 | 192 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3093 | 3093 |
| |
3094 | 3094 |
| |
3095 | 3095 |
| |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
3096 | 3114 |
| |
3097 | 3115 |
| |
3098 | 3116 |
| |
| |||
3947 | 3965 |
| |
3948 | 3966 |
| |
3949 | 3967 |
| |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
3950 | 3974 |
| |
3951 | 3975 |
| |
3952 | 3976 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
892 | 892 |
| |
893 | 893 |
| |
894 | 894 |
| |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
895 | 904 |
| |
896 | 905 |
| |
897 | 906 |
| |
| |||
1079 | 1088 |
| |
1080 | 1089 |
| |
1081 | 1090 |
| |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1082 | 1094 |
| |
1083 | 1095 |
|
0 commit comments
Comments
(0)