Page MenuHomePhabricator

D11928.id28734.diff
No OneTemporary

D11928.id28734.diff

diff --git a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php
--- a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php
+++ b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php
@@ -235,36 +235,58 @@
$type = $matches[1];
$size = idx($matches, 2);
- if ($is_binary) {
- if ($size) {
- $column_type = 'varbinary('.$size.')';
- } else {
- $column_type = 'longblob';
- }
-
- // MySQL (at least, under MyISAM) refuses to create a FULLTEXT index
- // on a LONGBLOB column. We'd also lose case insensitivity in search.
- // Force this column to utf8 collation. This will truncate results with
- // 4-byte UTF characters in their text, but work reasonably in the
- // majority of cases.
-
- if ($type == 'fulltext') {
- $column_type = 'longtext';
- $charset = 'utf8';
- $collation = 'utf8_general_ci';
- }
- } else {
- if ($size) {
- $column_type = 'varchar('.$size.')';
- } else {
+ switch ($type) {
+ case 'text':
+ if ($is_binary) {
+ if ($size) {
+ $column_type = 'varbinary('.$size.')';
+ } else {
+ $column_type = 'longblob';
+ }
+ } else {
+ if ($size) {
+ $column_type = 'varchar('.$size.')';
+ } else {
+ $column_type = 'longtext';
+ }
+ }
+ break;
+ case 'sort':
+ if ($size) {
+ $column_type = 'varchar('.$size.')';
+ } else {
+ $column_type = 'longtext';
+ }
+ break;
+ case 'fulltext';
+ // MySQL (at least, under MyISAM) refuses to create a FULLTEXT index
+ // on a LONGBLOB column. We'd also lose case insensitivity in search.
+ // Force this column to utf8 collation. This will truncate results
+ // with 4-byte UTF characters in their text, but work reasonably in
+ // the majority of cases.
$column_type = 'longtext';
- }
- $charset = $this->getUTF8Charset();
- if ($type == 'sort' || $type == 'fulltext') {
+ break;
+ }
+
+ switch ($type) {
+ case 'text':
+ if ($is_binary) {
+ // We leave collation and character set unspecified in order to
+ // generate valid SQL.
+ } else {
+ $charset = $this->getUTF8Charset();
+ $collation = $this->getUTF8BinaryCollation();
+ }
+ break;
+ case 'sort':
+ case 'fulltext':
+ if ($is_binary) {
+ $charset = 'utf8';
+ } else {
+ $charset = $this->getUTF8Charset();
+ }
$collation = $this->getUTF8SortingCollation();
- } else {
- $collation = $this->getUTF8BinaryCollation();
- }
+ break;
}
} else {
switch ($data_type) {

File Metadata

Mime Type
text/plain
Expires
Mar 17 2025, 8:44 AM (5 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7650805
Default Alt Text
D11928.id28734.diff (3 KB)

Event Timeline