postgresql/src/bin
Tom Lane bd037dc928 Make XLogRecGetBlockTag() throw error if there's no such block.
All but a few existing callers assume without checking that this
function succeeds.  While it probably will, that's a poor excuse for
not checking.  Let's make it return void and instead throw an error
if it doesn't find the block reference.  Callers that actually need
to handle the no-such-block case must now use the underlying function
XLogRecGetBlockTagExtended.

In addition to being a bit less error-prone, this should also serve
to suppress some Coverity complaints about XLogRecGetBlockRefInfo.

While at it, clean up some inconsistency about use of the
XLogRecHasBlockRef macro: make XLogRecGetBlockTagExtended use
that instead of open-coding the same condition, and avoid calling
XLogRecHasBlockRef twice in relevant code paths.  (That is,
calling XLogRecHasBlockRef followed by XLogRecGetBlockTag is now
deprecated: use XLogRecGetBlockTagExtended instead.)

Patch HEAD only; this doesn't seem to have enough value to consider
a back-branch API break.

Discussion: https://postgr.es/m/425039.1649701221@sss.pgh.pa.us
2022-04-11 17:43:53 -04:00
..
initdb Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_amcheck Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_archivecleanup Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_basebackup Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
pg_checksums Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_config Replace Test::More plans with done_testing 2022-02-11 20:54:44 +01:00
pg_controldata Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_ctl Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_dump Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_resetwal Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_rewind Make XLogRecGetBlockTag() throw error if there's no such block. 2022-04-11 17:43:53 -04:00
pg_test_fsync Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_test_timing Remove unused module imports from TAP tests 2022-03-24 20:51:40 +01:00
pg_upgrade Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_verifybackup Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_waldump Make XLogRecGetBlockTag() throw error if there's no such block. 2022-04-11 17:43:53 -04:00
pgbench Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
pgevent Update copyright for 2022 2022-01-07 19:04:57 -05:00
psql Tweak the default behavior of psql's \dconfig. 2022-04-11 15:11:46 -04:00
scripts Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00