postgresql/src/backend/storage/file
Tom Lane 6b8235d035 Don't Insert() a VFD entry until it's fully built.
Otherwise, if FDDEBUG is enabled, the debugging output fails because
it tries to read the fileName, which isn't set up yet (and should in
fact always be NULL).

AFAICT, this has been wrong since Berkeley.  Before 96bf88d52,
it would accidentally fail to crash on platforms where snprintf()
is forgiving about being passed a NULL pointer for %s; but the
file name intended to be included in the debug output wouldn't
ever have shown up.

Report and fix by Greg Nancarrow.  Although this is only visibly
broken in custom-made builds, it still seems worth back-patching
to all supported branches, as the FDDEBUG code is pretty useless
as it stands.

Discussion: https://postgr.es/m/CAJcOf-cUDgm9qYtC_B6XrC6MktMPNRby2p61EtSGZKnfotMArw@mail.gmail.com
2020-11-16 20:32:35 -05:00
..
buffile.c Fix error message. 2020-07-23 21:18:02 +12:00
copydir.c Refactor dir/file permissions 2018-04-07 17:45:39 -04:00
fd.c Don't Insert() a VFD entry until it's fully built. 2020-11-16 20:32:35 -05:00
Makefile Add infrastructure for sharing temporary files between backends. 2017-12-01 16:30:56 -08:00
reinit.c Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
sharedfileset.c Fix temporary tablespaces for shared filesets some more. 2020-07-03 17:01:34 -04:00