From 2ab7c9ec3b894d3b96d274b550e88941599f2d41 Mon Sep 17 00:00:00 2001 From: Karun Dambiec Date: Fri, 7 Jun 2013 15:53:12 +0200 Subject: [PATCH] MysqlInstaller: use default character set of utf8 Bug: 14931 Change-Id: Ied512a75d17b401206b6439f289fe36c01536cec --- RELEASE-NOTES-1.22 | 2 ++ includes/installer/MysqlInstaller.php | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 44b1d365dc..4fb948a8ee 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -312,6 +312,8 @@ production. * (bug 26811) On DB error pages, server hostnames are now hidden when both $wgShowHostnames and $wgShowSQLErrors are false. * (bug 6200) line breaks in
are handled like they are in
+* (bug 14931) Default character set now set to 'utf8' when a new MySQL + database is created. === API changes in 1.22 === * (bug 25553) The JSON output formatter now leaves forward slashes unescaped diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index e0bf3d7ee7..c0b52432a6 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -89,8 +89,10 @@ class MysqlInstaller extends DatabaseInstaller { return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) . - $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-name-help' ) ) . - $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-prefix-help' ) ) . + $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ), + $this->parent->getHelpBox( 'config-db-name-help' ) ) . + $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array( 'dir' => 'ltr' ), + $this->parent->getHelpBox( 'config-db-prefix-help' ) ) . Html::closeElement( 'fieldset' ) . $this->getInstallUserBox(); } @@ -475,7 +477,7 @@ class MysqlInstaller extends DatabaseInstaller { $conn = $status->value; $dbName = $this->getVar( 'wgDBname' ); if ( !$conn->selectDB( $dbName ) ) { - $conn->query( "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ), __METHOD__ ); + $conn->query( "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ) . "CHARACTER SET utf8", __METHOD__ ); $conn->selectDB( $dbName ); } $this->setupSchemaVars(); -- 2.20.1