From 0a873a3c28068d64670fdef555dcadf071023df1 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 24 Feb 2015 11:34:23 -0800 Subject: [PATCH] Avoid calling rollback() in handleWriteError() if there is no trx Change-Id: Ic3be89151160ad57acda5d95e3995a77f3835717 --- includes/objectcache/SqlBagOStuff.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 ) { + } } } -- 2.20.1