Skip to content

Commit 917da08

Browse files
author
epriestley
committed
Fix various MySQL version issues with new charset stuff
Summary: Ref T1191. Notable stuff: - Adds `--disable-utf8mb4` to `bin/storage` to make it easier to test what things will (approximately) do on old MySQL. This isn't 100% perfect but should catch all the major stuff. It basically makes us pretend the server is an old server. - Require utf8mb4 to dump a quickstart. - Fix some issues with quickstart generation, notably special casing the FULLTEXT handling. - Add an `--unsafe` flag to `bin/storage adjust` to let it truncate data to fix schemata. - Fix some old patches which don't work if the default table charset is utf8mb4. Test Plan: - Dumped a quickstart. - Loaded the quickstart with utf8mb4. - Loaded the quickstart with `--disable-utf8mb4` (verified that we get binary columns, etc). - Adjusted schema with `--disable-utf8mb4` (got a long adjustment with binary columns, some truncation stuff with weird edge case test data). - Adjusted schema with `--disable-utf8mb4 --unsafe` (got truncations and clean adjust). - Adjusted schema back without `--disable-utf8mb4` (got a long adjustment with utf8mb4 columns, some invalid data on truncated utf8). - Adjusted schema without `--disable-utf8mb4`, but with `--unsafe` (got truncations on the invalid data). Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1191 Differential Revision: https://secure.phabricator.com/D10757
1 parent bf66c90 commit 917da08

17 files changed

+153
-59
lines changed

resources/celerity/map.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -855,10 +855,6 @@
855855
'javelin-workflow',
856856
'phabricator-draggable-list',
857857
),
858-
'7319e029' => array(
859-
'javelin-behavior',
860-
'javelin-dom',
861-
),
862858
'06e05112' => array(
863859
'javelin-behavior',
864860
'javelin-stratcom',
@@ -1276,6 +1272,10 @@
12761272
'phabricator-phtize',
12771273
'changeset-view-manager',
12781274
),
1275+
'7319e029' => array(
1276+
'javelin-behavior',
1277+
'javelin-dom',
1278+
),
12791279
'76b9fc3e' => array(
12801280
'javelin-behavior',
12811281
'javelin-stratcom',
@@ -1336,28 +1336,6 @@
13361336
'javelin-behavior-device',
13371337
'phabricator-title',
13381338
),
1339-
42126667 => array(
1340-
'javelin-behavior',
1341-
'javelin-dom',
1342-
'javelin-request',
1343-
),
1344-
48086888 => array(
1345-
'javelin-behavior',
1346-
'javelin-dom',
1347-
'javelin-workflow',
1348-
),
1349-
60479091 => array(
1350-
'phabricator-busy',
1351-
'javelin-behavior',
1352-
),
1353-
82439934 => array(
1354-
'javelin-behavior',
1355-
'javelin-dom',
1356-
'javelin-util',
1357-
'javelin-stratcom',
1358-
'javelin-workflow',
1359-
'phabricator-draggable-list',
1360-
),
13611339
'7e41274a' => array(
13621340
'javelin-install',
13631341
),
@@ -1962,6 +1940,28 @@
19621940
'phabricator-prefab',
19631941
'javelin-json',
19641942
),
1943+
42126667 => array(
1944+
'javelin-behavior',
1945+
'javelin-dom',
1946+
'javelin-request',
1947+
),
1948+
48086888 => array(
1949+
'javelin-behavior',
1950+
'javelin-dom',
1951+
'javelin-workflow',
1952+
),
1953+
60479091 => array(
1954+
'phabricator-busy',
1955+
'javelin-behavior',
1956+
),
1957+
82439934 => array(
1958+
'javelin-behavior',
1959+
'javelin-dom',
1960+
'javelin-util',
1961+
'javelin-stratcom',
1962+
'javelin-workflow',
1963+
'phabricator-draggable-list',
1964+
),
19651965
),
19661966
'packages' => array(
19671967
'core.pkg.css' => array(

resources/sql/patches/000.project.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
create table {$NAMESPACE}_project.project (
22
id int unsigned not null auto_increment primary key,
3-
name varchar(255) not null,
3+
name varchar(255) COLLATE `binary` not null,
44
unique key (name),
55
phid varchar(64) binary not null,
66
authorPHID varchar(64) binary not null,

resources/sql/patches/002.oauth.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
create table {$NAMESPACE}_user.user_oauthinfo (
22
id int unsigned not null auto_increment primary key,
33
userID int unsigned not null,
4-
oauthProvider varchar(255) not null,
5-
oauthUID varchar(255) not null,
4+
oauthProvider varchar(255) COLLATE `binary` not null,
5+
oauthUID varchar(255) COLLATE `binary` not null,
66
unique key (userID, oauthProvider),
77
unique key (oauthProvider, oauthUID),
88
dateCreated int unsigned not null,

resources/sql/patches/004.daemonrepos.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ create table {$NAMESPACE}_timeline.timeline_eventdata (
2323
);
2424

2525
create table {$NAMESPACE}_timeline.timeline_cursor (
26-
name varchar(255) not null primary key,
26+
name varchar(255) COLLATE `binary` not null primary key,
2727
position int unsigned not null
2828
);

resources/sql/patches/010.herald.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CREATE TABLE {$NAMESPACE}_herald.herald_action (
77

88
CREATE TABLE {$NAMESPACE}_herald.herald_rule (
99
id int unsigned not null auto_increment primary key,
10-
name varchar(255) not null,
10+
name varchar(255) COLLATE `binary` not null,
1111
authorPHID varchar(64) binary not null,
1212
contentType varchar(255) not null,
1313
mustMatchAll bool not null,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
CREATE TABLE {$NAMESPACE}_repository.repository_badcommit (
2-
fullCommitName varchar(255) binary not null primary key,
2+
fullCommitName varchar(255) COLLATE `binary` not null primary key,
33
description longblob not null
44
);

resources/sql/patches/018.owners.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE {$NAMESPACE}_owners.owners_package (
22
id int unsigned not null auto_increment primary key,
33
phid varchar(64) binary not null,
44
unique key(phid),
5-
name varchar(255) not null,
5+
name varchar(255) COLLATE `binary` not null,
66
unique key(name),
77
description text not null,
88
primaryOwnerPHID varchar(64) binary

resources/sql/patches/019.arcprojects.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE {$NAMESPACE}_repository.repository_arcanistproject (
22
id int unsigned not null auto_increment primary key,
33
phid varchar(64) binary not null,
44
unique key(phid),
5-
name varchar(255) not null,
5+
name varchar(255) COLLATE `binary` not null,
66
unique key (name),
77
repositoryID int unsigned
88
);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE TABLE {$NAMESPACE}_file.file_proxyimage (
22
id int unsigned not null primary key auto_increment,
3-
uri varchar(255) binary not null,
3+
uri varchar(255) COLLATE `binary` not null,
44
unique key(uri),
55
filePHID varchar(64) binary not null
66
) ENGINE=InnoDB;

resources/sql/patches/040.transform.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CREATE TABLE {$NAMESPACE}_file.file_transformedfile (
22
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
3-
originalPHID varchar(64) BINARY NOT NULL,
4-
transform varchar(255) BINARY NOT NULL,
3+
originalPHID varchar(64) COLLATE `binary` NOT NULL,
4+
transform varchar(255) COLLATE `binary` NOT NULL,
55
unique key (originalPHID, transform),
66
transformedPHID varchar(64) BINARY NOT NULL,
77
key (transformedPHID),

0 commit comments

Comments
 (0)