Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15436127
D20742.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20742.diff
View Options
diff --git a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
--- a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
+++ b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
@@ -298,6 +298,14 @@
return self::isCharacterSetAvailableOnConnection($character_set, $conn);
}
+ public function getClientCharset() {
+ if ($this->isCharacterSetAvailable('utf8mb4')) {
+ return 'utf8mb4';
+ } else {
+ return 'utf8';
+ }
+ }
+
public static function isCharacterSetAvailableOnConnection(
$character_set,
AphrontDatabaseConnection $conn) {
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
@@ -179,7 +179,9 @@
$argv = array();
$argv[] = '--hex-blob';
$argv[] = '--single-transaction';
- $argv[] = '--default-character-set=utf8';
+
+ $argv[] = '--default-character-set';
+ $argv[] = $api->getClientCharset();
if ($args->getArg('for-replica')) {
$argv[] = '--master-data';
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
@@ -31,8 +31,8 @@
}
return phutil_passthru(
- 'mysql --protocol=TCP --default-character-set=utf8mb4 '.
- '-u %s %C -h %s %C',
+ 'mysql --protocol=TCP --default-character-set %R -u %s %C -h %s %C',
+ $api->getClientCharset(),
$api->getUser(),
$flag_password,
$host,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 12:06 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385163
Default Alt Text
D20742.diff (2 KB)
Attached To
Mode
D20742: When "utf8mb4" is available, use it as the default client charset when invoking standalone "mysql" commands
Attached
Detach File
Event Timeline
Log In to Comment