summaryrefslogtreecommitdiff
path: root/includes/BagOStuff.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-04-07 04:33:59 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-04-07 04:33:59 +0200
commit03e45da6f96fd9aa411e015554f559b3ee9a61da (patch)
tree4936acbffcd395763235288a09bfd5576d16d3ff /includes/BagOStuff.php
parent6f5403ca6e8561c3dcd19284f86b4c3c8dd715ff (diff)
update to MediaWiki 1.15.3
Diffstat (limited to 'includes/BagOStuff.php')
-rw-r--r--includes/BagOStuff.php17
1 files changed, 13 insertions, 4 deletions
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;
}