Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit686db12

Browse files
committed
Fix an issue in PostgreSQL::Test::Cluster:psql()
Due to the commitc538592 which made all Perl warnings to fatal, useof PostgreSQL::Test::Cluster:psql() and safe_psql() with timeoutstarted to fail with the following error:Use of uninitialized value $ret in bitwise and (&) at..src/test/perl/PostgreSQL/Test/Cluster.pm line 2015.Fix that by placing $ret conversion code in psql() in an if (defined$ret) block.With this change, the behavior of psql() becomes same as before, thatis, the whole function returns undef on timeout, which is usefullydifferent from returning 0.Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/06f899fd-1826-05ab-42d6-adeb1fd5e200%40eisentraut.org
1 parent0ae3b46 commit686db12

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,12 +2012,15 @@ sub psql
20122012
# We don't use IPC::Run::Simple to limit dependencies.
20132013
#
20142014
# We always die on signal.
2015-
my$core =$ret & 128 ?" (core dumped)" :"";
2016-
die"psql exited with signal"
2017-
. ($ret & 127)
2018-
."$core: '$$stderr' while running '@psql_params'"
2019-
if$ret & 127;
2020-
$ret =$ret >> 8;
2015+
if (defined$ret)
2016+
{
2017+
my$core =$ret & 128 ?" (core dumped)" :"";
2018+
die"psql exited with signal"
2019+
. ($ret & 127)
2020+
."$core: '$$stderr' while running '@psql_params'"
2021+
if$ret & 127;
2022+
$ret =$ret >> 8;
2023+
}
20212024

20222025
if ($ret &&$params{on_error_die})
20232026
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp