From 1ca3de4d04789fd9b52c3d947cb8b54e4192e3a4 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 13 Nov 2016 17:06:08 +0100 Subject: [PATCH] Added work-around for detection of older MySQL versions during setup --- .../install/files/lib/system/WCFSetup.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 188a7a2cc7..f78181c059 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -7,6 +7,7 @@ use wcf\data\package\Package; use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\cache\builder\LanguageCacheBuilder; +use wcf\system\database\exception\DatabaseException; use wcf\system\database\util\SQLParser; use wcf\system\database\MySQLDatabase; use wcf\system\exception\SystemException; @@ -649,8 +650,16 @@ class WCFSetup extends WCF { try { // check connection data /** @var \wcf\system\database\Database $db */ - $db = new MySQLDatabase($dbHost, $dbUser, $dbPassword, $dbName, $dbPort, true); - $db->connect(); + try { + $db = new MySQLDatabase($dbHost, $dbUser, $dbPassword, $dbName, $dbPort, true); + } + catch (DatabaseException $e) { + if ($e->getPrevious()->getCode() == 1115) { // work-around for older MySQL versions that don't know utf8mb4 + throw new SystemException("Insufficient MySQL version. Version '5.5.35' or greater is needed."); + } + + throw $e; + } // check sql version $sqlVersion = $db->getVersion(); -- 2.20.1