r72451 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72450‎ | r72451 | r72452 >
Date:17:40, 5 September 2010
Author:simetrical
Status:ok (Comments)
Tags:
Comment:
Suggest running update.php on database error

This is a pretty frequently asked question in #mediawiki -- most
database errors are probably due to not running update.php.
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -1132,7 +1132,7 @@
11331133 $this->ignoreErrors( $ignore );
11341134 }
11351135 else {
1136 - $message = "A database error has occurred\n" .
 1136+ $message = "A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: http://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
11371137 "Query: $sql\n" .
11381138 "Function: $fname\n" .
11391139 "Error: $errno $error\n";
Index: trunk/phase3/includes/db/Database.php
@@ -2741,7 +2741,7 @@
27422742 public $error, $errno, $sql, $fname;
27432743
27442744 function __construct( DatabaseBase &$db, $error, $errno, $sql, $fname ) {
2745 - $message = "A database error has occurred\n" .
 2745+ $message = "A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: http://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
27462746 "Query: $sql\n" .
27472747 "Function: $fname\n" .
27482748 "Error: $errno $error\n";
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -150,7 +150,7 @@
151151 // perform query
152152 $stmt = sqlsrv_query( $this->mConn, $sql );
153153 if ( $stmt == false ) {
154 - $message = "A database error has occurred\n" .
 154+ $message = "A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: http://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
155155 "Query: " . htmlentities( $sql ) . "\n" .
156156 "Function: " . __FUNCTION__ . "\n";
157157 // process each error (our driver will give us an array of errors unlike other providers)

Comments

#Comment by Aaron Schulz (talk | contribs)   17:53, 5 September 2010

Amazing this was never done before :)

#Comment by MaxSem (talk | contribs)   18:09, 5 September 2010

I sense dark side of the Force duplication.

#Comment by Simetrical (talk | contribs)   18:25, 5 September 2010

Yeah, I know. I couldn't be bothered fixing it as part of this commit.

Status & tagging log