From 7e9892f14dffbbdb5347a8f382ab0423e7281340 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 28 Mar 2006 21:56:12 +0000 Subject: [PATCH] First set to NULL so that it changes on the master --- maintenance/refreshImageCount.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/maintenance/refreshImageCount.php b/maintenance/refreshImageCount.php index 797ceddc61..15ce2b91a0 100644 --- a/maintenance/refreshImageCount.php +++ b/maintenance/refreshImageCount.php @@ -6,9 +6,18 @@ require_once( "commandLine.inc" ); $dbw =& wfGetDB( DB_MASTER ); -$count = $dbw->selectField( 'image', 'COUNT(*)' ); -echo "$wgDBname: setting ss_images to $count\n"; +// Load the current value from the master +$count = $dbw->selectField( 'site_stats', 'ss_images' ); + +echo "$wgDBname: forcing ss_images to $count\n"; + +// First set to NULL so that it changes on the master +$dbw->update( 'site_stats', + array( 'ss_images' => null ), + array( 'ss_row_id' => 1 ) ); + +// Now this update will be forced to go out $dbw->update( 'site_stats', array( 'ss_images' => $count ), array( 'ss_row_id' => 1 ) ); -- 2.20.1