From: daniel Date: Mon, 27 Aug 2012 12:41:15 +0000 (+0200) Subject: Removed unmatched commits in Job class. X-Git-Tag: 1.31.0-rc.0~22269^2~1 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=dfbf524d3561e3fc54a9a072fda173435acc2e14;p=lhc%2Fweb%2Fwiklou.git 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 --- 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