mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user