postgresql/src/backend/access
Tom Lane 4d2a844242 Allow callback functions to deregister themselves during a call.
Fetch the next-item pointer before the call not after, so that
we aren't dereferencing a dangling pointer if the callback
deregistered itself during the call.  The risky coding pattern
appears in CallXactCallbacks, CallSubXactCallbacks, and
ResourceOwnerReleaseInternal.  (There are some other places that
might be at hazard if they offered deregistration functionality,
but they don't.)

I (tgl) considered back-patching this, but desisted because it
wouldn't be very safe for extensions to rely on this working in
pre-v16 branches.

Hao Wu

Discussion: https://postgr.es/m/CAH+9SWXTiERkmhRke+QCcc+jRH8d5fFHTxh8ZK0-Yn4BSpyaAg@mail.gmail.com
2022-09-28 11:23:27 -04:00
..
brin meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
common meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
gin Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
gist Convert *GetDatum() and DatumGet*() macros to inline functions 2022-09-27 20:50:21 +02:00
hash meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
heap Fix race condition where heap_delete() fails to pin VM page. 2022-09-22 11:04:00 -07:00
index meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nbtree meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
rmgrdesc Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
spgist meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
table meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
tablesample meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
transam Allow callback functions to deregister themselves during a call. 2022-09-28 11:23:27 -04:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00