forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit83131e6
committed
Avoid leaking memory while evaluating arguments for a table function.
ExecMakeTableFunctionResult evaluated the arguments for a function-in-FROMin the query-lifespan memory context. This is insignificant in simplecases where the function relation is scanned only once; but if the functionis in a sub-SELECT or is on the inside of a nested loop, any memoryconsumed during argument evaluation can add up quickly. (The potential fortrouble here had been foreseen long ago, per existing comments; but we'dnot previously seen a complaint from the field about it.) To fix, createan additional temporary context just for this purpose.Per an example from MauMau. Back-patch to all active branches.1 parentb5c9a3b commit83131e6
File tree
4 files changed
+29
-4
lines changed- src
- backend/executor
- include
- executor
- nodes
4 files changed
+29
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1985 | 1985 |
| |
1986 | 1986 |
| |
1987 | 1987 |
| |
| 1988 | + | |
1988 | 1989 |
| |
1989 | 1990 |
| |
1990 | 1991 |
| |
| |||
2063 | 2064 |
| |
2064 | 2065 |
| |
2065 | 2066 |
| |
2066 |
| - | |
2067 |
| - | |
2068 |
| - | |
2069 |
| - | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
2070 | 2073 |
| |
| 2074 | + | |
| 2075 | + | |
2071 | 2076 |
| |
2072 | 2077 |
| |
| 2078 | + | |
| 2079 | + | |
2073 | 2080 |
| |
2074 | 2081 |
| |
2075 | 2082 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
| |||
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
| 68 | + | |
67 | 69 |
| |
68 | 70 |
| |
69 | 71 |
| |
| |||
223 | 225 |
| |
224 | 226 |
| |
225 | 227 |
| |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
226 | 241 |
| |
227 | 242 |
| |
228 | 243 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
| 210 | + | |
210 | 211 |
| |
211 | 212 |
| |
212 | 213 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1315 | 1315 |
| |
1316 | 1316 |
| |
1317 | 1317 |
| |
| 1318 | + | |
1318 | 1319 |
| |
1319 | 1320 |
| |
1320 | 1321 |
| |
| |||
1324 | 1325 |
| |
1325 | 1326 |
| |
1326 | 1327 |
| |
| 1328 | + | |
1327 | 1329 |
| |
1328 | 1330 |
| |
1329 | 1331 |
| |
|
0 commit comments
Comments
(0)