r65320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65319‎ | r65320 | r65321 >
Date:14:19, 20 April 2010
Author:reedy
Status:deferred
Tags:
Comment:
querypage-work2: Merge r50105
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/ChangesList.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/ConfEditor.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/SpecialAncientpages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialDeadendpages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialDisambiguations.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialDoubleRedirects.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialListredirects.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/SpecialMostimages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialMostlinked.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedcategories.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialShortpages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedpages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUnusedcategories.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUnusedimages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialUnwatchedpages.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialWantedcategories.php (modified) (history)
  • /branches/querypage-work2/phase3/includes/specials/SpecialWantedfiles.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/includes/specials/SpecialWithoutinterwiki.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
___________________________________________________________________
Modified: svn:mergeinfo
11 Merged /branches/querypage-work/phase3/maintenance/cleanupTable.inc:r50105
Property changes on: branches/querypage-work2/phase3/skins/common/jquery.js
___________________________________________________________________
Modified: svn:mergeinfo
22 Merged /branches/querypage-work/phase3/skins/common/jquery.js:r50105
Property changes on: branches/querypage-work2/phase3/skins/common/jquery.min.js
___________________________________________________________________
Modified: svn:mergeinfo
33 Merged /branches/querypage-work/phase3/skins/common/jquery.min.js:r50105
Property changes on: branches/querypage-work2/phase3/includes/ChangesList.php
___________________________________________________________________
Modified: svn:mergeinfo
44 Merged /branches/querypage-work/phase3/includes/ChangesList.php:r50105
Property changes on: branches/querypage-work2/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
55 Merged /branches/querypage-work/phase3/includes/api:r50105
Property changes on: branches/querypage-work2/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
66 Merged /branches/querypage-work/phase3/includes/OutputPage.php:r50105
Index: branches/querypage-work2/phase3/includes/QueryPage.php
@@ -114,8 +114,8 @@
115115 * options => options
116116 * join_conds => JOIN conditions
117117 *
118 - * Note that the query itself should return the following four columns:
119 - * 'type' (your special page's name), 'namespace', 'title', and 'value'
 118+ * Note that the query itself should return the following three columns:
 119+ * 'namespace', 'title', and 'value'
120120 * *in that order*. 'value' is used for sorting.
121121 *
122122 * These may be stored in the querycache table for expensive queries,
@@ -279,7 +279,7 @@
280280 $value = 0;
281281 }
282282
283 - $vals[] = array('qc_type' => $row->type,
 283+ $vals[] = array('qc_type' => $this->getName(),
284284 'qc_namespace' => $row->namespace,
285285 'qc_title' => $row->title,
286286 'qc_value' => $value);
@@ -400,7 +400,7 @@
401401 if( !$this->listoutput ) {
402402
403403 # Fetch the timestamp of this update
404 - $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $type ), $fname );
 404+ $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $sname ), $fname );
