postgresql/src/include/nodes
Andrew Gierth 556140424c Avoid query-lifetime memory leaks in XMLTABLE (bug #15321)
Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a
table with an xml column, an important use-case) were leaking large
amounts of memory into the per-query context, blowing up memory usage.

Repair by reorganizing memory context usage in nodeTableFuncscan; use
the usual per-tuple context for row-by-row evaluations instead of
perValueCxt, and use the explicitly created context -- renamed from
perValueCxt to perTableCxt -- for arguments and state for each
individual table-generation operation.

Backpatch to PG10 where this code was introduced.

Original report by IRC user begriffs; analysis and patch by me.
Reviewed by Tom Lane and Pavel Stehule.

Discussion: https://postgr.es/m/153394403528.10284.7530399040974170549@wrigleys.postgresql.org
2018-08-13 02:03:54 +01:00
..
bitmapset.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
execnodes.h Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) 2018-08-13 02:03:54 +01:00
extensible.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
lockoptions.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
makefuncs.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
memnodes.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nodeFuncs.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nodes.h Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
params.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
parsenodes.h Fix misc typos, mostly in comments. 2018-07-18 16:18:27 +03:00
pg_list.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
plannodes.h Force rescanning of parallel-aware scan nodes below a Gather[Merge]. 2017-08-30 09:29:56 -04:00
primnodes.h Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
print.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
readfuncs.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
relation.h Change more places to be less trusting of RestrictInfo.is_pushed_down. 2018-04-20 15:19:16 -04:00
replnodes.h Add a WAIT option to DROP_REPLICATION_SLOT 2017-09-01 13:53:34 +02:00
tidbitmap.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
value.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00