From: Aaron Schulz Date: Fri, 16 May 2014 18:22:31 +0000 (-0700) Subject: Minor fix to DatabaseBase::close() logic X-Git-Tag: 1.31.0-rc.0~15676^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;ds=sidebyside;h=7868e80b77b63a6d60b1e792ac8b7de36b00fa60;p=lhc%2Fweb%2Fwiklou.git Minor fix to DatabaseBase::close() logic * Only set mOpened to false if closeConnection() was called (or mConn was unset) bug: 65100 Change-Id: I1ba6b765cfc647a47f21048d993047c0fe0cfe19 --- 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; } /**