Index: trunk/phase3/includes/SpecialContributions.php |
— | — | @@ -163,9 +163,8 @@ |
164 | 164 | $use_index = $this->dbr->useIndexClause( $index ); |
165 | 165 | $sql = 'SELECT ' . |
166 | 166 | 'page_namespace,page_title,page_is_new,page_latest,'. |
167 | | - 'rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user,rev_user_text,'. |
168 | | - 'rev_deleted,rev_len ' . |
169 | | - "FROM $page,$revision $use_index " . |
| 167 | + join(',', Revision::selectFields()). |
| 168 | + " FROM $page,$revision $use_index " . |
170 | 169 | "WHERE page_id=rev_page AND $userCond $nscond $offsetQuery " . |
171 | 170 | 'ORDER BY rev_timestamp DESC'; |
172 | 171 | $sql = $this->dbr->limitResult( $sql, $this->limit, 0 ); |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -249,6 +249,25 @@ |
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
| 253 | + * Return the list of revision fields that should be selected to create |
| 254 | + * a new revision. |
| 255 | + */ |
| 256 | + static function selectFields() { |
| 257 | + return array( |
| 258 | + 'rev_id', |
| 259 | + 'rev_page', |
| 260 | + 'rev_text_id', |
| 261 | + 'rev_timestamp', |
| 262 | + 'rev_comment', |
| 263 | + 'rev_minor_edit', |
| 264 | + 'rev_user', |
| 265 | + 'rev_user_text,'. |
| 266 | + 'rev_deleted', |
| 267 | + 'rev_len' |
| 268 | + ); |
| 269 | + } |
| 270 | + |
| 271 | + /** |
253 | 272 | * @param object $row |
254 | 273 | * @access private |
255 | 274 | */ |