forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite6e804a
committed
In transformRowExpr(), check for too many columns in the row.
A RowExpr with more than MaxTupleAttributeNumber columns would fail atexecution anyway, since we cannot form a tuple datum with more than thatmany columns. While heap_form_tuple() has a check for too many columns,it emerges that there are some intermediate bits of code that don'tcheck and can be driven to failure with sufficiently many columns.Checking this at parse time seems like the most appropriate place toinstall a defense, since we already check SELECT list length there.While at it, make the SELECT-list-length error use the same errcode(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the genericPROGRAM_LIMIT_EXCEEDED.Per bug #17561 from Egor Chindyaskin. The given test case crashesin all supported branches (and probably a lot further back),so patch all.Discussion:https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org1 parent665ca54 commite6e804a
2 files changed
+9
-1
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2150 | 2150 |
| |
2151 | 2151 |
| |
2152 | 2152 |
| |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
2153 | 2161 |
| |
2154 | 2162 |
| |
2155 | 2163 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
| 85 | + | |
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
|
0 commit comments
Comments
(0)