Skip to content

Commit

Permalink
Issue #5643 - Fix return value of the \Drush\Sql\SqlPgsql::dbExists() (
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweetchuck committed Jun 9, 2023
1 parent 166af7a commit c2b51cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Sql/SqlPgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c2b51cf

Please sign in to comment.