r83411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83410‎ | r83411 | r83412 >
Date:22:16, 6 March 2011
Author:btongminh
Status:ok
Tags:
Comment:
Kill filtering by hash because the query is unindexed. We need a condition on fa_storage_group, but I'm not sure how index merging will work out. I don't have time to investigate this at the moment, so killing it in its entirety seems the safest option for now.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryFilearchive.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryFilearchive.php
@@ -95,16 +95,6 @@
9696 if ( isset( $params['prefix'] ) )
9797 $this->addWhere( 'fa_name' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
9898
99 - $sha1 = false;
100 - if ( isset( $params['sha1'] ) ) {
101 - $sha1 = wfBaseConvert( $params['sha1'], 16, 36, 31 );
102 - } elseif ( isset( $params['sha1base36'] ) ) {
103 - $sha1 = $params['sha1base36'];
104 - }
105 - if ( $sha1 ) {
106 - $this->addWhere( 'fa_storage_key=' . $db->addQuotes( $sha1 ) );
107 - }
108 -
10999 $limit = $params['limit'];
110100 $this->addOption( 'LIMIT', $limit + 1 );
111101 $this->addOption( 'ORDER BY', 'fa_name' .
@@ -186,8 +176,6 @@
187177 'descending'
188178 )
189179 ),
190 - 'sha1' => null,
191 - 'sha1base36' => null,
192180 'prop' => array(
193181 ApiBase::PARAM_DFLT => 'timestamp',
194182 ApiBase::PARAM_ISMULTI => true,
@@ -212,8 +200,6 @@
213201 'prefix' => 'Search for all image titles that begin with this value',
214202 'dir' => 'The direction in which to list',
215203 'limit' => 'How many total images to return',
216 - 'sha1' => "SHA1 hash of image. Overrides {$this->getModulePrefix()}sha1base36",
217 - 'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)',
218204 'prop' => array(
219205 'What image information to get:',
220206 ' sha1 - Adds SHA-1 hash for the image',

Follow-up revisions

RevisionCommit summaryAuthorDate
r834871.17wmf1: MFT r82696, r83270, r83284, r83374, r83390, r83392, r83402, r83403,...catrope21:44, 7 March 2011
r85354MFT r82518, r82530, r82538, r82547, r82550, r82565, r82572, r82608, r82696, r...demon18:25, 4 April 2011
r89542* (bug 21346) Make deleted images searchable by hash (disabled in Miser Mode)...reedy23:40, 5 June 2011

Status & tagging log