Skip to content

Commit

Permalink
Fix #1695 by calling resetTransactionProfiler late, refs #1603
Browse files Browse the repository at this point in the history
  • Loading branch information
mwjames committed Jul 4, 2016
1 parent 83072ec commit feeac57
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/MediaWiki/DatabaseConnectionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class DatabaseConnectionProvider implements DBConnectionProvider {
*/
private $connection = null;

/**
* @var Database
*/
private $resetTransactionProfiler = false;

/**
* @see DBConnectionProvider::getConnection
*
Expand All @@ -34,12 +39,12 @@ public function getConnection() {
}

/**
* @see #1499
* @see #1499, #1603
*
* @since 2.4
*/
public function resetTransactionProfiler() {
$this->getConnection()->resetTransactionProfiler();
$this->resetTransactionProfiler = true;
}

/**
Expand All @@ -60,6 +65,11 @@ private function createConnection() {

$connection->setDBPrefix( $GLOBALS['wgDBprefix'] );

// #1695
if ( $this->resetTransactionProfiler ) {
$connection->resetTransactionProfiler();
}

return $connection;
}

Expand Down

0 comments on commit feeac57

Please sign in to comment.