From 03e45da6f96fd9aa411e015554f559b3ee9a61da Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 7 Apr 2010 04:33:59 +0200 Subject: update to MediaWiki 1.15.3 --- includes/BagOStuff.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'includes/BagOStuff.php') diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 572dca6c..ffa8a0bb 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -437,10 +437,19 @@ class MediaWikiBagOStuff extends SqlBagOStuff { var $lb, $db; function _getDB(){ - if ( !isset( $this->lb ) ) { - $this->lb = wfGetLBFactory()->newMainLB(); - $this->db = $this->lb->getConnection( DB_MASTER ); - $this->db->clearFlag( DBO_TRX ); + global $wgDBtype; + if ( !isset( $this->db ) ) { + /* We must keep a separate connection to MySQL in order to avoid deadlocks + * However, SQLite has an opposite behaviour. + * @todo Investigate behaviour for other databases + */ + if ( $wgDBtype == 'sqlite' ) { + $this->db = wfGetDB( DB_MASTER ); + } else { + $this->lb = wfGetLBFactory()->newMainLB(); + $this->db = $this->lb->getConnection( DB_MASTER ); + $this->db->clearFlag( DBO_TRX ); + } } return $this->db; } -- cgit v1.2.3-54-g00ecf