pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix bug in TOC file error message printing
Date: Tue, 19 Oct 2021 11:20:17 +0000
Message-ID: <E1mcnAH-0000IA-Rc@gemulon.postgresql.org> (raw)

Fix bug in TOC file error message printing

If the blob TOC file cannot be parsed, the error message was failing
to print the filename as the variable holding it was shadowed by the
destination buffer for parsing.  When the filename fails to parse,
the error will print an empty string:

 ./pg_restore -d foo -F d dump
 pg_restore: error: invalid line in large object TOC file "": ..

..instead of the intended error message:

 ./pg_restore -d foo -F d dump
 pg_restore: error: invalid line in large object TOC file "dump/blobs.toc": ..

Fix by renaming both variables as the shared name was too generic to
store either and still convey what the variable held.

Backpatch all the way down to 9.6.

Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/A2B151F5-B32B-4F2C-BA4A-6870856D9BDE@yesql.se
Backpatch-through: 9.6

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/038892c8101845b6b4364cf2f5773207c4a4525c

Modified Files
--------------
src/bin/pg_dump/pg_backup_directory.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1mcnAH-0000IA-Rc@gemulon.postgresql.org>
Permalink:  ../E1mcnAH-0000IA-Rc@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mcnAH-0000IA-Rc@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org
  Subject: Re: pgsql: Fix bug in TOC file error message printing
  In-Reply-To: <E1mcnAH-0000IA-Rc@gemulon.postgresql.org>
  References: <E1mcnAH-0000IA-Rc@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox