From: Roan Kattouw Date: Fri, 24 Oct 2008 18:54:02 +0000 (+0000) Subject: API: Partial fix of bug 16076: use pl_from instead of page_id in list=backlinks query... X-Git-Tag: 1.31.0-rc.0~44622 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=31cf2fef2deb4c19f3b6b59c6b5e68f93c8c658e;p=lhc%2Fweb%2Fwiklou.git API: Partial fix of bug 16076: use pl_from instead of page_id in list=backlinks query. The two are equal because of the JOIN clause, but pl_from is indexed whereas page_id isn't (MySQL 5 automatically rewrites this, 4 doesn't) --- diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index a9534512b8..efc1a91b16 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -113,7 +113,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addWhereFld($this->bl_ns, $this->rootTitle->getNamespace()); $this->addWhereFld('page_namespace', $this->params['namespace']); if(!is_null($this->contID)) - $this->addWhere("page_id>={$this->contID}"); + $this->addWhere("pl_from>={$this->contID}"); if($this->params['filterredir'] == 'redirects') $this->addWhereFld('page_is_redirect', 1); if($this->params['filterredir'] == 'nonredirects') @@ -147,7 +147,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addWhere($titleWhere); $this->addWhereFld('page_namespace', $this->params['namespace']); if(!is_null($this->redirID)) - $this->addWhere("page_id>={$this->redirID}"); + $this->addWhere("pl_from>={$this->redirID}"); if($this->params['filterredir'] == 'redirects') $this->addWhereFld('page_is_redirect', 1); if($this->params['filterredir'] == 'nonredirects')