From 1d82660ace32e43897f02af1efbf2ecb9f530dd0 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 17 Apr 2008 19:56:31 +0000 Subject: [PATCH] This is a bit weired but... Don't throw a MySQL error if revision table is empty --- maintenance/populateParentId.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/maintenance/populateParentId.php b/maintenance/populateParentId.php index 4b73070eed..366c457c2b 100644 --- a/maintenance/populateParentId.php +++ b/maintenance/populateParentId.php @@ -22,6 +22,14 @@ function populate_rev_parent_id( $db ) { echo "Populating rev_parent_id column\n"; $start = $db->selectField( 'revision', 'MIN(rev_id)', false, __FUNCTION__ ); $end = $db->selectField( 'revision', 'MAX(rev_id)', false, __FUNCTION__ ); + if( is_null( $start ) || is_null( $end ) ){ + echo "...revision table seems to be empty.\n"; + $db->insert( 'updatelog', + array( 'ul_key' => 'populate rev_parent_id' ), + __FUNCTION__, + 'IGNORE' ); + return; + } # Do remaining chunk $end += BATCH_SIZE - 1; $blockStart = $start; -- 2.20.1