http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90645

Revision: 90645
Author:   bawolff
Date:     2011-06-23 04:57:14 +0000 (Thu, 23 Jun 2011)
Log Message:
-----------
Someone on irc had a very screwed up DB, and he reported that the updater gave 
a fatal error
when trying to update (appearently did not have a recentchanges table, and one 
of the db
functions returned false, which the updater did not expect). Add check for that 
since I figure
an exception is much better than a fatal error.

The relavent error this potentially stops is:
Fatal error: Call to a member function isMultipleKey() on a non-object in 
/../includes/installer/MysqlUpdater.php on line 249"

Not sure if the updater should do something better than an exception, but it 
seems like
a much better situation than the fatal.

In practise, I think it is rare that this situation would arise.

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES-1.19
    trunk/phase3/includes/installer/MysqlUpdater.php

Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19     2011-06-23 03:19:10 UTC (rev 90644)
+++ trunk/phase3/RELEASE-NOTES-1.19     2011-06-23 04:57:14 UTC (rev 90645)
@@ -113,6 +113,8 @@
 * (bug 29492) Long-running steps in the installer (such as Upgrade and Install)
   can sometimes timeout
 * (bug 29507) Change 'image link' to 'file link' in Special:Whatlinkshere
+* If the db is really screwed up, and doesn't have a recentchanges table,
+  make the updater throw an exception instead of a fatal.
 
 === API changes in 1.19 ===
 * BREAKING CHANGE: action=watch now requires POST and token.

Modified: trunk/phase3/includes/installer/MysqlUpdater.php
===================================================================
--- trunk/phase3/includes/installer/MysqlUpdater.php    2011-06-23 03:19:10 UTC 
(rev 90644)
+++ trunk/phase3/includes/installer/MysqlUpdater.php    2011-06-23 04:57:14 UTC 
(rev 90645)
@@ -254,6 +254,9 @@
         */
        protected function doIndexUpdate() {
                $meta = $this->db->fieldInfo( 'recentchanges', 'rc_timestamp' );
+               if ( $meta === false ) {
+                       throw new MWException( 'Missing rc_timestamp field of 
recentchanges table. Should not happen.' );
+               }
                if ( $meta->isMultipleKey() ) {
                        $this->output( "...indexes seem up to 20031107 
standards\n" );
                        return;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to