pgsql: pg_resetwal: Prevent division-by-zero errors

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_resetwal: Prevent division-by-zero errors
Date: 2018-03-23 14:25:04
Message-ID: E1ezNcu-0005st-48@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2018-03-23 14:33:33 pgsql: Fix interaction of Perl and stdbool.h
Previous Message Alvaro Herrera 2018-03-23 13:48:53 pgsql: Allow FOR EACH ROW triggers on partitioned tables