diff --git a/src/Doctrine/Connection/Decorator.php b/src/Doctrine/Connection/Decorator.php index a8c249ad..8bb8cff0 100644 --- a/src/Doctrine/Connection/Decorator.php +++ b/src/Doctrine/Connection/Decorator.php @@ -22,10 +22,12 @@ public function getDoctrineConnection(): Connection { if (!$this->_exists(Connection::class)) { if ($this->_hasPDO()) { - $connection = DriverManager::getConnection(['pdo' => $this->_getPDO()]); + $serverVersion = $this->_getPDO()->getAttribute(\PDO::ATTR_SERVER_VERSION); + $connection = DriverManager::getConnection(['pdo' => $this->_getPDO(), 'serverVersion' => $serverVersion]); } else { $pdoBuilder = $this->_getPDOBuilderFactory()->create(); - $connection = DriverManager::getConnection(['pdo' => $pdoBuilder->getPdo()]); + $serverVersion = $pdoBuilder->getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION); + $connection = DriverManager::getConnection(['pdo' => $pdoBuilder->getPdo(), 'serverVersion' => $serverVersion]); } // $connection->getConfiguration()->setSQLLogger(new EchoSQLLogger()); @@ -69,4 +71,4 @@ public function getId(): string { return $this->_read(self::PROP_ID); } -} \ No newline at end of file +}