From: Alexander Ebert Date: Mon, 6 Jan 2020 17:48:40 +0000 (+0100) Subject: Reject MySQL 8 < 8.0.14 due to a serious bug X-Git-Tag: 5.2.1~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cade115be23f8908deef0f06f61b8beb8f42600e;p=GitHub%2FWoltLab%2FWCF.git Reject MySQL 8 < 8.0.14 due to a serious bug See #3133 --- diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_preUpdate.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_preUpdate.php index 6c3a29fbeb..5e99bf7730 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_preUpdate.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_preUpdate.php @@ -28,3 +28,22 @@ if (version_compare($comparePhpVersion, $requiredPHPVersion) === -1) { throw new SystemException("The update requires PHP in version {$requiredPHPVersion} or newer."); } } + +// check sql version +$sqlVersion = WCF::getDB()->getVersion(); +$compareSQLVersion = preg_replace('/^(\d+\.\d+\.\d+).*$/', '\\1', $sqlVersion); +if (stripos($sqlVersion, 'MariaDB') === false) { + // For MySQL 8.0, MySQL 8.0.14+ is required + // https://bugs.mysql.com/bug.php?id=88718 + if ($compareSQLVersion[0] === '8') { + // MySQL 8.0.14+ + if (!(version_compare($compareSQLVersion, '8.0.14') >= 0)) { + if (WCF::getLanguage()->getFixedLanguageCode() == 'de') { + throw new SystemException("Ihre eingesetzte Version von MySQL 8 enthält einen bekannten Fehler und verhindert eine Aktualisierung, es wird mindestens MySQL 8.0.14 oder höher benötigt."); + } + else { + throw new SystemException("The version of MySQL 8 that you are using contains a known bug that prevents an upgrade, MySQL 8.0.14 or newer is required."); + } + } + } +} diff --git a/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php b/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php index b9d7ae37dd..1b1b5a465d 100644 --- a/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php @@ -51,7 +51,12 @@ class SystemCheckPage extends AbstractPage { ]; public $mysqlVersions = [ - 'mysql' => '5.5.35', + 'mysql' => [ + // MySQL 8.0 < 8.0.14 contains a nasty bug + // https://bugs.mysql.com/bug.php?id=88718 + '5' => '5.5.35', + '8' => '8.0.14', + ], 'mariadb' => [ // MariaDB 5.5.47+ or 10.0.22+ are required // https://jira.mariadb.org/browse/MDEV-8756 diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index f7fde95bef..55c5490178 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -722,9 +722,17 @@ class WCFSetup extends WCF { } } else { - // MySQL 5.5.35+ - if (!(version_compare($compareSQLVersion, '5.5.35') >= 0)) { - throw new SystemException("Insufficient MySQL version '".$compareSQLVersion."'. Version '5.5.35' or greater is needed."); + // MySQL 5.5.35+ or MySQL 8.0.14+ are required + // https://bugs.mysql.com/bug.php?id=88718 + if ($compareSQLVersion[0] === '8') { + // MySQL 8.0.14+ + if (!(version_compare($compareSQLVersion, '8.0.14') >= 0)) { + throw new SystemException("Insufficient MySQL version '".$compareSQLVersion."'. Version '5.5.35' or greater, or version '8.0.14' or greater is needed."); + } + } + else if (!(version_compare($compareSQLVersion, '5.5.35') >= 0)) { + // MySQL 5.5.35+ + throw new SystemException("Insufficient MySQL version '".$compareSQLVersion."'. Version '5.5.35' or greater, or version '8.0.14' or greater is needed."); } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index e7ff58430d..bc371ab181 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2733,7 +2733,7 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen - + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index c9c935f619..8b6cc3c1ab 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2661,7 +2661,7 @@ If you have already bought the licenses for the listed apps, th - + diff --git a/wcfsetup/test.php b/wcfsetup/test.php index 7714702e6b..53b75450bb 100644 --- a/wcfsetup/test.php +++ b/wcfsetup/test.php @@ -260,8 +260,8 @@ $phrases = [ 'en' => 'MySQL Requirements' ], 'mysql_version' => [ - 'de' => 'Bitte stellen Sie sicher, dass MySQL 5.5.35+ oder MariaDB 10.0.22+ mit InnoDB-Unterstützung vorhanden ist.', - 'en' => 'Please make sure that MySQL 5.5.35+ or MariaDB 10.0.22+, with InnoDB support is available.' + 'de' => 'Bitte stellen Sie sicher, dass MySQL 5.5.35+/MySQL 8.0.14+ oder MariaDB 10.0.22+ mit InnoDB-Unterstützung vorhanden ist.', + 'en' => 'Please make sure that MySQL 5.5.35+/MySQL 8.0.14+ or MariaDB 10.0.22+, with InnoDB support is available.' ], 'result' => [ 'de' => 'Ergebnis',