pgsql: Avoid uninitialized value error in TAP tests' Cluster->psql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid uninitialized value error in TAP tests' Cluster->psql
Date: 2025-06-30 14:15:40
Message-ID: E1uWFIK-0043Dq-1D@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid uninitialized value error in TAP tests' Cluster->psql

If the method is called in scalar context and we didn't pass in a stderr
handle, one won't be created. However, some error paths assume that it
exists, so in this case create a dummy stderr to avoid the resulting
perl error.

Per gripe from Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru> and
adapted from his patch.

Discussion: https://postgr.es/m/378eac5de4b8ecb5be7bcdf2db9d2c4d@postgrespro.ru

Branch
------
master

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

Modified Files
--------------
src/test/perl/PostgreSQL/Test/Cluster.pm | 8 ++++++++
1 file changed, 8 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2025-06-30 14:44:18 pgsql: aio: Fix reference to outdated name
Previous Message Peter Eisentraut 2025-06-30 10:25:10 pgsql: pgflex: propagate environment to flex subprocess