forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb568d38
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 parent0ae841a commitb568d38
File tree
4 files changed
+29
-4
lines changed- src
- backend/executor
- include
- executor
- nodes
4 files changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1991 | 1991 | | |
1992 | 1992 | | |
1993 | 1993 | | |
| 1994 | + | |
1994 | 1995 | | |
1995 | 1996 | | |
1996 | 1997 | | |
| |||
2072 | 2073 | | |
2073 | 2074 | | |
2074 | 2075 | | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
2079 | 2082 | | |
| 2083 | + | |
| 2084 | + | |
2080 | 2085 | | |
| 2086 | + | |
| 2087 | + | |
2081 | 2088 | | |
2082 | 2089 | | |
2083 | 2090 | | |
| |||
| 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 | | |
| |||
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
230 | 245 | | |
231 | 246 | | |
232 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1391 | 1391 | | |
1392 | 1392 | | |
1393 | 1393 | | |
| 1394 | + | |
1394 | 1395 | | |
1395 | 1396 | | |
1396 | 1397 | | |
| |||
1400 | 1401 | | |
1401 | 1402 | | |
1402 | 1403 | | |
| 1404 | + | |
1403 | 1405 | | |
1404 | 1406 | | |
1405 | 1407 | | |
| |||
0 commit comments
Comments
(0)