Last modified: 2009-07-31 21:06:22 UTC
On a Wiki where SMW was recently installed (production site, not finished, but URL available on request) the following error popped up when browsing Special:WantedPages&limit=250&offset=500 for links to non-existing articles: --- 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 "SMW::getSMWPageID". MySQL returned error "1267: Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (localhost)". --- This disrupts using normal, non-SMW functionality of MediaWiki, so please propose a fix for this situation. Thanks, Karsten
P.S.: MediaWiki 1.14.0 PHP 5.2.4-2ubuntu5.6 (apache2handler) MySQL 5.0.51a-3ubuntu5.4 Semantic MediaWiki (Version 1.4.2) Semantic Forms (Version 1.6)
I've fixed this now by running the following SQL query on the wikidb: ALTER TABLE `smw_atts2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_conc2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_conccache` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_ids` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_inst2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_redi2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_rels2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_spec2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_subs2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `smw_text2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; Two more tables named `hitcounter`and `searchindex` had the same wrong collation, I don't know if they're related to SMW.
(In reply to comment #2) > I've fixed this now by running the following SQL query on the wikidb: > > ALTER TABLE `smw_atts2` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; > ... > I have a similar problem installing SMW/Semantic Forms on MediaWiki 1.11.1 I get 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 "SMW::getUnusedPropertySubjects". MySQL returned error "1267: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_bin,IMPLICIT) for operation '=' (<hostname>)". I am not a MySQL DBA all. How should I change the SQL above, if at all? I don't know from the message which table is using latin1_swedish_ci and which is using latin1_bin. i.e. do I need to change the SMW tables to use latin1_swedish_ci instead of utf8/utf8_general_ci ? If so, what ALTER TABLE statement options? i.e. ALTER TABLE `smw_atts2` CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;
*** This bug has been marked as a duplicate of bug 11812 ***