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
$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
// 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