Page MenuHomePhabricator

problems with illegal mix of collations latin1 and utf8
Closed, InvalidPublic

Description

Author: cvb-mediawiki

Description:
After upgrade from 1.5.8 to 1.6.3 I was got this result when running refreshLinks.php:

A database error has occurred
Query: SELECT page_namespace,page_title,page_id FROM mw_page,`mw_templatelink
s` WHERE (tl_from=page_id) AND tl_namespace = '0' AND tl_title = 'Заглавная_страница'
Function: Title::getLinksTo
Error: 1267 Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8_general_ci

,COERCIBLE) for operation '=' (localhost)

Problem was resolved with changing tl_title type from

CREATE TABLE /*$wgDBprefix*/templatelinks (

tl_from int(8) unsigned NOT NULL default '0',

-- Key to page_namespace/page_title of the target page.
-- The target page may or may not exist, and due to renames
-- and deletions may refer to different page records as time
-- goes by.
tl_namespace int NOT NULL default '0',
tl_title varchar(255) binary NOT NULL default '',

UNIQUE KEY tl_from(tl_from,tl_namespace,tl_title),
KEY (tl_namespace,tl_title)

) TYPE=InnoDB;

to

CREATE TABLE mw_templatelinks (

`tl_from` int(8) unsigned NOT NULL default '0',
`tl_namespace` int(11) NOT NULL default '0',
`tl_title` varchar(255) character set utf8 collate utf8_bin NOT NULL default '',
UNIQUE KEY `tl_from` (`tl_from`,`tl_namespace`,`tl_title`),
KEY `tl_namespace` (`tl_namespace`,`tl_title`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


Version: 1.6.x
Severity: major
OS: FreeBSD
Platform: PC

Details

Reference
bz5620

Event Timeline

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

Currently we don't have updater scripts for the alternate schemas
(mysql5, oracle, postgresql). That probably should get fixed;
otherwise the updaters don't work too well.

cvb-mediawiki wrote:

I'm using MySQL version 4.1.18

cvb-mediawiki wrote:

this problem with mw_job.job_title and after changing sorting type latin1 to utf8
problem was resolved.

Closing since Konstantin said his problem was resolved.