aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryAllpages.php
diff options
context:
space:
mode:
authorRoan Kattouw <catrope@users.mediawiki.org>2008-05-10 10:49:26 +0000
committerRoan Kattouw <catrope@users.mediawiki.org>2008-05-10 10:49:26 +0000
commit5b8213e9efc8807b9bf2c67ce86106a938cdf2be (patch)
tree1288f55637c5c246d793e712611aab16fce47740 /includes/api/ApiQueryAllpages.php
parentb47979916c2b8a5c39d74ff9257183f76673bbe7 (diff)
downloadmediawikicore-5b8213e9efc8807b9bf2c67ce86106a938cdf2be.tar.gz
mediawikicore-5b8213e9efc8807b9bf2c67ce86106a938cdf2be.zip
* Re-applying r34449, r34500 and r34518 which Brion reverted by accident
* Adding ApiQueryBase::addJoinConds() as wrapper for Database::select()'s $join_conds parameter * Migrating query modules to addJoinConds() * Using implicit join rather than INNER JOIN in ApiQueryBacklinks * Using FORCE INDEX (times) on logging table in ApiQueryLogEvents; although MySQL 4 seems to pick this index automatically (evidenced by the fact the WMF servers are still alive), MySQL 5 doesn't and filesorts * Replacing LEFT JOIN with implicit (inner) join in ApiQueryContributions: revisions without a corresponding page table entry shouldn't be shown anyway
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/34565
Diffstat (limited to 'includes/api/ApiQueryAllpages.php')
-rw-r--r--includes/api/ApiQueryAllpages.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php
index 4758542e5e91..222b42ad4a84 100644
--- a/includes/api/ApiQueryAllpages.php
+++ b/includes/api/ApiQueryAllpages.php
@@ -57,6 +57,7 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
$params = $this->extractRequestParams();
// Page filters
+ $this->addTables('page');
if (!$this->addWhereIf('page_is_redirect = 1', $params['filterredir'] === 'redirects'))
$this->addWhereIf('page_is_redirect = 0', $params['filterredir'] === 'nonredirects');
$this->addWhereFld('page_namespace', $params['namespace']);
@@ -97,18 +98,14 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
}
if($params['filterlanglinks'] == 'withoutlanglinks') {
- $pageName = $this->getDB()->tableName('page');
- $llName = $this->getDB()->tableName('langlinks');
- $tables = "$pageName LEFT JOIN $llName ON page_id=ll_from";
+ $this->addTables('langlinks');
+ $this->addJoinConds(array('langlinks' => array('LEFT JOIN', 'page_id=ll_from')));
$this->addWhere('ll_from IS NULL');
- $this->addTables($tables);
$forceNameTitleIndex = false;
} else if($params['filterlanglinks'] == 'withlanglinks') {
- $this->addTables(array('page', 'langlinks'));
+ $this->addTables('langlinks');
$this->addWhere('page_id=ll_from');
$forceNameTitleIndex = false;
- } else {
- $this->addTables('page');
}
if ($forceNameTitleIndex)
$this->addOption('USE INDEX', 'name_title');