Commit 5aec5359 authored by Max Romanovsky's avatar Max Romanovsky

Fixed: MySQL Driver didn't return Database name if DBAL was initialized using existing PDO instance

parent f62b4a5d
......@@ -93,6 +93,10 @@ class Driver implements \Doctrine\DBAL\Driver
public function getDatabase(\Doctrine\DBAL\Connection $conn)
{
$params = $conn->getParams();
if (isset($params['dbname'])) {
return $params['dbname'];
}
return $conn->query('SELECT DATABASE()')->fetchColumn();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment