aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/refreshImageCount.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@users.mediawiki.org>2006-03-28 21:56:12 +0000
committerBrion Vibber <brion@users.mediawiki.org>2006-03-28 21:56:12 +0000
commit7e9892f14dffbbdb5347a8f382ab0423e7281340 (patch)
treef41a227585e22feeafbcb7b527368f9c041b750a /maintenance/refreshImageCount.php
parent4c587ab3c4f991dea37558a5b507e28bd176c31a (diff)
downloadmediawikicore-7e9892f14dffbbdb5347a8f382ab0423e7281340.tar.gz
mediawikicore-7e9892f14dffbbdb5347a8f382ab0423e7281340.zip
First set to NULL so that it changes on the master
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/13387
Diffstat (limited to 'maintenance/refreshImageCount.php')
-rw-r--r--maintenance/refreshImageCount.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/maintenance/refreshImageCount.php b/maintenance/refreshImageCount.php
index 797ceddc61f4..15ce2b91a0c6 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 ) );