From ba1761d967280266202e8faeecda795b3e408e15 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 20 May 2011 18:26:59 +0000 Subject: [PATCH] =?utf8?q?Patch=20for=20Bug=20#28669,=20=E2=80=9CScream=20?= =?utf8?q?bloody=20murder=20when=20user=20chooses=20MyISAM=20and=20InnoDB?= =?utf8?q?=20is=20available=E2=80=9D=20From=20William=20Demchick?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CREDITS | 1 + includes/installer/Installer.i18n.php | 9 +++++++++ includes/installer/MysqlInstaller.php | 24 ++++++++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CREDITS b/CREDITS index df73c8e07c..741308e104 100644 --- a/CREDITS +++ b/CREDITS @@ -148,6 +148,7 @@ following names for their contribution to the product. * Umherirrender * Ville Stadista * Vitaliy Filippov +* William Demchick * Yuvaraj Pandian T * Zachary Hauri diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 524e1b3afe..6aad7dcc5b 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -317,6 +317,15 @@ The account you specify here must already exist.', 'config-mysql-engine' => 'Storage engine:', 'config-mysql-innodb' => 'InnoDB', 'config-mysql-myisam' => 'MyISAM', + 'config-mysql-myisam-dep' => "'''Warning''': You have selected MyISAM. MyISAM is not recommended for use with MediaWiki, because: +* it barely supports concurrency due to table locking +* it is more prone to corruption than other engines +* the MediaWiki codebase does not always handle MyISAM as it should +* probably other reasons... + +If your MySQL installation supports InnoDB, it is highly recommended that you choose that instead. +If your MySQL installation does not support InnoDB, maybe its time for an upgrade. +", 'config-mysql-engine-help' => "'''InnoDB''' is almost always the best option, since it has good concurrency support. '''MyISAM''' may be faster in single-user or read-only installations. diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index a5a2a3e259..1555104f94 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -318,13 +318,33 @@ class MysqlInstaller extends DatabaseInstaller { if ( !in_array( $this->getVar( '_MysqlEngine' ), $engines ) ) { $this->setVar( '_MysqlEngine', reset( $engines ) ); } + + $s .= Xml::openElement( 'div', array( + 'id' => 'dbMyisamWarning' + )); + $s .= $this->parent->getWarningBox( wfMsg( 'config-mysql-myisam-dep' ) ); + $s .= Xml::closeElement( 'div' ); + + if( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) { + $s .= Xml::openElement( 'script', array( 'type' => 'text/javascript' ) ); + $s .= '$(\'#dbMyisamWarning\').hide();'; + $s .= Xml::closeElement( 'script' ); + } + if ( count( $engines ) >= 2 ) { $s .= $this->getRadioSet( array( 'var' => '_MysqlEngine', 'label' => 'config-mysql-engine', 'itemLabelPrefix' => 'config-mysql-', - 'values' => $engines - )); + 'values' => $engines, + 'itemAttribs' => array( + 'MyISAM' => array( + 'class' => 'showHideRadio', + 'rel' => 'dbMyisamWarning'), + 'InnoDB' => array( + 'class' => 'hideShowRadio', + 'rel' => 'dbMyisamWarning') + ))); $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' ); } -- 2.20.1