From ec455d68fa14e66e3f4fd54b2ac8381fe151c3fd Mon Sep 17 00:00:00 2001 From: Platonides Date: Tue, 19 Apr 2011 17:59:59 +0000 Subject: [PATCH] (Bug 28611) Don't die in SqlBagOStuff::incr() if there's a race condition. --- includes/objectcache/SqlBagOStuff.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 10f42cdcd8..6952cdf0a3 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -188,7 +188,12 @@ class SqlBagOStuff extends BagOStuff { 'keyname' => $key, 'value' => $db->encodeBlob( $this->serialize( $newValue ) ), 'exptime' => $row->exptime - ), __METHOD__ ); + ), __METHOD__, 'IGNORE' ); + + if ( $db->affectedRows() == 0 ) { + // Race condition. See bug 28611 + $newValue = null; + } $db->commit(); } catch ( DBQueryError $e ) { $this->handleWriteError( $e ); -- 2.20.1