Skip to content

Commit b3f22f8

Browse files
committed
bug symfony#52686 [Cache] fix detecting the server version with Doctrine DBAL 4 (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Cache] fix detecting the server version with Doctrine DBAL 4 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 5da1bc7 fix detecting the server version with Doctrine DBAL 4
2 parents 48be4b3 + 5da1bc7 commit b3f22f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
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)