r63730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63729‎ | r63730 | r63731 >
Date:05:42, 14 March 2010
Author:maxsem
Status:deferred
Tags:
Comment:
* (bug 22828) Fixed deletion on SQLite in 1.15 - backportage of r59755
Modified paths:
  • /branches/REL1_15/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_15/phase3/includes/BagOStuff.php (modified) (history)

Diff [purge]

Index: branches/REL1_15/phase3/includes/BagOStuff.php
@@ -437,10 +437,19 @@
438438 var $lb, $db;
439439
440440 function _getDB(){
441 - if ( !isset( $this->lb ) ) {
442 - $this->lb = wfGetLBFactory()->newMainLB();
443 - $this->db = $this->lb->getConnection( DB_MASTER );
444 - $this->db->clearFlag( DBO_TRX );
 441+ global $wgDBtype;
 442+ if ( !isset( $this->db ) ) {
 443+ /* We must keep a separate connection to MySQL in order to avoid deadlocks
 444+ * However, SQLite has an opposite behaviour.
 445+ * @todo Investigate behaviour for other databases
 446+ */
 447+ if ( $wgDBtype == 'sqlite' ) {
 448+ $this->db = wfGetDB( DB_MASTER );
 449+ } else {
 450+ $this->lb = wfGetLBFactory()->newMainLB();
 451+ $this->db = $this->lb->getConnection( DB_MASTER );
 452+ $this->db->clearFlag( DBO_TRX );
 453+ }
445454 }
446455 return $this->db;
447456 }
Index: branches/REL1_15/phase3/RELEASE-NOTES
@@ -20,6 +20,9 @@
2121 Those wishing to use the latest code instead of a branch release can obtain
2222 it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
2323
 24+=== Changes since 1.15.2 ===
 25+* (bug 22828) Fixed deletion on SQLite.
 26+
2427 === Changes since 1.15.1 ===
2528
2629 * The installer now includes a check for a data corruption issue with certain

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59755Eliminated deadlock during parser tests on SQLitemaxsem10:33, 5 December 2009

Status & tagging log