Page MenuHomePhabricator

D20742.diff
No OneTemporary

D20742.diff

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

Mime Type
text/plain
Expires
Thu, Apr 3, 8:13 AM (2 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385163
Default Alt Text
D20742.diff (2 KB)

Event Timeline