From 22c0cd94a0e137e8da3b6f8534c70e907b36b9de Mon Sep 17 00:00:00 2001 From: Anthon Pang Date: Sun, 11 Feb 2018 21:48:14 -0500 Subject: [PATCH] Fixes #12002 and #12030 - azure fallback to "select @@version" --- core/Db/Adapter/Mysqli.php | 16 ++++++++++++++++ core/Db/Adapter/Pdo/Mysql.php | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) 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 *