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
Unknown Object (File)
Fri, Jan 3, 2:43 PM
Unknown Object (File)
Tue, Dec 31, 10:04 PM
Unknown Object (File)
Dec 13 2024, 7:20 PM
Unknown Object (File)
Dec 9 2024, 4:47 AM
Unknown Object (File)
Nov 27 2024, 6:23 AM
Unknown Object (File)
Nov 26 2024, 11:53 PM
Unknown Object (File)
Nov 21 2024, 10:02 PM
Unknown Object (File)
Nov 18 2024, 1:13 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.