Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5f942a9

Browse filesBrowse files
bug #52715 [Cache] fix detecting the database server version (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Cache] fix detecting the database server version | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | #52685 (comment) | License | MIT Commits ------- 33a65ca fix detecting the database server version
2 parents 12845ab + 33a65ca commit 5f942a9
Copy full SHA for 5f942a9

File tree

1 file changed

+3
-6
lines changed
Filter options

1 file changed

+3
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,17 +421,14 @@ private function getServerVersion(): string
421421
return $this->serverVersion;
422422
}
423423

424-
if ($this->conn instanceof ServerVersionProvider) {
425-
return $this->conn->getServerVersion();
424+
if ($this->conn instanceof ServerVersionProvider || $this->conn instanceof ServerInfoAwareConnection) {
425+
return $this->serverVersion = $this->conn->getServerVersion();
426426
}
427427

428428
// The condition should be removed once support for DBAL <3.3 is dropped
429429
$conn = method_exists($this->conn, 'getNativeConnection') ? $this->conn->getNativeConnection() : $this->conn->getWrappedConnection();
430-
if ($conn instanceof ServerInfoAwareConnection) {
431-
return $this->serverVersion = $conn->getServerVersion();
432-
}
433430

434-
return $this->serverVersion = '0';
431+
return $this->serverVersion = $conn->getAttribute(\PDO::ATTR_SERVER_VERSION);
435432
}
436433

437434
private function addTableToSchema(Schema $schema): void

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.