From 48ac6306dfeb6739dda063e24a028e03f387205f Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sun, 1 Mar 2026 17:28:56 +0100 Subject: [PATCH] Remove "disable-utf8mb4" option from /bin/storage Summary: The utf8mb4 character set was added to MySQL in version 5.5.3 in 03/2010 per https://web.archive.org/web/20191114070848/https://dev.mysql.com/doc/relnotes/mysql/5.5/en/news-5-5-3.html It's unclear since when MariaDB exactly supports it, but https://mariadb.com/docs/release-notes/community-server/changelogs/changelogs-mariadb-55-series/mariadb-5560-changelog for MariaDB 5.5.60 from 04/2018 mentions it. For completeness: Some web sources state that MariaDB 10.2.5 was the first version in which utf8mb4 tables can have indexes with type VARCHAR(255). In any case, Phorge requires MySQL 8.0 and MariaDB 10.5.1 since rP555fb3a8 / rP24666e18, see https://we.phorge.it/book/phorge/article/installation_guide/ Thus there is no sense in still supporting this storage option nowadays. (For some overall historical context, see https://adamhooper.medium.com/in-mysql-never-use-utf8-use-utf8mb4-11761243e434 ) Refs T16400 Test Plan: * Run `./bin/storage help`, see no more "--disable-utf8mb4" under "OPTION REFERENCE" * Grep the source code Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16400 Differential Revision: https://we.phorge.it/D26811 --- scripts/sql/manage_storage.php | 11 +---------- .../PhabricatorStorageManagementAPI.php | 16 ---------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/scripts/sql/manage_storage.php b/scripts/sql/manage_storage.php index c4fea2efa1..f2e22ec36c 100755 --- a/scripts/sql/manage_storage.php +++ b/scripts/sql/manage_storage.php @@ -70,14 +70,6 @@ try { 'help' => pht( 'Do not actually change anything, just show what would be changed.'), ), - array( - 'name' => 'disable-utf8mb4', - 'help' => pht( - 'Disable %s, even if the database supports it. This is an '. - 'advanced feature used for testing internal changes; you '. - 'should not normally use this flag.', - 'utf8mb4'), - ), )); } catch (PhutilArgumentUsageException $ex) { $args->printUsageException($ex); @@ -202,8 +194,7 @@ foreach ($refs as $ref) { ->setHost($default_host) ->setPort($default_port) ->setPassword($password) - ->setNamespace($args->getArg('namespace')) - ->setDisableUTF8MB4($args->getArg('disable-utf8mb4')); + ->setNamespace($args->getArg('namespace')); PhabricatorEnv::overrideConfig('mysql.user', $api->getUser()); $ref->setUser($selected_user); diff --git a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php index 31de0aaced..2a5a95dde6 100644 --- a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php +++ b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php @@ -9,7 +9,6 @@ final class PhabricatorStorageManagementAPI extends Phobject { private $password; private $namespace; private $conns = array(); - private $disableUTF8MB4; const CHARSET_DEFAULT = 'CHARSET'; const CHARSET_SORT = 'CHARSET_SORT'; @@ -21,15 +20,6 @@ final class PhabricatorStorageManagementAPI extends Phobject { const TABLE_STATUS = 'patch_status'; const TABLE_HOSTSTATE = 'hoststate'; - public function setDisableUTF8MB4($disable_utf8_mb4) { - $this->disableUTF8MB4 = $disable_utf8_mb4; - return $this; - } - - public function getDisableUTF8MB4() { - return $this->disableUTF8MB4; - } - public function setNamespace($namespace) { $this->namespace = $namespace; PhabricatorLiskDAO::pushStorageNamespace($namespace); @@ -312,12 +302,6 @@ final class PhabricatorStorageManagementAPI extends Phobject { } public function isCharacterSetAvailable($character_set) { - if ($character_set == 'utf8mb4') { - if ($this->getDisableUTF8MB4()) { - return false; - } - } - $conn = $this->getConn(null); return self::isCharacterSetAvailableOnConnection($character_set, $conn); } -- 2.51.2