forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3850723
committed
Don't mess up pstate->p_next_resno in transformOnConflictClause().
transformOnConflictClause incremented p_next_resno while generating thephony targetlist for the EXCLUDED pseudo-rel. Then that field gotincremented some more during transformTargetList, possibly leading tofree_parsestate concluding that we'd overrun the allowed length of a tlist,as reported by Justin Pryzby.We could fix this by resetting p_next_resno to 1 after using it for theEXCLUDED pseudo-rel tlist, but it seems easier and less coupled to otherplaces if we just don't use that field at all in this loop. (Note thatthis doesn't change anything about the resnos that end up appearing inthe main target list, because those are all replaced with target-columnnumbers by updateTargetListEntry.)In passing, fix incorrect type OID assigned to the whole-row Var for"EXCLUDED.*" (somehow this escaped having any bad consequences so far,but it's certainly wrong); remove useless assignment to var->location;pstrdup the column names in case of a relcache flush; and improvenearby comments.Back-patch to 9.5 where ON CONFLICT was introduced.Report:https://postgr.es/m/20161204163237.GA8030@telsasoft.com1 parentd61aa6a commit3850723
1 file changed
+12
-15
lines changedLines changed: 12 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
996 | 996 |
| |
997 | 997 |
| |
998 | 998 |
| |
999 |
| - | |
1000 |
| - | |
1001 |
| - | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
1002 | 1002 |
| |
1003 |
| - | |
1004 | 1003 |
| |
1005 | 1004 |
| |
1006 | 1005 |
| |
| |||
1021 | 1020 |
| |
1022 | 1021 |
| |
1023 | 1022 |
| |
1024 |
| - | |
1025 |
| - | |
1026 |
| - | |
| 1023 | + | |
1027 | 1024 |
| |
1028 | 1025 |
| |
1029 |
| - | |
1030 | 1026 |
| |
1031 |
| - | |
| 1027 | + | |
1032 | 1028 |
| |
1033 | 1029 |
| |
1034 | 1030 |
| |
| |||
1037 | 1033 |
| |
1038 | 1034 |
| |
1039 | 1035 |
| |
1040 |
| - | |
1041 |
| - | |
1042 |
| - | |
1043 |
| - | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1044 | 1041 |
| |
1045 | 1042 |
| |
1046 |
| - | |
| 1043 | + | |
1047 | 1044 |
| |
1048 |
| - | |
| 1045 | + | |
1049 | 1046 |
| |
1050 | 1047 |
| |
1051 | 1048 |
| |
|
0 commit comments
Comments
(0)