MySQL 1267: Illegal mix of collations when wgUseTeX=true (math on)
When I set $wgUseTeX to true, all pages in the wiki with math on them return just the following text:
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "MathRenderer::_recall". Database returned error "1267: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (localhost)".
I am using PHP 5.3.2, MySQL 5.1.51-log and texvc works great on the tests specified on Manual:Troubleshooting_math_display_errors.
Okay, digging into this more, the wikidb math table create syntax is
mysql> show create table math; CREATE TABLE `math` (
`math_inputhash` varchar(16) NOT NULL DEFAULT , `math_outputhash` varchar(16) NOT NULL DEFAULT , `math_html_conservativeness` tinyint(1) NOT NULL DEFAULT '0', `math_html` text, `math_mathml` text, UNIQUE KEY `math_inputhash` (`math_inputhash`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
and the offending query appears to be
SELECT math_outputhash,math_html_conservativeness,math_html,math_mathml FROM `math` WHERE math_inputhash = '�j��-�4m!����9R�' LIMIT 1;
I'm guessing the math_inputhash is not encoded the way mysql/wikimedia wants it.
Do others math table have charset=latin1? Is there a column charset I can check? Any ideas? 129.2.141.139 17:49, 30 September 2010 (UTC)
this command
alter table math CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
from [1] worked
this command
alter table math CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
from [1] worked