forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit43af714
committed
Fix order of operations in ExecEvalFieldStoreDeForm().
If the given composite datum is toasted out-of-line,DatumGetHeapTupleHeader will perform database accesses to detoast it.That can invalidate the result of get_cached_rowtype, as documented(perhaps not plainly enough) in that function's API spec; which leadsto strange errors or crashes when we try to use the TupleDesc to readthe tuple. In short then, trying to update a field of a compositecolumn could fail intermittently if the overall column value is wideenough to require toasting.We can fix the bug at no cost by just changing the order ofoperations, since we don't need the TupleDesc until after detoasting.(Other callers of get_cached_rowtype appear to get this right already,so there's only one bug.)Note that the added regression test case reveals this bug reliablyonly with debug_discard_caches/CLOBBER_CACHE_ALWAYS.Per bug #17994 from Alexander Lakhin. Sadly, this patch does not fixthe missing-values issue revealed in the bug discussion; we'll needsome more work to cover that.Discussion:https://postgr.es/m/17994-5c7100b51b4790e9@postgresql.org1 parentb750e74 commit43af714
File tree
3 files changed
+31
-12
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+31
-12
lines changedLines changed: 17 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2015 | 2015 |
| |
2016 | 2016 |
| |
2017 | 2017 |
| |
2018 |
| - | |
| 2018 | + | |
| 2019 | + | |
2019 | 2020 |
| |
2020 | 2021 |
| |
2021 | 2022 |
| |
| |||
3174 | 3175 |
| |
3175 | 3176 |
| |
3176 | 3177 |
| |
3177 |
| - | |
3178 |
| - | |
3179 |
| - | |
3180 |
| - | |
3181 |
| - | |
3182 |
| - | |
3183 |
| - | |
3184 |
| - | |
3185 |
| - | |
3186 |
| - | |
3187 |
| - | |
3188 | 3178 |
| |
3189 | 3179 |
| |
3190 | 3180 |
| |
| |||
3200 | 3190 |
| |
3201 | 3191 |
| |
3202 | 3192 |
| |
| 3193 | + | |
3203 | 3194 |
| |
3204 | 3195 |
| |
3205 | 3196 |
| |
3206 | 3197 |
| |
3207 | 3198 |
| |
3208 | 3199 |
| |
3209 | 3200 |
| |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
3210 | 3215 |
| |
3211 | 3216 |
| |
3212 | 3217 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
176 | 176 |
| |
177 | 177 |
| |
178 | 178 |
| |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
179 | 188 |
| |
180 | 189 |
| |
181 | 190 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
90 | 95 |
| |
91 | 96 |
| |
92 | 97 |
| |
|
0 commit comments
Comments
(0)