Page MenuHomePhabricator

Correct column mutations for old versions of MySQL

Authored by epriestley on Oct 2 2014, 5:44 PM.



Ref T1191. Although I fixed some of the mutations earlier (in D10598), I missed the column mutations under old versions of MySQL. In particular, this isn't valid:

  • ALTER TABLE ... MODIFY columnName VARCHAR(64) COLLATE binary

Issue the permitted version of this instead, which is:


Also fixed an issue where a clean schema had the wrong nullability for a column in the draft table. Force it to the expected nullability.

The other trick here is around the one column with a FULLTEXT index on it, which needs a little massaging.

Test Plan
  • Forced my local install to return false for utf8mb4 support.
  • Did a clean adjust into binary columns.
  • Poked around, added emoji to things.
  • Reverted the fake check and did a clean adjust into utf8mb4 columns.
  • Emoji survived.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley updated this revision to Diff 25514.Oct 2 2014, 5:44 PM
epriestley retitled this revision from to Correct column mutations for old versions of MySQL.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
fabe added a subscriber: fabe.Oct 2 2014, 9:26 PM

Applying this and running storage/adjust vs. mysql 5.1 worked nicely
Afterwards "Database issues/status" is all green. Running adjust again tells me it found no issues and the db columns seem to be correct (just manually checked a few).
The emoji commit however still generates the 'mysql will silently truncate' error in validateUTF8String

Did you apply the manual patch to libphutil (last line of T6228#77980)?

btrahan accepted this revision.Oct 2 2014, 9:40 PM
btrahan edited edge metadata.
This revision is now accepted and ready to land.Oct 2 2014, 9:40 PM
This revision was automatically updated to reflect the committed changes.
fabe added a comment.Oct 2 2014, 9:46 PM

ah sorry. i forgot about that.
applied it -> reimported -> all good :D