* live immediatebegin hack
authorDomas Mituzas <midom@users.mediawiki.org>
Fri, 24 Feb 2006 20:38:46 +0000 (20:38 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Fri, 24 Feb 2006 20:38:46 +0000 (20:38 +0000)
* remove ORDER BY for pop operation, InnoDB sorts by PK anyway, MyISAM would work as 'pool' rather than 'stack',
  submited to http://bugs.mysql.com/bug.php?id=17711

includes/JobQueue.php

index b18a819..82d2fca 100644 (file)
@@ -49,13 +49,14 @@ class Job {
                // Pop an item off the front of the queue
                // Method due to Domas, may not work on all DBMSes
                $dbw =& wfGetDB( DB_MASTER );
+               $dbw->immediateBegin();
                $jobTable = $dbw->tableName( 'job' );
                $dbw->query( "DELETE FROM $jobTable WHERE " .
                        '(job_cmd = @job_cmd := job_cmd) AND ' .
                        '(job_namespace = @job_namespace := job_namespace) AND ' .
                        '(job_title = @job_title := job_title) AND ' .
                        '(job_params = @job_params := job_params) ' .
-                       'ORDER BY job_id LIMIT 1', $fname );
+                       'LIMIT 1', $fname );
                $affected = $dbw->affectedRows();
                // Commit now before 100 other threads pile up behind us
                $dbw->immediateCommit();