forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit579ee5d
committed
Fix memory leak in Memoize cache key evaluation
When probing the Memoize cache to check if the current cache key valuesexist in the cache, we perform an evaluation of the expressions making upthe cache key before probing the hash table for those values. Thisoperation could leak memory as it is possible that the cache key is anexpression which requires allocation of memory, as was the case in bug17844.Here we fix this by correctly switching to the per tuple context beforeevaluating the cache expressions so that the memory is freed next time theper tuple context is reset.Bug: 17844Reported-by: Alexey ErmakovDiscussion:https://postgr.es/m/17844-d2f6f9e75a622bed@postgresql.orgBackpatch-through: 14, where Memoize was introduced1 parente060cd5 commit579ee5d
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
289 | 289 |
| |
290 | 290 |
| |
291 | 291 |
| |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
292 | 297 |
| |
293 | 298 |
| |
294 | 299 |
| |
295 |
| - | |
| 300 | + | |
296 | 301 |
| |
| 302 | + | |
| 303 | + | |
297 | 304 |
| |
298 | 305 |
| |
299 | 306 |
| |
|
0 commit comments
Comments
(0)