Page MenuHomePhabricator

If "utf8mb4" is unavailable on the client, fall back to "binary"
ClosedPublic

Authored by epriestley on Jul 12 2016, 3:03 PM.
Tags
None
Referenced Files
F13084750: D16279.diff
Wed, Apr 24, 11:21 PM
Unknown Object (File)
Fri, Apr 19, 5:03 PM
Unknown Object (File)
Fri, Apr 12, 2:47 AM
Unknown Object (File)
Thu, Apr 11, 7:52 AM
Unknown Object (File)
Mon, Apr 1, 9:01 PM
Unknown Object (File)
Mon, Apr 1, 1:46 PM
Unknown Object (File)
Mon, Apr 1, 2:03 AM
Unknown Object (File)
Sat, Mar 30, 10:20 AM
Subscribers
None

Details

Summary

Fixes T11291. It appears the issue there is:

  • Server which supports utf8mb4.
  • Client which does not.
  • The client fails to select utf8mb4 and falls back to utf8, which does not support 4-byte characters.
  • Inserting 4-byte characters fails.

The fix here is to fall back to binary instead of utf8. From T11291#185523, this appears to fix the issue in an environment where it previously reproduced.

This also appears fine locally (modern client + modern server), if I force a fallback from utf8mb4.

This should be free from weird side-effects (we verify UTF8 when building queries anyway; we use binary columns on older MySQL).

We could also just fail here, but that would probably force a large set of users running old MySQL to upgrade.

Test Plan
  • See discussion in T11291.
  • Locally, forcing this fallback causes no obvious problems.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to If "utf8mb4" is unavailable on the client, fall back to "binary".
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Jul 12 2016, 4:04 PM
This revision was automatically updated to reflect the committed changes.