http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65321
Revision: 65321
Author: reedy
Date: 2010-04-20 14:22:32 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
querypage-work2: Merge r50378
Modified Paths:
--------------
branches/querypage-work2/TODO
branches/querypage-work2/phase3/includes/AutoLoader.php
branches/querypage-work2/phase3/includes/ImageQueryPage.php
branches/querypage-work2/phase3/includes/QueryPage.php
branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php
branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php
branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php
branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php
branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php
branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedimages.php
branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php
branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php
branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php
Property Changed:
----------------
branches/querypage-work2/
branches/querypage-work2/phase3/
branches/querypage-work2/phase3/includes/
branches/querypage-work2/phase3/includes/ChangesList.php
branches/querypage-work2/phase3/includes/ConfEditor.php
branches/querypage-work2/phase3/includes/OutputPage.php
branches/querypage-work2/phase3/includes/api/
branches/querypage-work2/phase3/includes/specials/
branches/querypage-work2/phase3/maintenance/cleanupTable.inc
branches/querypage-work2/phase3/skins/common/jquery.js
branches/querypage-work2/phase3/skins/common/jquery.min.js
Property changes on: branches/querypage-work2
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/querypage-work:49084,49599,49631,49951,50105
+ /branches/querypage-work:49084,49599,49631,49951,50105,50378
Modified: branches/querypage-work2/TODO
===================================================================
--- branches/querypage-work2/TODO 2010-04-20 14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/TODO 2010-04-20 14:22:32 UTC (rev 65321)
@@ -1,12 +1,10 @@
-* Test JOINs using table aliases
* Make INNER JOIN implicit in Unusedimages?
* Find and migrate code using WantedPages::getSQL hook
* Check sorting sanity
** Check whether sorts are efficient and page right
** Check whether sorting by nothing is really what we want
** Check whether selecting title or ns AS value is really what we want
+* Track down and fix pages querying page info one title at a time
* Mark ShortPages as inexpensive
* Reuse UncategorizedPages code in UncategorizedImages somehow
* Make UncategorizedPages parameterized by namespace
-
-* Convert UncategorizedImages
Property changes on: branches/querypage-work2/phase3
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3:51646
/branches/querypage-work/phase3:49084,49599,49631,49951,50105
/branches/sqlite:58211-58321
+ /branches/REL1_15/phase3:51646
/branches/querypage-work/phase3:49084,49599,49631,49951,50105,50378
/branches/sqlite:58211-58321
Property changes on: branches/querypage-work2/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
- /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
+ /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
Modified: branches/querypage-work2/phase3/includes/AutoLoader.php
===================================================================
--- branches/querypage-work2/phase3/includes/AutoLoader.php 2010-04-20
14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/phase3/includes/AutoLoader.php 2010-04-20
14:22:32 UTC (rev 65321)
@@ -576,7 +576,6 @@
'SpecialUpload' => 'includes/specials/SpecialUpload.php',
'SpecialVersion' => 'includes/specials/SpecialVersion.php',
'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php',
- 'SpecialWhatLinksHere' => 'includes/specials/SpecialWhatlinkshere.php',
'UncategorizedCategoriesPage' =>
'includes/specials/SpecialUncategorizedcategories.php',
'UncategorizedPagesPage' =>
'includes/specials/SpecialUncategorizedpages.php',
'UncategorizedTemplatesPage' =>
'includes/specials/SpecialUncategorizedtemplates.php',
@@ -593,7 +592,6 @@
'WantedFilesPage' => 'includes/specials/SpecialWantedfiles.php',
'WantedPagesPage' => 'includes/specials/SpecialWantedpages.php',
'WantedTemplatesPage' => 'includes/specials/SpecialWantedtemplates.php',
- 'WhatLinksHerePage' => 'includes/specials/SpecialWhatlinkshere.php',
'WikiImporter' => 'includes/Import.php',
'WikiRevision' => 'includes/Import.php',
'WithoutInterwikiPage' =>
'includes/specials/SpecialWithoutinterwiki.php',
Property changes on: branches/querypage-work2/phase3/includes/ChangesList.php
___________________________________________________________________
Modified: svn:mergeinfo
- /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
+ /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
___________________________________________________________________
Modified: svn:mergeinfo
-
/branches/querypage-work/phase3/includes/ConfEditor.php:49084,49599,49631,49951,50105
+
/branches/querypage-work/phase3/includes/ConfEditor.php:49084,49599,49631,49951,50105,50378
Modified: branches/querypage-work2/phase3/includes/ImageQueryPage.php
===================================================================
--- branches/querypage-work2/phase3/includes/ImageQueryPage.php 2010-04-20
14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/phase3/includes/ImageQueryPage.php 2010-04-20
14:22:32 UTC (rev 65321)
@@ -7,7 +7,7 @@
* @ingroup SpecialPage
* @author Rob Church <[email protected]>
*/
-class ImageQueryPage extends QueryPage {
+abstract class ImageQueryPage extends QueryPage {
/**
* Format and output report results using the given information plus
@@ -37,6 +37,9 @@
$out->addHTML( $gallery->toHtml() );
}
}
+
+ // Gotta override this since it's abstract
+ function formatResult( $skin, $result ) { }
/**
* Prepare an image object given a result row
Property changes on: branches/querypage-work2/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
- /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
+ /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
Modified: branches/querypage-work2/phase3/includes/QueryPage.php
===================================================================
--- branches/querypage-work2/phase3/includes/QueryPage.php 2010-04-20
14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/phase3/includes/QueryPage.php 2010-04-20
14:22:32 UTC (rev 65321)
@@ -324,7 +324,7 @@
$field .= ' DESC';
}
}
- if( !is_array( $query['options'] ) ) {
+ if( !is_array( @$query['options'] ) ) {
$options = array ();
}
if( count( $order ) ) {
@@ -338,10 +338,10 @@
}
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select( (array)$query['tables'],
- (array)$query['fields'],
- (array)$query['conds'], $fname,
- $query['options'], (array)$query['join_conds']
+ $res = $dbr->select( (array)@$query['tables'],
+ (array)@$query['fields'],
+ (array)@$query['conds'], $fname,
+ $query['options'], (array)@$query['join_conds']
);
return $dbr->resultObject( $res );
}
Property changes on: branches/querypage-work2/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
- /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
+ /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
Property changes on: branches/querypage-work2/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
- /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
+ /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
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php
===================================================================
---
branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php
2010-04-20 14:19:51 UTC (rev 65320)
+++
branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -34,7 +34,6 @@
'conds' => array( 'rd_namespace >= 0',
'p2.page_namespace IS NULL'
),
- // TODO test this join
'join_conds' => array( 'page AS p1' => array( 'LEFT
JOIN', array(
'rd_from=p1.page_id',
) ),
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php
===================================================================
---
branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php
2010-04-20 14:19:51 UTC (rev 65320)
+++
branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -39,7 +39,7 @@
// useful to remove this. People _do_ create pages
// and never revise them, they aren't necessarily
// redirects.
- 'GROUP BY' => 'page_namespace, page_title' .
+ 'GROUP BY' => 'page_namespace, page_title, ' .
'page_is_redirect' )
);
}
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php
===================================================================
--- branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php
2010-04-20 14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -38,7 +38,6 @@
'page_namespace' =>
MWNamespace::getContentNamespaces(),
'page_is_redirect' => 0,
'tl_namespace IS NULL' ),
- // TODO: test this JOIN
'join_conds' => array (
'pagelinks' => array (
'LEFT JOIN', array (
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php
===================================================================
--- branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php
2010-04-20 14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -27,7 +27,6 @@
'conds' => array ( 'page_namespace' =>
MWNamespace::getContentNamespaces() ),
'options' => array ( 'HAVING' => 'COUNT(*) > 1',
'GROUP BY' => 'page_namespace, page_title' ),
- // TODO: test this JOIN
'join_conds' => array ( 'page' => array ( 'LEFT JOIN',
'page_id = cl_from' ) )
);
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php
===================================================================
---
branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php
2010-04-20 14:19:51 UTC (rev 65320)
+++
branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -55,7 +55,7 @@
'fields' => array ( 'tl_namespace AS namespace',
'tl_title AS title',
'COUNT(*) AS value' ),
- 'conds' => array ( 'tl_namespace' => NS_TEMPLATE' ),
+ 'conds' => array ( 'tl_namespace' => NS_TEMPLATE ),
'options' => array( 'GROUP BY' => 'tl_title' )
);
}
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedimages.php
===================================================================
---
branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedimages.php
2010-04-20 14:19:51 UTC (rev 65320)
+++
branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedimages.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -39,6 +39,20 @@
FROM {$page} LEFT JOIN {$categorylinks} ON
page_id = cl_from
WHERE cl_from IS NULL AND page_namespace =
{$ns} AND page_is_redirect = 0";
}
+
+ function getQueryInfo() {
+ return array (
+ 'tables' => array( 'page', 'categorylinks' ),
+ 'fields' => array( 'page_namespace AS namespace',
+ 'page_title AS title',
+ 'page_title AS value' ),
+ 'conds' => array( 'cl_from IS NULL',
+ 'page_namespace' => NS_FILE,
+ 'page_is_redirect' => 0 ),
+ 'join_conds' => array( 'categorylinks' => array(
+ 'LEFT JOIN', 'cl_from=page_id' ) )
+ );
+ }
}
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php
===================================================================
---
branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php
2010-04-20 14:19:51 UTC (rev 65320)
+++
branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -26,7 +26,7 @@
'0 AS value' ),
'conds' => array ( 'page_namespace' => NS_TEMPLATE,
'tl_from IS NULL',
- 'page_redirect' => 0 ),
+ 'page_is_redirect' => 0 ),
'join_conds' => array ( 'templatelinks' => array (
'LEFT JOIN', array ( 'tl_title = page_title',
'tl_namespace = page_namespace' ) ) )
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php
===================================================================
--- branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php
2010-04-20 14:19:51 UTC (rev 65320)
+++ branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -61,11 +61,10 @@
NS_MEDIAWIKI . "'" ),
'options' => array ( 'HAVING' => "COUNT(*) > $count",
'GROUP BY' => 'pl_namespace, pl_title' ),
- // TODO: test this join
'join_conds' => array ( 'page AS pg1' => array (
'LEFT JOIN', array (
'pg1.page_namespace = pl_namespace',
- 'pg2.page_title = pl_title' ) ),
+ 'pg1.page_title = pl_title' ) ),
'page AS pg2' => array ( 'LEFT JOIN',
'pg2.page_id = pl_from' ) )
);
Modified:
branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php
===================================================================
---
branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php
2010-04-20 14:19:51 UTC (rev 65320)
+++
branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php
2010-04-20 14:22:32 UTC (rev 65321)
@@ -33,7 +33,8 @@
'join_conds' => array ( 'page' => array ( 'LEFT JOIN',
array ( 'page_namespace = tl_namespace',
'page_title = tl_title' ) ) )
- );
+ );
+ }
}
/**
Property changes on:
branches/querypage-work2/phase3/maintenance/cleanupTable.inc
___________________________________________________________________
Modified: svn:mergeinfo
- /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
+ /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
___________________________________________________________________
Modified: svn:mergeinfo
-
/branches/querypage-work/phase3/skins/common/jquery.js:49084,49599,49631,49951,50105
+
/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
___________________________________________________________________
Modified: svn:mergeinfo
-
/branches/querypage-work/phase3/skins/common/jquery.min.js:49084,49599,49631,49951,50105
+
/branches/querypage-work/phase3/skins/common/jquery.min.js:49084,49599,49631,49951,50105,50378
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs