pgsql: Follow-up fixes for "Make all Perl warnings fatal"

Started by Peter Eisentrautover 2 years ago3 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Follow-up fixes for "Make all Perl warnings fatal"

Mostly, we need to check whether $ENV{PG_TEST_EXTRA} is set before
doing regular expression matches against it.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d49837d7144e27ad8ea8918acb28f9872cb1585

Modified Files
--------------
src/interfaces/libpq/t/004_load_balance_dns.pl | 2 +-
src/test/kerberos/t/001_auth.pl | 4 ++--
src/test/ldap/t/001_auth.pl | 2 +-
src/test/ldap/t/002_bindpasswd.pl | 2 +-
src/test/modules/ldap_password_func/t/001_mutated_bindpasswd.pl | 2 +-
src/test/modules/xid_wraparound/t/001_emergency_vacuum.pl | 2 +-
src/test/modules/xid_wraparound/t/002_limits.pl | 2 +-
src/test/modules/xid_wraparound/t/003_wraparounds.pl | 2 +-
src/test/ssl/t/001_ssltests.pl | 2 +-
src/test/ssl/t/002_scram.pl | 2 +-
src/test/ssl/t/003_sslinfo.pl | 2 +-
11 files changed, 12 insertions(+), 12 deletions(-)

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Peter Eisentraut (#1)
Re: pgsql: Follow-up fixes for "Make all Perl warnings fatal"

On 2023-12-29 Fr 17:56, Peter Eisentraut wrote:

Follow-up fixes for "Make all Perl warnings fatal"

Mostly, we need to check whether $ENV{PG_TEST_EXTRA} is set before
doing regular expression matches against it.

This reads a bit oddly to me.

-elsif ($ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)

I think I would have changed it like this

  elsif (($ENV{PG_TEST_EXTRA" || "") !~ /\bkerberos\b/)

which is an idiom we've used elsewhere.

Still, TIMTOWTDI.

cheers

andrew (japh)

--

Andrew Dunstan
EDB: https://www.enterprisedb.com

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#2)
Re: pgsql: Follow-up fixes for "Make all Perl warnings fatal"

On 02.01.24 15:49, Andrew Dunstan wrote:

On 2023-12-29 Fr 17:56, Peter Eisentraut wrote:

Follow-up fixes for "Make all Perl warnings fatal"

Mostly, we need to check whether $ENV{PG_TEST_EXTRA} is set before
doing regular expression matches against it.

This reads a bit oddly to me.

-elsif ($ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)

I think I would have changed it like this

  elsif (($ENV{PG_TEST_EXTRA" || "") !~ /\bkerberos\b/)

which is an idiom we've used elsewhere.

I would probably have written it that way, too, but there was already
existing code dealing specifically with PG_TEST_EXTRA that was written
the other way, so I made it match that.