r62148 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62147‎ | r62148 | r62149 >
Date:00:57, 9 February 2010
Author:tstarling
Status:ok
Tags:
Comment:
Bug fix: bt_page and bt_rev_id should be 0 for orphans, not null.
Modified paths:
  • /trunk/phase3/maintenance/storage/fixBug20757.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/fixBug20757.php
@@ -159,14 +159,14 @@
160160
161161 // Find the page_id and rev_id
162162 // The page is probably the same as the page of the secondary row
163 - $pageId = $trackRow->bt_page;
164 - if ( $pageId === null ) {
165 - $revId = null;
 163+ $pageId = intval( $trackRow->bt_page );
 164+ if ( !$pageId ) {
 165+ $revId = $pageId = 0;
166166 } else {
167167 $revId = $this->findTextIdInPage( $pageId, $primaryId );
168 - if ( $revId === null ) {
 168+ if ( !$revId ) {
169169 // Actually an orphan
170 - $pageId = null;
 170+ $pageId = $revId = 0;
171171 }
172172 }
173173
@@ -189,7 +189,7 @@
190190 // without needing to run trackBlobs.php again
191191 $dbw->insert( 'blob_tracking',
192192 array(
193 - 'bt_page' => $trackRow->bt_page,
 193+ 'bt_page' => $pageId,
194194 'bt_rev_id' => $revId,
195195 'bt_text_id' => $primaryId,
196196 'bt_cluster' => $trackRow->bt_cluster,

Status & tagging log