Page MenuHomePhabricator

MySQL 5 binary schema broken
Closed, ResolvedPublic


CHAR fields with a table default charset of "binary" are silently converted to the BINARY field type, which automatically pads data with null characters on the right. This occurs in a number of places in the MW 1.10 binary schema. These null characters are exposed to MediaWiki causing various bugs. The solution (discussed with Domas on MediaWiki-General) is to use VARCHAR instead of CHAR in all the relevant places, which will be silently converted to VARBINARY. VARBINARY has a length byte and is thus capable of binary-safe storage of variable-length fields.

Version: 1.10.x
Severity: major



Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 9:50 PM
bzimport set Reference to bz10039.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

Fixed by Tim in r23239, r23246 and r23247; backported to 1.10 branch in r23651 and r23652.