From a462904fbfab892fe61eecb8ff740445ad7615d0 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 30 Apr 2009 06:00:01 +0000 Subject: [PATCH] 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. --- includes/ExternalStoreDB.php | 3 +++ 1 file changed, 3 insertions(+) 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(); } -- 2.20.1