From dfbf524d3561e3fc54a9a072fda173435acc2e14 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 27 Aug 2012 14:41:15 +0200 Subject: [PATCH] Removed unmatched commits in Job class. Job had two calls to commit() that did not correspond to any call to begin(). This may prematurely about any "outer" transaction, may cause database corruption, and trigger warnings. There did not seem to be any good reason for these commits to be there. Sorting out unmatched begin/commit calls is important to allow the addition of support for nested transactions, and it also helps with finding "interesting" database problems. Change-Id: Iff394f97fbad6e9304d75e6ad69155ada80b9c33 --- includes/job/Job.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/job/Job.php b/includes/job/Job.php index d7c95632fe..45f057062c 100644 --- a/includes/job/Job.php +++ b/includes/job/Job.php @@ -153,7 +153,6 @@ abstract class Job { $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ ); $affected = $dbw->affectedRows(); - $dbw->commit( __METHOD__ ); if ( !$affected ) { // Failed, someone else beat us to it @@ -177,7 +176,6 @@ abstract class Job { // Delete the random row $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ ); $affected = $dbw->affectedRows(); - $dbw->commit( __METHOD__ ); if ( !$affected ) { // Random job gone before we exclusively deleted it -- 2.20.1