From c2b51cf5c0b537cc989513ccaa05e3e229104d4f Mon Sep 17 00:00:00 2001 From: Andor Date: Fri, 9 Jun 2023 15:08:27 +0200 Subject: [PATCH] Issue #5643 - Fix return value of the \Drush\Sql\SqlPgsql::dbExists() (#5646) --- src/Sql/SqlPgsql.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sql/SqlPgsql.php b/src/Sql/SqlPgsql.php index b4014b46fb..9c98c01d0a 100644 --- a/src/Sql/SqlPgsql.php +++ b/src/Sql/SqlPgsql.php @@ -112,9 +112,9 @@ public function dbExists(): bool $process = Drush::shell($sql_no_db->connect() . ' -t -c ' . escapeshellarg($query), null, $this->getEnv()); $process->setSimulated(false); $process->run(); - $out = $process->getOutput(); - // If there is output the DB exists. - return (bool)$out; + + return $process->isSuccessful() + && trim($process->getOutput()) === '1'; } public function queryFormat($query)