r33516 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33515‎ | r33516 | r33517 >
Date:19:56, 17 April 2008
Author:ialex
Status:old
Tags:
Comment:
This is a bit weired but... Don't throw a MySQL error if revision table is empty
Modified paths:
  • /trunk/phase3/maintenance/populateParentId.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/populateParentId.php
@@ -22,6 +22,14 @@
2323 echo "Populating rev_parent_id column\n";
2424 $start = $db->selectField( 'revision', 'MIN(rev_id)', false, __FUNCTION__ );
2525 $end = $db->selectField( 'revision', 'MAX(rev_id)', false, __FUNCTION__ );
 26+ if( is_null( $start ) || is_null( $end ) ){
 27+ echo "...revision table seems to be empty.\n";
 28+ $db->insert( 'updatelog',
 29+ array( 'ul_key' => 'populate rev_parent_id' ),
 30+ __FUNCTION__,
 31+ 'IGNORE' );
 32+ return;
 33+ }
2634 # Do remaining chunk
2735 $end += BATCH_SIZE - 1;
2836 $blockStart = $start;

Status & tagging log