@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+1 -26
+1 -10
scripts/sql/manage_storage.php
··· 70 70 'help' => pht( 71 71 'Do not actually change anything, just show what would be changed.'), 72 72 ), 73 - array( 74 - 'name' => 'disable-utf8mb4', 75 - 'help' => pht( 76 - 'Disable %s, even if the database supports it. This is an '. 77 - 'advanced feature used for testing internal changes; you '. 78 - 'should not normally use this flag.', 79 - 'utf8mb4'), 80 - ), 81 73 )); 82 74 } catch (PhutilArgumentUsageException $ex) { 83 75 $args->printUsageException($ex); ··· 202 194 ->setHost($default_host) 203 195 ->setPort($default_port) 204 196 ->setPassword($password) 205 - ->setNamespace($args->getArg('namespace')) 206 - ->setDisableUTF8MB4($args->getArg('disable-utf8mb4')); 197 + ->setNamespace($args->getArg('namespace')); 207 198 PhabricatorEnv::overrideConfig('mysql.user', $api->getUser()); 208 199 209 200 $ref->setUser($selected_user);
-16
src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
··· 9 9 private $password; 10 10 private $namespace; 11 11 private $conns = array(); 12 - private $disableUTF8MB4; 13 12 14 13 const CHARSET_DEFAULT = 'CHARSET'; 15 14 const CHARSET_SORT = 'CHARSET_SORT'; ··· 20 19 21 20 const TABLE_STATUS = 'patch_status'; 22 21 const TABLE_HOSTSTATE = 'hoststate'; 23 - 24 - public function setDisableUTF8MB4($disable_utf8_mb4) { 25 - $this->disableUTF8MB4 = $disable_utf8_mb4; 26 - return $this; 27 - } 28 - 29 - public function getDisableUTF8MB4() { 30 - return $this->disableUTF8MB4; 31 - } 32 22 33 23 public function setNamespace($namespace) { 34 24 $this->namespace = $namespace; ··· 312 302 } 313 303 314 304 public function isCharacterSetAvailable($character_set) { 315 - if ($character_set == 'utf8mb4') { 316 - if ($this->getDisableUTF8MB4()) { 317 - return false; 318 - } 319 - } 320 - 321 305 $conn = $this->getConn(null); 322 306 return self::isCharacterSetAvailableOnConnection($character_set, $conn); 323 307 }