From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Plug leak in BuildTupleHashTable by creating ExprContext in corr |
Date: | 2019-02-09 09:38:51 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Plug leak in BuildTupleHashTable by creating ExprContext in correct context.
In bf6c614a2f2c5 I added a expr context to evaluate the grouping
expression. Unfortunately the code I added initialized them while in
the calling context, rather the table context. Additionally, I used
CreateExprContext() rather than CreateStandaloneExprContext(), which
creates the econtext in the estate's query context.
Fix that by using CreateStandaloneExprContext when in the table's
tablecxt. As we rely on the memory being freed by a memory context
reset that means that the econtext's shutdown callbacks aren't being
called, but that seems ok as the expressions are tightly controlled
due to ExecBuildGroupingEqual().
Bug: #15592
Reported-By: Dmitry Marakasov
Author: Andres Freund
Discussion: https://postgr.es/m/[email protected]
Backpatch: 11, where I broke this in bf6c614a2f2c5
Branch
------
master
Modified Files
--------------
src/backend/executor/execGrouping.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2019-02-09 09:38:56 | pgsql: Allow to reset execGrouping.c style tuple hashtables. |
Previous Message | Tom Lane | 2019-02-09 01:17:21 | pgsql: First-draft release notes for 11.2. |