postgresql/src
Tom Lane 7ab6971c65 Fix intra-query memory leak when a SRF returns zero rows.
When looping around after finding that the set-returning function
returned zero rows for the current input tuple, ExecProjectSet
neglected to reset either of the two memory contexts it's
responsible for cleaning out.  Typically this wouldn't cause much
problem, because once the SRF does return at least one row, the
contexts would get reset on the next call.  However, if the SRF
returns no rows for many input tuples in succession, quite a lot
of memory could be transiently consumed.

To fix, make sure we reset both contexts while looping around.

Per bug #18172 from Sergei Kornilov.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18172-9b8c5fc1d676ded3@postgresql.org
2023-10-28 14:04:43 -04:00
..
backend Fix intra-query memory leak when a SRF returns zero rows. 2023-10-28 14:04:43 -04:00
bin Fix omission of column-level privileges in selective pg_restore. 2023-10-02 13:27:51 -04:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:51:27 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include windows: msvc: Define STDIN/OUT/ERR_FILENO. 2023-10-17 16:11:18 -05:00
interfaces Stamp 11.21. 2023-08-07 16:15:30 -04:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
pl Remove environment sensitivity in pl/tcl regression test. 2023-09-29 20:20:57 -04:00
port Stamp 11.21. 2023-08-07 16:15:30 -04:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:17 -04:00
test Back-patch test cases for timetz_zone/timetz_izone. 2023-10-17 13:55:45 -04:00
timezone Remove PHOT from our default timezone abbreviations list. 2023-10-28 11:55:30 -04:00
tools Fix exception safety bug in typcache.c. 2023-09-13 14:52:34 +12:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Suppress macOS warnings about duplicate libraries in link commands. 2023-09-29 14:07:30 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00