HomePhabricator

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

Description

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

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.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11291

Differential Revision: https://secure.phabricator.com/D16279

Details

Provenance
epriestleyAuthored on Jul 12 2016, 2:58 PM
epriestleyPushed on Jul 12 2016, 11:29 PM
Reviewer
chad
Differential Revision
D16279: If "utf8mb4" is unavailable on the client, fall back to "binary"
Parents
rPHU2d457275bea6: Add a method to copy files, preserving attributes
Branches
Unknown
Tags
Unknown
Tasks
T11291: Error while executing task (phd daemon)
Build Status
Buildable 13041
Build 16667: Run Core Tests