r65321 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65320‎ | r65321 | r65322 >
Date:14:22, 20 April 2010
Author:reedy
Status:deferred
Tags:
Comment:
querypage-work2: Merge r50378
Modified paths:
  • /branches/querypage-work2 (modified) (history)
  • /branches/querypage-work2/TODO (modified) (history)
  • /branches/querypage-work2/phase3 (modified) (history)
  • /branches/querypage-work2/phase3/includes (modified) (history)
  • /branches/querypage-work2/phase3/includes/AutoLoader.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/ChangesList.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/ConfEditor.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/ImageQueryPage.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/OutputPage.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/QueryPage.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/api (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedimages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php (modified) (history)
  • /branches/querypage-work2/phase3/maintenance/cleanupTable.inc (modified) (history)
  • /branches/querypage-work2/phase3/skins/common/jquery.js (modified) (history)
  • /branches/querypage-work2/phase3/skins/common/jquery.min.js (modified) (history)

Diff [purge]

Property changes on: branches/querypage-work2/phase3/maintenance/cleanupTable.inc
___________________________________________________________________
Name: svn:mergeinfo
11 - /branches/REL1_15/phase3/maintenance/cleanupTable.inc:51646
/branches/querypage-work/phase3/maintenance/cleanupTable.inc:49084,49599,49631,49951,50105
/branches/wmf-deployment/maintenance/cleanupTable.inc:56715
22 + /branches/REL1_15/phase3/maintenance/cleanupTable.inc:51646
/branches/querypage-work/phase3/maintenance/cleanupTable.inc:49084,49599,49631,49951,50105,50378
/branches/wmf-deployment/maintenance/cleanupTable.inc:56715
Property changes on: branches/querypage-work2/phase3/skins/common/jquery.js
___________________________________________________________________
Name: svn:mergeinfo
33 - /branches/querypage-work/phase3/skins/common/jquery.js:49084,49599,49631,49951,50105
44 + /branches/querypage-work/phase3/skins/common/jquery.js:49084,49599,49631,49951,50105,50378
Property changes on: branches/querypage-work2/phase3/skins/common/jquery.min.js
___________________________________________________________________
Name: svn:mergeinfo
55 - /branches/querypage-work/phase3/skins/common/jquery.min.js:49084,49599,49631,49951,50105
66 + /branches/querypage-work/phase3/skins/common/jquery.min.js:49084,49599,49631,49951,50105,50378
Index: branches/querypage-work2/phase3/includes/ImageQueryPage.php
@@ -7,7 +7,7 @@
88 * @ingroup SpecialPage
99 * @author Rob Church <robchur@gmail.com>
1010 */
11 -class ImageQueryPage extends QueryPage {
 11+abstract class ImageQueryPage extends QueryPage {
1212
1313 /**
1414 * Format and output report results using the given information plus
@@ -37,6 +37,9 @@
3838 $out->addHTML( $gallery->toHtml() );
3939 }
4040 }
 41+
 42+ // Gotta override this since it's abstract
 43+ function formatResult( $skin, $result ) { }
4144
4245 /**
4346 * Prepare an image object given a result row
Property changes on: branches/querypage-work2/phase3/includes/OutputPage.php
___________________________________________________________________
Name: svn:mergeinfo
4447 - /branches/REL1_15/phase3/includes/OutputPage.php:51646
/branches/querypage-work/phase3/includes/OutputPage.php:49084,49599,49631,49951,50105
/branches/wmf-deployment/includes/OutputPage.php:53381,57468
4548 + /branches/REL1_15/phase3/includes/OutputPage.php:51646
/branches/querypage-work/phase3/includes/OutputPage.php:49084,49599,49631,49951,50105,50378
/branches/wmf-deployment/includes/OutputPage.php:53381,57468
Property changes on: branches/querypage-work2/phase3/includes/api
___________________________________________________________________
Name: svn:mergeinfo
4649 - /branches/REL1_15/phase3/includes/api:51646
/branches/REL1_16/phase3/includes/api:63621-63636
/branches/querypage-work/phase3/includes/api:49084,49599,49631,49951,50105
/branches/sqlite/includes/api:58211-58321
/branches/wmf-deployment/includes/api:53381,59952
4750 + /branches/REL1_15/phase3/includes/api:51646
/branches/REL1_16/phase3/includes/api:63621-63636
/branches/querypage-work/phase3/includes/api:49084,49599,49631,49951,50105,50378
/branches/sqlite/includes/api:58211-58321
/branches/wmf-deployment/includes/api:53381,59952
Index: branches/querypage-work2/phase3/includes/AutoLoader.php
@@ -576,7 +576,6 @@
577577 'SpecialUpload' => 'includes/specials/SpecialUpload.php',
578578 'SpecialVersion' => 'includes/specials/SpecialVersion.php',
579579 'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php',
580 - 'SpecialWhatLinksHere' => 'includes/specials/SpecialWhatlinkshere.php',
581580 'UncategorizedCategoriesPage' => 'includes/specials/SpecialUncategorizedcategories.php',
582581 'UncategorizedPagesPage' => 'includes/specials/SpecialUncategorizedpages.php',
583582 'UncategorizedTemplatesPage' => 'includes/specials/SpecialUncategorizedtemplates.php',
@@ -593,7 +592,6 @@
594593 'WantedFilesPage' => 'includes/specials/SpecialWantedfiles.php',
595594 'WantedPagesPage' => 'includes/specials/SpecialWantedpages.php',
596595 'WantedTemplatesPage' => 'includes/specials/SpecialWantedtemplates.php',
597 - 'WhatLinksHerePage' => 'includes/specials/SpecialWhatlinkshere.php',
598596 'WikiImporter' => 'includes/Import.php',
599597 'WikiRevision' => 'includes/Import.php',
600598 'WithoutInterwikiPage' => 'includes/specials/SpecialWithoutinterwiki.php',
Property changes on: branches/querypage-work2/phase3/includes/ChangesList.php
___________________________________________________________________
Name: svn:mergeinfo
601599 - /branches/REL1_15/phase3/includes/ChangesList.php:51646
/branches/querypage-work/phase3/includes/ChangesList.php:49084,49599,49631,49951,50105
/branches/wmf-deployment/includes/ChangesList.php:53381,57589
602600 + /branches/REL1_15/phase3/includes/ChangesList.php:51646
/branches/querypage-work/phase3/includes/ChangesList.php:49084,49599,49631,49951,50105,50378
/branches/wmf-deployment/includes/ChangesList.php:53381,57589
Property changes on: branches/querypage-work2/phase3/includes/ConfEditor.php
___________________________________________________________________
Name: svn:mergeinfo
603601 - /branches/querypage-work/phase3/includes/ConfEditor.php:49084,49599,49631,49951,50105
604602 + /branches/querypage-work/phase3/includes/ConfEditor.php:49084,49599,49631,49951,50105,50378
Index: branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php
@@ -39,7 +39,7 @@
4040 // useful to remove this. People _do_ create pages
4141 // and never revise them, they aren't necessarily
4242 // redirects.
43 - 'GROUP BY' => 'page_namespace, page_title' .
 43+ 'GROUP BY' => 'page_namespace, page_title, ' .
4444 'page_is_redirect' )
4545 );
4646 }
Index: branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php
@@ -33,7 +33,8 @@
3434 'join_conds' => array ( 'page' => array ( 'LEFT JOIN',
3535 array ( 'page_namespace = tl_namespace',
3636 'page_title = tl_title' ) ) )
37 - );
 37+ );
 38+ }
3839 }
3940
4041 /**
Index: branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -34,7 +34,6 @@
3535 'conds' => array( 'rd_namespace >= 0',
3636 'p2.page_namespace IS NULL'
3737 ),
38 - // TODO test this join
3938 'join_conds' => array( 'page AS p1' => array( 'LEFT JOIN', array(
4039 'rd_from=p1.page_id',
4140 ) ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php
@@ -27,7 +27,6 @@
2828 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ),
2929 'options' => array ( 'HAVING' => 'COUNT(*) > 1',
3030 'GROUP BY' => 'page_namespace, page_title' ),
31 - // TODO: test this JOIN
3231 'join_conds' => array ( 'page' => array ( 'LEFT JOIN',
3332 'page_id = cl_from' ) )
3433 );
Index: branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php
@@ -38,7 +38,6 @@
3939 'page_namespace' => MWNamespace::getContentNamespaces(),
4040 'page_is_redirect' => 0,
4141 'tl_namespace IS NULL' ),
42 - // TODO: test this JOIN
4342 'join_conds' => array (
4443 'pagelinks' => array (
4544 'LEFT JOIN', array (
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php
@@ -55,7 +55,7 @@
5656 'fields' => array ( 'tl_namespace AS namespace',
5757 'tl_title AS title',
5858 'COUNT(*) AS value' ),
59 - 'conds' => array ( 'tl_namespace' => NS_TEMPLATE' ),
 59+ 'conds' => array ( 'tl_namespace' => NS_TEMPLATE ),
6060 'options' => array( 'GROUP BY' => 'tl_title' )
6161 );
6262 }
Index: branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php
@@ -26,7 +26,7 @@
2727 '0 AS value' ),
2828 'conds' => array ( 'page_namespace' => NS_TEMPLATE,
2929 'tl_from IS NULL',
30 - 'page_redirect' => 0 ),
 30+ 'page_is_redirect' => 0 ),
3131 'join_conds' => array ( 'templatelinks' => array (
3232 'LEFT JOIN', array ( 'tl_title = page_title',
3333 'tl_namespace = page_namespace' ) ) )
Index: branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedimages.php
@@ -39,6 +39,20 @@
4040 FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from
4141 WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0";
4242 }
 43+
 44+ function getQueryInfo() {
 45+ return array (
 46+ 'tables' => array( 'page', 'categorylinks' ),
 47+ 'fields' => array( 'page_namespace AS namespace',
 48+ 'page_title AS title',
 49+ 'page_title AS value' ),
 50+ 'conds' => array( 'cl_from IS NULL',
 51+ 'page_namespace' => NS_FILE,
 52+ 'page_is_redirect' => 0 ),
 53+ 'join_conds' => array( 'categorylinks' => array(
 54+ 'LEFT JOIN', 'cl_from=page_id' ) )
 55+ );
 56+ }
4357
4458 }
4559
Index: branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php
@@ -61,11 +61,10 @@
6262 NS_MEDIAWIKI . "'" ),
6363 'options' => array ( 'HAVING' => "COUNT(*) > $count",
6464 'GROUP BY' => 'pl_namespace, pl_title' ),
65 - // TODO: test this join
6665 'join_conds' => array ( 'page AS pg1' => array (
6766 'LEFT JOIN', array (
6867 'pg1.page_namespace = pl_namespace',
69 - 'pg2.page_title = pl_title' ) ),
 68+ 'pg1.page_title = pl_title' ) ),
7069 'page AS pg2' => array ( 'LEFT JOIN',
7170 'pg2.page_id = pl_from' ) )
7271 );
Property changes on: branches/querypage-work2/phase3/includes/specials
___________________________________________________________________
Name: svn:mergeinfo
7372 - /branches/REL1_15/phase3/includes/specials:51646
/branches/querypage-work/phase3/includes/specials:49084,49599,49631,49951,50105
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967
7473 + /branches/REL1_15/phase3/includes/specials:51646
/branches/querypage-work/phase3/includes/specials:49084,49599,49631,49951,50105,50378
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967
Index: branches/querypage-work2/phase3/includes/QueryPage.php
@@ -324,7 +324,7 @@
325325 $field .= ' DESC';
326326 }
327327 }
328 - if( !is_array( $query['options'] ) ) {
 328+ if( !is_array( @$query['options'] ) ) {
329329 $options = array ();
330330 }
331331 if( count( $order ) ) {
@@ -338,10 +338,10 @@
339339 }
340340
341341 $dbr = wfGetDB( DB_SLAVE );
342 - $res = $dbr->select( (array)$query['tables'],
343 - (array)$query['fields'],
344 - (array)$query['conds'], $fname,
345 - $query['options'], (array)$query['join_conds']
 342+ $res = $dbr->select( (array)@$query['tables'],
 343+ (array)@$query['fields'],
 344+ (array)@$query['conds'], $fname,
 345+ $query['options'], (array)@$query['join_conds']
346346 );
347347 return $dbr->resultObject( $res );
348348 }
Property changes on: branches/querypage-work2/phase3/includes
___________________________________________________________________
Name: svn:mergeinfo
349349 - /branches/REL1_15/phase3/includes:51646
/branches/querypage-work/phase3/includes:49084,49599,49631,49951,50105
/branches/sqlite/includes:58211-58321
/branches/wmf-deployment/includes:53381
350350 + /branches/REL1_15/phase3/includes:51646
/branches/querypage-work/phase3/includes:49084,49599,49631,49951,50105,50378
/branches/sqlite/includes:58211-58321
/branches/wmf-deployment/includes:53381
Property changes on: branches/querypage-work2/phase3
___________________________________________________________________
Name: svn:mergeinfo
351351 - /branches/REL1_15/phase3:51646
/branches/querypage-work/phase3:49084,49599,49631,49951,50105
/branches/sqlite:58211-58321
352352 + /branches/REL1_15/phase3:51646
/branches/querypage-work/phase3:49084,49599,49631,49951,50105,50378
/branches/sqlite:58211-58321
Index: branches/querypage-work2/TODO
@@ -1,12 +1,10 @@
2 -* Test JOINs using table aliases
32 * Make INNER JOIN implicit in Unusedimages?
43 * Find and migrate code using WantedPages::getSQL hook
54 * Check sorting sanity
65 ** Check whether sorts are efficient and page right
76 ** Check whether sorting by nothing is really what we want
87 ** Check whether selecting title or ns AS value is really what we want
 8+* Track down and fix pages querying page info one title at a time
99 * Mark ShortPages as inexpensive
1010 * Reuse UncategorizedPages code in UncategorizedImages somehow
1111 * Make UncategorizedPages parameterized by namespace
12 -
13 -* Convert UncategorizedImages
Property changes on: branches/querypage-work2
___________________________________________________________________
Name: svn:mergeinfo
1412 - /branches/querypage-work:49084,49599,49631,49951,50105
1513 + /branches/querypage-work:49084,49599,49631,49951,50105,50378

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50378querypage-work: Various fixes; mostly working now, but needs some more improv...catrope18:54, 9 May 2009

Status & tagging log