- Notifications
You must be signed in to change notification settings - Fork5
Commitd6f7d4f
committed
Fix printing of whole-row Vars at top level of a SELECT targetlist.
Normally whole-row Vars are printed as "tabname.*". However, that does notwork at top level of a targetlist, because per SQL standard the parser willthink that the "*" should result in column-by-column expansion; which isnot at all what a whole-row Var implies. We used to just print the tablename in such cases, which works most of the time; but it fails if the tablename matches a column name available anywhere in the FROM clause. Thiscould lead for instance to a view being interpreted differently after dumpand reload. Adding parentheses doesn't fix it, but there is a reasonablysimple kluge we can use instead: attach a no-op cast, so that the "*" isn'tsyntactically at top level anymore. This makes the printing of suchwhole-row Vars a lot more consistent with other Vars, and may indeed fixmore cases than just the reported one; I'm suspicious that cases involvingschema qualification probably didn't work properly before, either.Per bug report and fix proposal from Abbas Butt, though this patch is quitedifferent in detail from his.Back-patch to all supported versions.1 parent993ce4e commitd6f7d4f
1 file changed
+32
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
3074 | 3074 | | |
3075 | 3075 | | |
3076 | 3076 | | |
3077 | | - | |
| 3077 | + | |
| 3078 | + | |
3078 | 3079 | | |
3079 | 3080 | | |
3080 | 3081 | | |
3081 | | - | |
| 3082 | + | |
3082 | 3083 | | |
3083 | 3084 | | |
3084 | 3085 | | |
| |||
3803 | 3804 | | |
3804 | 3805 | | |
3805 | 3806 | | |
3806 | | - | |
3807 | | - | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
3808 | 3815 | | |
3809 | | - | |
| 3816 | + | |
| 3817 | + | |
3810 | 3818 | | |
3811 | 3819 | | |
3812 | | - | |
| 3820 | + | |
3813 | 3821 | | |
3814 | 3822 | | |
3815 | 3823 | | |
| |||
3998 | 4006 | | |
3999 | 4007 | | |
4000 | 4008 | | |
4001 | | - | |
| 4009 | + | |
4002 | 4010 | | |
4003 | 4011 | | |
4004 | | - | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
4005 | 4019 | | |
4006 | 4020 | | |
4007 | 4021 | | |
| |||
4017 | 4031 | | |
4018 | 4032 | | |
4019 | 4033 | | |
4020 | | - | |
4021 | | - | |
| 4034 | + | |
4022 | 4035 | | |
4023 | 4036 | | |
4024 | 4037 | | |
4025 | | - | |
| 4038 | + | |
| 4039 | + | |
4026 | 4040 | | |
| 4041 | + | |
| 4042 | + | |
| 4043 | + | |
| 4044 | + | |
| 4045 | + | |
4027 | 4046 | | |
4028 | 4047 | | |
4029 | 4048 | | |
| |||
4974 | 4993 | | |
4975 | 4994 | | |
4976 | 4995 | | |
4977 | | - | |
| 4996 | + | |
4978 | 4997 | | |
4979 | 4998 | | |
4980 | 4999 | | |
| |||
0 commit comments
Comments
(0)