Skip to content

Commit 5da1bc7

Browse files
committed
fix detecting the server version with Doctrine DBAL 4
1 parent 48be4b3 commit 5da1bc7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Doctrine\DBAL\ParameterType;
2222
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
2323
use Doctrine\DBAL\Schema\Schema;
24+
use Doctrine\DBAL\ServerVersionProvider;
2425
use Doctrine\DBAL\Tools\DsnParser;
2526
use Symfony\Component\Cache\Exception\InvalidArgumentException;
2627
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
@@ -420,6 +421,10 @@ private function getServerVersion(): string
420421
return $this->serverVersion;
421422
}
422423

424+
if ($this->conn instanceof ServerVersionProvider) {
425+
return $this->conn->getServerVersion();
426+
}
427+
423428
// The condition should be removed once support for DBAL <3.3 is dropped
424429
$conn = method_exists($this->conn, 'getNativeConnection') ? $this->conn->getNativeConnection() : $this->conn->getWrappedConnection();
425430
if ($conn instanceof ServerInfoAwareConnection) {

0 commit comments

Comments
 (0)