Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15395658
D11928.id28734.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11928.id28734.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11928: Fix an issue with collation construction on "sort" columns for old MySQL
Attached
Detach File
Event Timeline
Log In to Comment