forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit237f876
committed
Fix intra-query memory leak when a SRF returns zero rows.
When looping around after finding that the set-returning functionreturned zero rows for the current input tuple, ExecProjectSetneglected to reset either of the two memory contexts it'sresponsible for cleaning out. Typically this wouldn't cause muchproblem, because once the SRF does return at least one row, thecontexts would get reset on the next call. However, if the SRFreturns no rows for many input tuples in succession, quite a lotof memory could be transiently consumed.To fix, make sure we reset both contexts while looping around.Per bug #18172 from Sergei Kornilov. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/18172-9b8c5fc1d676ded3@postgresql.org1 parent4d42b4e commit237f876
1 file changed
+17
-9
lines changedLines changed: 17 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 | 75 |
| |
85 | 76 |
| |
86 | 77 |
| |
87 | 78 |
| |
88 | 79 |
| |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
89 | 91 |
| |
90 | 92 |
| |
91 | 93 |
| |
| |||
111 | 113 |
| |
112 | 114 |
| |
113 | 115 |
| |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 |
| |
115 | 123 |
| |
116 | 124 |
| |
|
0 commit comments
Comments
(0)