]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_waldump: Fix error message for WAL files smaller than XLOG_BLCKSZ.
authorAndres Freund <andres@anarazel.de>
Fri, 25 Feb 2022 18:30:05 +0000 (10:30 -0800)
committerAndres Freund <andres@anarazel.de>
Fri, 25 Feb 2022 18:34:38 +0000 (10:34 -0800)
commit5407241a8ec1af770010d05715f0e3a31db5c518
tree68ac0886ead7ccfd404b5bc879b59b5c3691f890
parent0033fc63f5b2b763406f2299c426b9e1572fa244
pg_waldump: Fix error message for WAL files smaller than XLOG_BLCKSZ.

When opening a WAL file smaller than XLOG_BLCKSZ (e.g. 0 bytes long) while
determining the wal_segment_size, pg_waldump checked errno, despite errno not
being set by the short read. Resulting in a bogus error message.

Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20220214.181847.775024684568733277.horikyota.ntt@gmail.com
Backpatch: 11-, the bug was introducedin fc49e24fa
src/bin/pg_waldump/pg_waldump.c