From: Aaron Schulz Date: Tue, 24 Feb 2015 19:34:23 +0000 (-0800) Subject: Avoid calling rollback() in handleWriteError() if there is no trx X-Git-Tag: 1.31.0-rc.0~12277^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=0a873a3c28068d64670fdef555dcadf071023df1;p=lhc%2Fweb%2Fwiklou.git Avoid calling rollback() in handleWriteError() if there is no trx Change-Id: Ic3be89151160ad57acda5d95e3995a77f3835717 --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index df878f7205..2fb9ff992d 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -731,9 +731,11 @@ class SqlBagOStuff extends BagOStuff { $this->markServerDown( $exception, $serverIndex ); } if ( $exception->db && $exception->db->wasReadOnlyError() ) { - try { - $exception->db->rollback( __METHOD__ ); - } catch ( DBError $e ) { + if ( $exception->db->trxLevel() ) { + try { + $exception->db->rollback( __METHOD__ ); + } catch ( DBError $e ) { + } } }