- Notifications
You must be signed in to change notification settings - Fork28
Commit88e6ad3
committed
Fix two memory leaks around force-storing tuples in slots.
As reported by Tom, when ExecStoreMinimalTuple() had to perform aconversion to store the minimal tuple in the slot, it forgot torespect the shouldFree flag, and leaked the tuple into the currentmemory context if true. Fix that by freeing the tuple in that case.Looking at the relevant code made me (Andres) realize that not havingthe shouldFree parameter to ExecForceStoreHeapTuple() was a badidea. Some callers had to locally implement the necessary logic, andin one case it was missing, creating a potential per-group leak innon-hashed aggregation.The choice to not free the tuple in ExecComputeStoredGenerated() isnot pretty, but not introduced by this commit - I'll start a separatediscussion about it.Reported-By: Tom LaneDiscussion:https://postgr.es/m/366.1555382816@sss.pgh.pa.us1 parent4d5840c commit88e6ad3
File tree
7 files changed
+41
-20
lines changed- contrib/postgres_fdw
- src
- backend
- commands
- executor
- include/executor
7 files changed
+41
-20
lines changedLines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3711 | 3711 |
| |
3712 | 3712 |
| |
3713 | 3713 |
| |
3714 |
| - | |
3715 |
| - | |
3716 |
| - | |
| 3714 | + | |
3717 | 3715 |
| |
3718 | 3716 |
| |
3719 | 3717 |
| |
|
Lines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2586 | 2586 |
| |
2587 | 2587 |
| |
2588 | 2588 |
| |
2589 |
| - | |
| 2589 | + | |
2590 | 2590 |
| |
2591 | 2591 |
| |
2592 | 2592 |
| |
| |||
2668 | 2668 |
| |
2669 | 2669 |
| |
2670 | 2670 |
| |
2671 |
| - | |
| 2671 | + | |
2672 | 2672 |
| |
2673 | 2673 |
| |
2674 | 2674 |
| |
| |||
2797 | 2797 |
| |
2798 | 2798 |
| |
2799 | 2799 |
| |
2800 |
| - | |
| 2800 | + | |
2801 | 2801 |
| |
2802 | 2802 |
| |
2803 | 2803 |
| |
| |||
2869 | 2869 |
| |
2870 | 2870 |
| |
2871 | 2871 |
| |
2872 |
| - | |
| 2872 | + | |
2873 | 2873 |
| |
2874 | 2874 |
| |
2875 | 2875 |
| |
| |||
2898 | 2898 |
| |
2899 | 2899 |
| |
2900 | 2900 |
| |
2901 |
| - | |
| 2901 | + | |
2902 | 2902 |
| |
2903 | 2903 |
| |
2904 | 2904 |
| |
| |||
3057 | 3057 |
| |
3058 | 3058 |
| |
3059 | 3059 |
| |
3060 |
| - | |
| 3060 | + | |
3061 | 3061 |
| |
3062 | 3062 |
| |
3063 | 3063 |
| |
| |||
3107 | 3107 |
| |
3108 | 3108 |
| |
3109 | 3109 |
| |
3110 |
| - | |
| 3110 | + | |
3111 | 3111 |
| |
3112 | 3112 |
| |
3113 | 3113 |
| |
| |||
3164 | 3164 |
| |
3165 | 3165 |
| |
3166 | 3166 |
| |
3167 |
| - | |
| 3167 | + | |
3168 | 3168 |
| |
3169 | 3169 |
| |
3170 | 3170 |
| |
| |||
3192 | 3192 |
| |
3193 | 3193 |
| |
3194 | 3194 |
| |
3195 |
| - | |
| 3195 | + | |
3196 | 3196 |
| |
3197 | 3197 |
| |
3198 | 3198 |
| |
| |||
3228 | 3228 |
| |
3229 | 3229 |
| |
3230 | 3230 |
| |
3231 |
| - | |
| 3231 | + | |
3232 | 3232 |
| |
3233 | 3233 |
| |
3234 | 3234 |
| |
|
Lines changed: 18 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1430 | 1430 |
| |
1431 | 1431 |
| |
1432 | 1432 |
| |
1433 |
| - | |
| 1433 | + | |
| 1434 | + | |
1434 | 1435 |
| |
1435 | 1436 |
| |
1436 | 1437 |
| |
1437 |
| - | |
| 1438 | + | |
1438 | 1439 |
| |
1439 | 1440 |
| |
1440 | 1441 |
| |
| |||
1447 | 1448 |
| |
1448 | 1449 |
| |
1449 | 1450 |
| |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
1450 | 1454 |
| |
1451 | 1455 |
| |
1452 | 1456 |
| |
1453 | 1457 |
| |
1454 | 1458 |
| |
1455 | 1459 |
| |
1456 | 1460 |
| |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1457 | 1467 |
| |
1458 | 1468 |
| |
1459 | 1469 |
| |
| |||
1481 | 1491 |
| |
1482 | 1492 |
| |
1483 | 1493 |
| |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
1484 | 1500 |
| |
1485 | 1501 |
| |
1486 | 1502 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1806 | 1806 |
| |
1807 | 1807 |
| |
1808 | 1808 |
| |
1809 |
| - | |
| 1809 | + | |
1810 | 1810 |
| |
1811 | 1811 |
| |
1812 | 1812 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
208 |
| - | |
| 208 | + | |
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
320 |
| - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
321 | 326 |
| |
322 | 327 |
| |
323 | 328 |
| |
| |||
979 | 984 |
| |
980 | 985 |
| |
981 | 986 |
| |
982 |
| - | |
| 987 | + | |
983 | 988 |
| |
984 | 989 |
| |
985 | 990 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
306 | 306 |
| |
307 | 307 |
| |
308 | 308 |
| |
309 |
| - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
310 | 312 |
| |
311 | 313 |
| |
312 | 314 |
| |
|
0 commit comments
Comments
(0)