forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commiteffcaa4
committed
Fix null-pointer-deref crash while doing COPY IN with check constraints.
In commitbf7ca15 I introduced anassumption that an RTE referenced by a whole-row Var must have a valid ereffield. This is false for RTEs constructed by DoCopy, and there are otherplaces taking similar shortcuts. Perhaps we should make all those placesgo through addRangeTableEntryForRelation or its siblings instead of havingad-hoc logic, but the most reliable fix seems to be to make the new code inExecEvalWholeRowVar cope if there's no eref. We can reasonably assume thatthere's no need to insert column aliases if no aliases were provided.Add a regression test case covering this, and also verifying that a sanecolumn name is in fact available in this situation.Although the known case only crashes in 9.4 and HEAD, it seems prudent toback-patch the code change to 9.2, since all the ingredients for a similarfailure exist in the variant patch applied to 9.3 and 9.2.Per report from Jean-Pierre Pelletier.1 parent5202944 commiteffcaa4
File tree
3 files changed
+57
-2
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+57
-2
lines changedLines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
898 | 898 |
| |
899 | 899 |
| |
900 | 900 |
| |
901 |
| - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
902 | 904 |
| |
903 | 905 |
| |
904 | 906 |
| |
| |||
907 | 909 |
| |
908 | 910 |
| |
909 | 911 |
| |
910 |
| - | |
| 912 | + | |
| 913 | + | |
911 | 914 |
| |
912 | 915 |
| |
913 | 916 |
| |
|
Lines changed: 35 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
255 | 255 |
| |
256 | 256 |
| |
257 | 257 |
| |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
258 | 293 |
| |
259 | 294 |
| |
260 | 295 |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
181 | 198 |
| |
182 | 199 |
| |
183 | 200 |
| |
|
0 commit comments
Comments
(0)