r87424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87423‎ | r87424 | r87425 >
Date:18:21, 4 May 2011
Author:awjrichards
Status:resolved
Tags:
Comment:
Moved create index for ts on article feedback to it's own file; Added apporpriate code to execute new sql file on update.php in hooks file; fixed missing '=' when comparing for cache validity
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/sql/AddArticleFeedbackTimestampIndex.sql (added) (history)
  • /trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -205,7 +205,7 @@
206206 // check if we've got results in the cache
207207 $key = wfMemcKey( 'article_feedback_stats_highs_lows' );
208208 $cache = $wgMemc->get( $key );
209 - if ( $cache != false && $cache = -1 ) {
 209+ if ( $cache != false && $cache == -1 ) {
210210 $result = $cache;
211211 } else {
212212 $dbr = wfGetDB( DB_SLAVE );
Index: trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql
@@ -35,7 +35,6 @@
3636 PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token)
3737 ) /*$wgDBTableOptions*/;
3838 CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback (aa_user_id, aa_page_id, aa_revision);
39 -CREATE INDEX /*i*/aa_timestamp ON /*_*/article_feedback (aa_timestamp);
4039
4140 -- Aggregate rating table for a page
4241 CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages (
Index: trunk/extensions/ArticleFeedback/sql/AddArticleFeedbackTimestampIndex.sql
@@ -0,0 +1,2 @@
 2+-- Create an index on the article_feedback.aa_timestamp field
 3+CREATE INDEX /*i*/article_feedback_timestamp ON /*_*/article_feedback (aa_timestamp);
\ No newline at end of file
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -178,6 +178,13 @@
179179 $dir . '/sql/AddStatsHighsLowsTable.sql',
180180 true
181181 ) );
 182+ $updater->addExtensionUpdate( array(
 183+ 'addIndex',
 184+ 'article_feedback',
 185+ 'article_feedback_timestamp',
 186+ $dir . '/sql/AddArticleFeedbackTimestampIndex.sql',
 187+ true
 188+ ) );
182189 }
183190 return true;
184191 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r87430Checking if cache object is instance of ResultsWrapper, per suggestion from T...awjrichards18:40, 4 May 2011

Status & tagging log