pgsql: psql: Fix some scan-build warnings

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Fix some scan-build warnings
Date: 2021-10-12 19:34:35
Message-ID: E1maNXn-0004Ge-NP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

psql: Fix some scan-build warnings

A repeated complaint was that scan-build thought that if the \timing
setting changes during processing of a query, the post-processing
might read garbage time values. This is probably not possible right
now, but it's not entirely inconceivable given the code structure. So
silence this warning with small restructuring that makes this more
robust. The other warnings were a few dead stores that are easy to
remove.

Discussion: https://www.postgresql.org/message-id/2570e2ae-fa0f-aac9-f72f-bb59a9983a20@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/390edeeb570c01de1a14e2985ffed96de001e42e

Modified Files
--------------
src/bin/psql/common.c | 32 ++++++++++++++++++--------------
src/bin/psql/copy.c | 1 -
src/bin/psql/describe.c | 1 -
3 files changed, 18 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-10-13 00:23:51 pgsql: Fix tests of pg_upgrade across different major versions
Previous Message Peter Geoghegan 2021-10-12 18:00:50 pgsql: Doc: normalize vacuum_multixact_failsafe_age ID.