r50069 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50068‎ | r50069 | r50070 >
Date:06:00, 30 April 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Small-scale data loss logged on Wikimedia along these lines: invalid URL written to old_text with the user thinking their edit has succeeded. This change should prevent that scenario.
Modified paths:
  • /trunk/phase3/includes/ExternalStoreDB.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ExternalStoreDB.php
@@ -136,6 +136,9 @@
137137 array( 'blob_id' => $id, 'blob_text' => $data ),
138138 __METHOD__ );
139139 $id = $dbw->insertId();
 140+ if ( !$id ) {
 141+ throw new MWException( __METHOD__.': no insert ID' );
 142+ }
140143 if ( $dbw->getFlag( DBO_TRX ) ) {
141144 $dbw->immediateCommit();
142145 }

Status & tagging log