diff --git a/core/Db/Adapter/Mysqli.php b/core/Db/Adapter/Mysqli.php index 396ab603430..9f928217d98 100644 --- a/core/Db/Adapter/Mysqli.php +++ b/core/Db/Adapter/Mysqli.php @@ -76,6 +76,22 @@ public function checkServerVersion() } } + /** + * Returns the MySQL server version + * + * @return null|string + */ + public function getServerVersion() + { + $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 360e6a57e8e..17ad16c76a2 100644 --- a/core/Db/Adapter/Pdo/Mysql.php +++ b/core/Db/Adapter/Pdo/Mysql.php @@ -112,6 +112,22 @@ public function checkServerVersion() } } + /** + * Returns the MySQL server version + * + * @return null|string + */ + public function getServerVersion() + { + $versionInfo = $this->fetchAll('SELECT @@VERSION'); + + if (count($versionInfo)) { + return $versionInfo[0]['@@VERSION']; + } + + return parent::getServerVersion(); + } + /** * Check client version compatibility against database server *