diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-10-06 14:28:42 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-10-06 14:28:42 -0400 |
commit | a1c2c430d33e0945da234b025b78bd265c8bdfb5 (patch) | |
tree | 58551341e368115efa072e8b7eee155828372e92 /src/backend/executor/execSRF.c | |
parent | 6b87416c9a4dd305b76e619ecac36e2b968462f8 (diff) | |
download | postgresql-a1c2c430d33e0945da234b025b78bd265c8bdfb5.tar.gz postgresql-a1c2c430d33e0945da234b025b78bd265c8bdfb5.zip |
Fix intra-query memory leakage in nodeProjectSet.c.
Both ExecMakeFunctionResultSet() and evaluation of simple expressions
need to be done in the per-tuple memory context, not per-query, else
we leak data until end of query. This is a consideration that was
missed while refactoring code in the ProjectSet patch (note that in
pre-v10, ExecMakeFunctionResult is called in the per-tuple context).
Per bug #14843 from Ben M. Diagnosed independently by Andres and myself.
Discussion: https://postgr.es/m/20171005230321.28561.15927@wrigleys.postgresql.org
Diffstat (limited to 'src/backend/executor/execSRF.c')
-rw-r--r-- | src/backend/executor/execSRF.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/executor/execSRF.c b/src/backend/executor/execSRF.c index 8bc90a6c7e8..1be683db83d 100644 --- a/src/backend/executor/execSRF.c +++ b/src/backend/executor/execSRF.c @@ -467,6 +467,8 @@ ExecInitFunctionResultSet(Expr *expr, * function itself. The argument expressions may not contain set-returning * functions (the planner is supposed to have separated evaluation for those). * + * This should be called in a short-lived (per-tuple) context. + * * This is used by nodeProjectSet.c. */ Datum |