diff options
author | Andrew Gierth <rhodiumtoad@postgresql.org> | 2018-08-13 01:45:35 +0100 |
---|---|---|
committer | Andrew Gierth <rhodiumtoad@postgresql.org> | 2018-08-13 02:03:12 +0100 |
commit | 78f70e07e2cf42b95c9f0adb57e37cf6c1274ec3 (patch) | |
tree | 56aedf411f0b06ca48e4287ac9321313be3d5ea0 /src/backend/executor/nodeModifyTable.c | |
parent | badaa0c50de0e1c8b1deb27d0a1ee00498e40002 (diff) | |
download | postgresql-78f70e07e2cf42b95c9f0adb57e37cf6c1274ec3.tar.gz postgresql-78f70e07e2cf42b95c9f0adb57e37cf6c1274ec3.zip |
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
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions