From 7868e80b77b63a6d60b1e792ac8b7de36b00fa60 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 16 May 2014 11:22:31 -0700 Subject: [PATCH] Minor fix to DatabaseBase::close() logic * Only set mOpened to false if closeConnection() was called (or mConn was unset) bug: 65100 Change-Id: I1ba6b765cfc647a47f21048d993047c0fe0cfe19 --- includes/db/Database.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 286f8b0b96..13efb812a3 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -926,7 +926,6 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { if ( count( $this->mTrxIdleCallbacks ) ) { // sanity throw new MWException( "Transaction idle callbacks still pending." ); } - $this->mOpened = false; if ( $this->mConn ) { if ( $this->trxLevel() ) { if ( !$this->mTrxAutomatic ) { @@ -937,13 +936,14 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { $this->commit( __METHOD__, 'flush' ); } - $ret = $this->closeConnection(); + $closed = $this->closeConnection(); $this->mConn = false; - - return $ret; } else { - return true; + $closed = true; } + $this->mOpened = false; + + return $closed; } /** -- 2.20.1