- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitc5f365f
committed
Prevent multicolumn expansion of "foo.*" in an UPDATE source expression.
Because we use transformTargetList() for UPDATE as well as SELECTtlists, the code accidentally tried to expand a "*" reference intoseveral columns. This is nonsensical, because the UPDATE syntaxprovides exactly one target column to put the value into. Theimmediate result was that transformUpdateTargetList() got confusedand reported "UPDATE target count mismatch --- internal error".It seems better to treat such a reference as a plain whole-rowvariable, as it would be in other contexts. (This could produceuseful results when the target column is of composite type.)Fix by tweaking transformTargetList() to perform *-expansion onlyconditionally, depending on its exprKind parameter.Back-patch to 9.3. The problem exists further back, but a fix would bemuch more invasive before that, because transformTargetList() wasn'ttold what kind of list it was working on. Doesn't seem worth thetrouble given the lack of field reports. (I only noticed it becauseI was checking the code while trying to improve the documentation abouthow we handle "foo.*".)Discussion: <4308.1479595330@sss.pgh.pa.us>1 parent0832f2d commitc5f365f
File tree
3 files changed
+59
-21
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+59
-21
lines changedLines changed: 32 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
| 125 | + | |
125 | 126 |
| |
126 | 127 |
| |
127 | 128 |
| |
128 | 129 |
| |
129 | 130 |
| |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 |
| |
131 | 135 |
| |
132 | 136 |
| |
| |||
136 | 140 |
| |
137 | 141 |
| |
138 | 142 |
| |
139 |
| - | |
| 143 | + | |
140 | 144 |
| |
141 |
| - | |
142 |
| - | |
143 |
| - | |
| 145 | + | |
144 | 146 |
| |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
| 147 | + | |
155 | 148 |
| |
156 |
| - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
157 | 160 |
| |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
163 | 173 |
| |
164 | 174 |
| |
165 | 175 |
| |
166 | 176 |
| |
167 |
| - | |
| 177 | + | |
| 178 | + | |
168 | 179 |
| |
169 | 180 |
| |
170 | 181 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 |
| |
60 | 67 |
| |
61 | 68 |
| |
| |||
133 | 140 |
| |
134 | 141 |
| |
135 | 142 |
| |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
136 | 154 |
| |
137 | 155 |
| |
138 | 156 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 |
| |
44 | 48 |
| |
45 | 49 |
| |
| |||
70 | 74 |
| |
71 | 75 |
| |
72 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
73 | 82 |
| |
74 | 83 |
| |
75 | 84 |
| |
|
0 commit comments
Comments
(0)