Page MenuHomePhabricator

default database charset is not altered on creation
Closed, ResolvedPublic

Description

Author: j.schauer

Description:
software versions:

  • mysql5
  • mediawiki svn

steps to reproduce:

  • do a new mediawiki install, select root as database user and choose a database charset of your choice (utf8, binary...)
  • complete the installation
  • look up the database default charset and observe that this is not what you specified earlier (utf8, binary...) but something like latin1_swedish_ci

the tables are created correctly though so this is only a minor bug but imho easy to fix by doing something like:

alter database wikidb default CHARACTER SET utf8 COLLATE utf8_general_ci;

after database creation (using the charset chosen earlier instead of utf8 of course) or by specifying the charset on database creation


Version: 1.22.0
Severity: trivial

Details

Reference
bz14931

Event Timeline

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz14931.
bzimport created this task.Jul 26 2008, 7:59 AM

overlordq wrote:

More of a pedantic bug afaik since the 'order of operations' is column>table>database>server charset/collation.

connection collation goes in there somewhere too.

  • Bug 11859 has been marked as a duplicate of this bug. ***

This is still true as of 1.21-something in git. It affects eg the searchindex table, which does not have a character set specified at creation time, see maintenance/tables.sql for that. Someone reloading a table via LOAD DATA INFILE will get bitten by this too, as that will check the database default iirc.

karun.84 wrote:

I am going to start looking at what is causing this, and I plan to write a patch.

karun.84 wrote:

I have submitted a patch for this bug. I am proposing to change the default character set to UTF8, as the sindex table cannot be in binary format, and all other tables will be set to binary when created, if the binary format is chosen in the installer.

(In reply to comment #5)

I have submitted a patch for this bug. I am proposing to change the default
character set to UTF8, as the sindex table cannot be in binary format, and
all
other tables will be set to binary when created, if the binary format is
chosen
in the installer.

Patch is https://gerrit.wikimedia.org/r/#/c/67422/

(In reply to comment #6)

Patch is https://gerrit.wikimedia.org/r/#/c/67422/

Karun: Thanks for the patch! See http://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines for how to get automatic notification in the corresponding bug report.

Change 67422 merged by jenkins-bot:
MysqlInstaller: use default character set of utf8

https://gerrit.wikimedia.org/r/67422

Patch got merged on 2013-09-24, hence closing as FIXED.
Karun: Thanks again for contributing this patch!