From: Tim Starling Date: Thu, 30 Apr 2009 06:00:01 +0000 (+0000) Subject: Small-scale data loss logged on Wikimedia along these lines: invalid URL written... X-Git-Tag: 1.31.0-rc.0~41925 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=a462904fbfab892fe61eecb8ff740445ad7615d0;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php index 9aa3af85a6..c37e706242 100644 --- a/includes/ExternalStoreDB.php +++ b/includes/ExternalStoreDB.php @@ -136,6 +136,9 @@ class ExternalStoreDB { array( 'blob_id' => $id, 'blob_text' => $data ), __METHOD__ ); $id = $dbw->insertId(); + if ( !$id ) { + throw new MWException( __METHOD__.': no insert ID' ); + } if ( $dbw->getFlag( DBO_TRX ) ) { $dbw->immediateCommit(); }