r69499 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69498‎ | r69499 | r69500 >
Date:09:36, 18 July 2010
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
Let Title::newFromIDs() select all fields and use Title::newFromRow() since we already are in the "page" table
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -218,12 +218,13 @@
219219 return array();
220220 }
221221 $dbr = wfGetDB( DB_SLAVE );
222 - $res = $dbr->select( 'page', array( 'page_namespace', 'page_title' ),
223 - 'page_id IN (' . $dbr->makeList( $ids ) . ')', __METHOD__ );
 222+
 223+ $res = $dbr->select( 'page', array( '*' ),
 224+ array( 'page_id' => $ids ), __METHOD__ );
224225
225226 $titles = array();
226227 foreach ( $res as $row ) {
227 - $titles[] = Title::makeTitle( $row->page_namespace, $row->page_title );
 228+ $titles[] = Title::newFromRow( $row );
228229 }
229230 return $titles;
230231 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r69868Per Simetrical, fix for r69499: only select the fields used by Title::newFrom...ialex11:31, 25 July 2010

Comments

#Comment by Simetrical (talk | contribs)   00:01, 20 July 2010

This retrieves a lot of unnecessary data, including a tinyblob. It's probably better to select only the four fields used by newFromRow() right now, unless you have some specific reason for selecting * instead.

#Comment by IAlex (talk | contribs)   11:32, 25 July 2010

Done in r69868.

Status & tagging log