pgsql: pg_resetwal: Prevent division-by-zero errors - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: pg_resetwal: Prevent division-by-zero errors
Date
Msg-id E1ezNcu-0005st-48@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
pg_resetwal: Prevent division-by-zero errors

Handle the case where the pg_control file specifies a WAL segment size
of 0 bytes.  This would previously have led to a division by zero error.
Change this to assume the whole file is corrupt and go to guess
everything.

Discussion: https://www.postgresql.org/message-id/a6163ad7-cc99-fdd1-dfad-25df73032ab8%402ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f1a074b146c900bd439b6ef1953866f41b61a669

Modified Files
--------------
src/bin/pg_resetwal/pg_resetwal.c      |  4 +--
src/bin/pg_resetwal/t/002_corrupted.pl | 47 ++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Allow FOR EACH ROW triggers on partitioned tables
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Fix interaction of Perl and stdbool.h