Page MenuHomePhabricator

math markup results in MySQL error "1267: Illegal mix of collations"
Closed, ResolvedPublic

Description

Author: ross

Description:
If I try to preview/save a page containing math markup such as "<math>\alpha^2+\beta^2=1</math>", then I get the following error:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SELECT math_outputhash,math_html_conservativeness,math_html,math_mathml FROM math WHERE math_inputhash = '�S\x1c�@��uo�&\x10Z�f�' LIMIT 1
from within function "MathRenderer::_recall". MySQL returned error "1267: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_unicode_ci,COERCIBLE) for operation '=' (sql)".

Some people suggested setting $wgDBmysql5 to false which did not work. MySQL lists the math table as having a latin1_swedish_ci collation; all text/varchar columns on that table also have a latin1_swedish_ci collation.

FYI, my MySQL version is 5.0.26

Any help would be appreciated.

Thanks,
Ross


Version: 1.15.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz21964

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz21964.
bzimport added a subscriber: Unknown Object (MLST).

alejrb wrote:

Try setting the collation to utf8?

ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_swedish_ci;

ross wrote:

That seemed to work - thank you!