postgresql/src
Tom Lane 131ea3e908 Fix plancache refcount leak after error in ExecuteQuery.
When stuffing a plan from the plancache into a Portal, one is
not supposed to risk throwing an error between GetCachedPlan and
PortalDefineQuery; if that happens, the plan refcount incremented
by GetCachedPlan will be leaked.  I managed to break this rule
while refactoring code in 9dbf2b7d7.  There is no visible
consequence other than some memory leakage, and since nobody is
very likely to trigger the relevant error conditions many times
in a row, it's not surprising we haven't noticed.  Nonetheless,
it's a bug, so rearrange the order of operations to remove the
hazard.

Noted on the way to looking for a better fix for bug #17053.
This mistake is pretty old, so back-patch to all supported
branches.
2021-06-16 19:30:17 -04:00
..
backend Fix plancache refcount leak after error in ExecuteQuery. 2021-06-16 19:30:17 -04:00
bin Work around portability issue with newer versions of mktime(). 2021-06-13 14:32:42 -04:00
common Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
fe_utils Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
include Revert 29854ee8d1 due to buildfarm failures 2021-06-15 21:44:40 +03:00
interfaces Add 'Portal Close' message to pipelined PQsendQuery() 2021-06-11 16:05:50 -04:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
port Fix error handling in replacement pthread_barrier_init(). 2021-06-01 11:31:06 +12:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Update another variant expected-result file. 2021-06-15 16:11:45 -04:00
timezone Update time zone data files to tzdata release 2021a. 2021-01-24 16:29:47 -05:00
tools fix syntax error 2021-05-28 09:35:11 -04:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Update Unicode data to CLDR 39 2021-04-08 08:28:03 +02:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00