405405 $tRow = $dbr->fetchObject( $tRes );
406406
407407 if( $tRow ) {
Index: branches/querypage-work2/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -28,8 +28,7 @@
2929 'tables' => array ( 'redirect AS ra', 'redirect AS rb',
3030 'page AS pa', 'page AS pb',
3131 'page AS pc' ),
32 - 'fields' => array ( '"{$this->getName()}" AS type',
33 - 'pa.page_namespace AS namespace',
 32+ 'fields' => array ( 'pa.page_namespace AS namespace',
3433 'pa.page_title AS title',
3534 'pb.page_namespace AS nsb',
3635 'pb.page_title AS tb',
Index: branches/querypage-work2/phase3/includes/specials/SpecialWantedcategories.php
@@ -22,8 +22,7 @@
2323 function getQueryInfo() {
2424 return array (
2525 'tables' => array ( 'categorylinks', 'page' ),
26 - 'fields' => array ( "'{$this->getName()}' AS type",
27 - "'" . NS_CATEGORY . "' AS namespace",
 26+ 'fields' => array ( "'" . NS_CATEGORY . "' AS namespace",
2827 'cl_to AS title',
2928 'COUNT(*) AS value' ),
3029 'conds' => array ( 'page_title IS NULL' ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostcategories.php
@@ -21,8 +21,7 @@
2222 function getQueryInfo() {
2323 return array (
2424 'tables' => array ( 'categorylinks', 'page' ),
25 - 'fields' => array ( "'{$this->getName()}' AS name",
26 - 'page_namespace AS namespace',
 25+ 'fields' => array ( 'page_namespace AS namespace',
2726 'page_title AS title',
2827 'COUNT(*) AS value' ),
2928 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialWithoutinterwiki.php
@@ -53,8 +53,7 @@
5454 function getQueryInfo() {
5555 $query = array (
5656 'tables' => array ( 'page', 'langlinks' ),
57 - 'fields' => array ( "'{$this->getName()}' AS type",
58 - 'page_namespace AS namespace',
 57+ 'fields' => array ( 'page_namespace AS namespace',
5958 'page_title AS title',
6059 'page_title AS value' ),
6160 'conds' => array ( 'll_title IS NULL' ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialUnusedimages.php
@@ -25,8 +25,7 @@
2626 global $wgCountCategorizedImagesAsUsed;
2727 $retval = array (
2828 'tables' => array ( 'image', 'imagelinks' ),
29 - 'fields' => array ( "'{$this->getName()}' AS type",
30 - "'" . NS_FILE . "' AS namespace",
 29+ 'fields' => array ( "'" . NS_FILE . "' AS namespace",
3130 'img_name AS title',
3231 'img_timestamp AS value',
3332 'img_user', 'img_user_text',
Index: branches/querypage-work2/phase3/includes/specials/SpecialFewestrevisions.php
@@ -27,8 +27,7 @@
2828 function getQueryInfo() {
2929 return array (
3030 'tables' => array ( 'revision', 'page' ),
31 - 'fields' => array ( "'{$this->getName()}' AS type",
32 - 'page_namespace AS namespace',
 31+ 'fields' => array ( 'page_namespace AS namespace',
3332 'page_title AS title',
3433 'COUNT(*) AS value',
3534 'page_is_redirect AS redirect' ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialAncientpages.php
@@ -21,11 +21,9 @@
2222 function isSyndicated() { return false; }
2323
2424 function getQueryInfo() {
25 - // FIXME standardize 'name' AS type ?
2625 return array(
2726 'tables' => array( 'page', 'revision' ),
28 - 'fields' => array( "'{$this->getName()}' AS type",
29 - 'page_namespace AS namespace',
 27+ 'fields' => array( 'page_namespace AS namespace',
3028 'page_title AS title',
3129 'rev_timestamp AS value' ),
3230 'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces(),
Index: branches/querypage-work2/phase3/includes/specials/SpecialWantedtemplates.php
@@ -23,8 +23,7 @@
2424 function getQueryInfo() {
2525 return array (
2626 'tables' => array ( 'templatelinks', 'page' ),
27 - 'fields' => array ( "'{$this->getName()}' AS type",
28 - 'tl_namespace AS namespace',
 27+ 'fields' => array ( 'tl_namespace AS namespace',
2928 'tl_title AS title',
3029 'COUNT(*) AS value' ),
3130 'conds' => array ( 'page_title IS NULL',
Index: branches/querypage-work2/phase3/includes/specials/SpecialUnwatchedpages.php
@@ -22,8 +22,7 @@
2323 function getQueryInfo() {
2424 return array (
2525 'tables' => array ( 'page', 'watchlist' ),
26 - 'fields' => array ( "'{$this->getName()}' AS type",
27 - 'page_namespace AS namespace',
 26+ 'fields' => array ( 'page_namespace AS namespace',
2827 'page_title AS title',
2928 'page_namespace AS value' ),
3029 'conds' => array ( 'wl_title IS NULL',
Index: branches/querypage-work2/phase3/includes/specials/SpecialDeadendpages.php
@@ -38,8 +38,7 @@
3939 function getQueryInfo() {
4040 return array(
4141 'tables' => array( 'page', 'pagelinks' ),
42 - 'fields' => array( "'{$this->getName()}' AS type",
43 - 'page_namespace AS namespace',
 42+ 'fields' => array( 'page_namespace AS namespace',
4443 'page_title AS title',
4544 'page_title AS value'
4645 ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostimages.php
@@ -21,8 +21,7 @@
2222 function getQueryInfo() {
2323 return array (
2424 'tables' => array ( 'imagelinks' ),
25 - 'fields' => array ( "'{$this->getName()}' AS type",
26 - "'" . NS_FILE . "' AS namespace",
 25+ 'fields' => array ( "'" . NS_FILE . "' AS namespace",
2726 'il_to AS title',
2827 'COUNT(*) AS value' ),
2928 'options' => array ( 'GROUP BY' => 'il_to',
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedcategories.php
@@ -22,8 +22,7 @@
2323 function getQueryInfo() {
2424 return array (
2525 'tables' => array ( 'categorylinks' ),
26 - 'fields' => array ( "'{$this->getName()}' AS type",
27 - "'" . NS_CATEGORY . "' AS namespace",
 26+ 'fields' => array ( "'" . NS_CATEGORY . "' AS namespace",
2827 'cl_to AS title',
2928 'COUNT(*) AS value' ),
3029 'options' => array ( 'GROUP BY' => 'cl_to' )
Index: branches/querypage-work2/phase3/includes/specials/SpecialDisambiguations.php
@@ -128,8 +128,7 @@
129129 // FIXME: What are pagelinks and p2 doing here?
130130 return array (
131131 'tables' => array( 'templatelinks', 'page AS p1', 'pagelinks', 'page AS p2' ),
132 - 'fields' => array( "'{$this->getName()}' AS type",
133 - 'p1.page_namespace AS namespace',
 132+ 'fields' => array( 'p1.page_namespace AS namespace',
134133 'p1.page_title AS title',
135134 'pl_from AS value' ),
136135 'conds' => array( $set,
Index: branches/querypage-work2/phase3/includes/specials/SpecialUncategorizedpages.php
@@ -28,8 +28,7 @@
2929 function getQueryInfo() {
3030 return array (
3131 'tables' => array ( 'page', 'categorylinks' ),
32 - 'fields' => array ( "'{$this->getName()}' AS type",
33 - 'page_namespace AS namespace',
 32+ 'fields' => array ( 'page_namespace AS namespace',
3433 'page_title AS title',
3534 'page_title AS value' ),
3635 // default for page_namespace is all content namespaces (if requestedNamespace is false)
Index: branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -26,8 +26,7 @@
2727 function getQueryInfo() {
2828 return array(
2929 'tables' => array( 'redirect', 'page AS p1', 'page AS p2' ),
30 - 'fields' => array( "'{$this->getName()}' AS type",
31 - 'p1.page_namespace AS namespace',
 30+ 'fields' => array( 'p1.page_namespace AS namespace',
3231 'p1.page_title AS title',
3332 'rd_namespace',
3433 'rd_title'
Index: branches/querypage-work2/phase3/includes/specials/SpecialWantedfiles.php
@@ -22,8 +22,7 @@
2323 function getQueryInfo() {
2424 return array (
2525 'tables' => array ( 'imagelinks', 'page' ),
26 - 'fields' => array ( "'{$this->getName()}' AS type",
27 - "'" . NS_FILE . "' AS namespace",
 26+ 'fields' => array ( "'" . NS_FILE . "' AS namespace",
2827 'il_to AS title',
2928 'COUNT(*) AS value' ),
3029 'conds' => array ( 'page_title IS NULL' ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialShortpages.php
@@ -30,8 +30,7 @@
3131 function getQueryInfo() {
3232 return array (
3333 'tables' => array ( 'page' ),
34 - 'fields' => array ( "'{$this->getName()}' AS type",
35 - 'page_namespace AS namespace',
 34+ 'fields' => array ( 'page_namespace AS namespace',
3635 'page_title AS title',
3736 'page_len AS value' ),
3837 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces(),
Index: branches/querypage-work2/phase3/includes/specials/SpecialListredirects.php
@@ -22,8 +22,7 @@
2323 function getQueryInfo() {
2424 return array (
2525 'tables' => array ( 'page' ),
26 - 'fields' => array ( "'{$this->getName()}' AS type",
27 - 'page_namespace AS namespace',
 26+ 'fields' => array ( 'page_namespace AS namespace',
2827 'page_title AS title' ),
2928 'conds' => array ( 'page_is_redirect' => 1 )
3029 );
Index: branches/querypage-work2/phase3/includes/specials/SpecialLonelypages.php
@@ -31,8 +31,7 @@
3232 return array (
3333 'tables' => array ( 'page', 'pagelinks',
3434 'templatelinks' ),
35 - 'fields' => array ( "'{$this->getName()}' AS type",
36 - 'page_namespace AS namespace',
 35+ 'fields' => array ( 'page_namespace AS namespace',
3736 'page_title AS title',
3837 'page_title AS value' ),
3938 'conds' => array ( 'pl_namespace IS NULL',
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostlinkedtemplates.php
@@ -52,8 +52,7 @@
5353 public function getQueryInfo() {
5454 return array (
5555 'tables' => array ( 'templatelinks' ),
56 - 'fields' => array ( "'{$this->getName()}' AS type",
57 - 'tl_namespace AS namespace',
 56+ 'fields' => array ( 'tl_namespace AS namespace',
5857 'tl_title AS title',
5958 'COUNT(*) AS value' ),
6059 'conds' => array ( 'tl_namespace' => NS_TEMPLATE' ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialMostlinked.php
@@ -25,8 +25,7 @@
2626 function getQueryInfo() {
2727 return array (
2828 'tables' => array ( 'pagelinks', 'page' ),
29 - 'fields' => array ( "'{$this->getName()}' AS type",
30 - 'pl_namespace AS namespace',
 29+ 'fields' => array ( 'pl_namespace AS namespace',
3130 'pl_title AS title',
3231 'COUNT(*) AS value',
3332 'page_namespace' ),
Index: branches/querypage-work2/phase3/includes/specials/SpecialUnusedtemplates.php
@@ -21,8 +21,7 @@
2222 function getQueryInfo() {
2323 return array (
2424 'tables' => array ( 'page', 'templatelinks' ),
25 - 'fields' => array ( "'{$this->getName()}' AS type",
26 - 'page_namespace AS namespace',
 25+ 'fields' => array ( 'page_namespace AS namespace',
2726 'page_title AS title',
2827 '0 AS value' ),
2928 'conds' => array ( 'page_namespace' => NS_TEMPLATE,
Index: branches/querypage-work2/phase3/includes/specials/SpecialWantedpages.php
@@ -51,8 +51,7 @@
5252 $query = array (
5353 'tables' => array ( 'pagelinks', 'page AS pg1',
5454 'page AS pg2' ),
55 - 'fields' => array ( "'{$this->getName()}' AS type",
56 - 'pl_namespace AS namespace',
 55+ 'fields' => array ( 'pl_namespace AS namespace',
5756 'pl_title AS title',
5857 'COUNT(*) AS value' ),
5958 'conds' => array ( 'pg1.page_namespace IS NULL',
Index: branches/querypage-work2/phase3/includes/specials/SpecialUnusedcategories.php
@@ -22,8 +22,7 @@
2323 function getQueryInfo() {
2424 return array (
2525 'tables' => array ( 'page', 'categorylinks' ),
26 - 'fields' => array ( "'{$this->getName()}' AS type",
27 - 'page_namespace AS namespace',
 26+ 'fields' => array ( 'page_namespace AS namespace',
2827 'page_title AS title',
2928 'page_title AS value' ),
3029 'conds' => array ( 'cl_from IS NULL',
Property changes on: branches/querypage-work2/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
3130 Merged /branches/querypage-work/phase3/includes/specials:r50105
Property changes on: branches/querypage-work2/phase3/includes/ConfEditor.php
___________________________________________________________________
Modified: svn:mergeinfo
3231 Merged /branches/querypage-work/phase3/includes/ConfEditor.php:r50105
Property changes on: branches/querypage-work2/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
3332 Merged /branches/querypage-work/phase3/includes:r50105
Property changes on: branches/querypage-work2/phase3
___________________________________________________________________
Modified: svn:mergeinfo
3433 Merged /branches/querypage-work/phase3:r50105
Index: branches/querypage-work2/TODO
@@ -5,8 +5,8 @@
66 ** Check whether sorts are efficient and page right
77 ** Check whether sorting by nothing is really what we want
88 ** Check whether selecting title or ns AS value is really what we want
9 -* Replace $result->type with getName(), remove type from queries
109 * Mark ShortPages as inexpensive
1110 * Reuse UncategorizedPages code in UncategorizedImages somehow
1211 * Make UncategorizedPages parameterized by namespace
1312
 13+* Convert UncategorizedImages
Property changes on: branches/querypage-work2
___________________________________________________________________
Modified: svn:mergeinfo
1414 Merged /branches/querypage-work:r50105

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50105querypage-work: Removing SELECT 'blah' AS name from SQL queriescatrope13:31, 1 May 2009

Status & tagging log