From 84b161445b87a15d186ec3b0c05dfb5720694477 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 3 Oct 2008 21:16:35 +0000 Subject: [PATCH] Don't die with an SQL syntax error when there are no pages in the wiki. MySQL returned error "1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND 99 AND page_restrictions !='' AND page_restrictions !='edit (10.0.0.101)" --- maintenance/updateRestrictions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index c2d256e3c5..fd4c2712ba 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -25,6 +25,11 @@ function migrate_page_restrictions( $db ) { $start = $db->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ ); $end = $db->selectField( 'page', 'MAX(page_id)', false, __FUNCTION__ ); + + if( !$start ) { + die("Nothing to do.\n"); + } + # Do remaining chunk $end += BATCH_SIZE - 1; $blockStart = $start; -- 2.20.1