pgsql: Fix thinko coming from 000f3adf

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix thinko coming from 000f3adf
Date: 2022-01-08 00:13:01
Message-ID: E1n5zLx-0005Lw-7U@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix thinko coming from 000f3adf

pg_basebackup.c relies on the compression level to not be 0 to decide if
compression should be used, but 000f3adf missed the fact that the
default compression (Z_DEFAULT_COMPRESSION) is -1, which would be used
if specifying --gzip without --compress.

While on it, add some coverage for --gzip, as this is rather easy to
miss.

Reported-by: Christoph Berg
Discussion: https://postgr.es/m/YdhRDMLjabtXOnhY@msg.df7cb.de

Branch
------
master

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

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 2 +-
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 21 +++++++++++++++++----
2 files changed, 18 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-01-08 00:16:13 Re: pgsql: Refactor tar method of walmethods.c to rely on the compression m
Previous Message Bruce Momjian 2022-01-08 00:05:31 pgsql: Update copyright for 2022