diff --git a/core/Db/Adapter/Mysqli.php b/core/Db/Adapter/Mysqli.php index 4c8c7fed813..f8fe9a0d3c7 100644 --- a/core/Db/Adapter/Mysqli.php +++ b/core/Db/Adapter/Mysqli.php @@ -98,6 +98,24 @@ public function checkServerVersion() } } + /** + * Returns the MySQL server version + * + * @return null|string + */ + public function getServerVersion() + { + // prioritizing SELECT @@VERSION in case the connection version string is incorrect (which can + // occur on Azure) + $versionInfo = $this->fetchAll('SELECT @@VERSION'); + + if (count($versionInfo)) { + return $versionInfo[0]['@@VERSION']; + } + + return parent::getServerVersion(); + } + /** * Check client version compatibility against database server * diff --git a/core/Db/Adapter/Pdo/Mysql.php b/core/Db/Adapter/Pdo/Mysql.php index b9b250081f9..b45d718c5a5 100644 --- a/core/Db/Adapter/Pdo/Mysql.php +++ b/core/Db/Adapter/Pdo/Mysql.php @@ -134,6 +134,24 @@ public function checkServerVersion() } } + /** + * Returns the MySQL server version + * + * @return null|string + */ + public function getServerVersion() + { + // prioritizing SELECT @@VERSION in case the connection version string is incorrect (which can + // occur on Azure) + $versionInfo = $this->fetchAll('SELECT @@VERSION'); + + if (count($versionInfo)) { + return $versionInfo[0]['@@VERSION']; + } + + return parent::getServerVersion(); + } + /** * Check client version compatibility against database server *