Page MenuHomePhabricator

Correct column mutations for old versions of MySQL
ClosedPublic

Authored by epriestley on Oct 2 2014, 5:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 25, 6:36 PM
Unknown Object (File)
Mon, Mar 25, 6:36 PM
Unknown Object (File)
Mon, Mar 25, 6:36 PM
Unknown Object (File)
Sat, Mar 16, 4:35 AM
Unknown Object (File)
Fri, Mar 15, 2:53 PM
Unknown Object (File)
Feb 16 2024, 8:13 PM
Unknown Object (File)
Feb 16 2024, 5:04 PM
Unknown Object (File)
Feb 9 2024, 2:21 AM
Subscribers

Details

Summary

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:

  • ALTER TABLE ... MODIFY columnName VARBINARY(64)

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

Repository
rP Phabricator
Branch
bincol
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2725
Build 2729: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

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.

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 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.

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