postgresql/src/include/executor
Tom Lane c1f8fb9bfb Avoid leaking memory while evaluating arguments for a table function.
ExecMakeTableFunctionResult evaluated the arguments for a function-in-FROM
in the query-lifespan memory context.  This is insignificant in simple
cases where the function relation is scanned only once; but if the function
is in a sub-SELECT or is on the inside of a nested loop, any memory
consumed during argument evaluation can add up quickly.  (The potential for
trouble here had been foreseen long ago, per existing comments; but we'd
not previously seen a complaint from the field about it.)  To fix, create
an additional temporary context just for this purpose.

Per an example from MauMau.  Back-patch to all active branches.
2014-06-19 22:13:47 -04:00
..
execdebug.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
execdesc.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
executor.h Avoid leaking memory while evaluating arguments for a table function. 2014-06-19 22:13:47 -04:00
functions.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
hashjoin.h Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
instrument.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeAgg.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeAppend.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapAnd.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapHeapscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapIndexscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapOr.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeCtescan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeForeignscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeFunctionscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeGroup.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeHash.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeHashjoin.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeIndexonlyscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeIndexscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeLimit.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeLockRows.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeMaterial.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeMergeAppend.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeMergejoin.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeModifyTable.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeNestloop.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeRecursiveunion.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeResult.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSeqscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSetOp.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSort.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSubplan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSubqueryscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeTidscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeUnique.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeValuesscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeWindowAgg.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeWorktablescan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
spi.h Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:45:47 -04:00
spi_priv.h Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
tstoreReceiver.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tuptable.h Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00