[Collab-qa-commits] r824 - svnbuildstat/trunk/lib/SvnBuildStat/Controller
goneri at alioth.debian.org
goneri at alioth.debian.org
Sun Apr 27 14:14:39 UTC 2008
Author: goneri
Date: 2008-04-27 14:14:38 +0000 (Sun, 27 Apr 2008)
New Revision: 824
Modified:
svnbuildstat/trunk/lib/SvnBuildStat/Controller/Controls.pm
Log:
fix the SQL request used to get a fresh QA job
Modified: svnbuildstat/trunk/lib/SvnBuildStat/Controller/Controls.pm
===================================================================
--- svnbuildstat/trunk/lib/SvnBuildStat/Controller/Controls.pm 2008-04-27 13:52:33 UTC (rev 823)
+++ svnbuildstat/trunk/lib/SvnBuildStat/Controller/Controls.pm 2008-04-27 14:14:38 UTC (rev 824)
@@ -76,7 +76,27 @@
my $dbh = $c->model('DB')->storage->dbh;
- my $request = "select changelogentry.id,changelogentry.dscuri, build.id from build, changelogentry left join qajob on changelogentry.id=qajob.changelogentry_id AND qajob.qatool_id=".$qatool->id." WHERE build.changelogentry_id=changelogentry.id AND buildisok='1' order by changelogentry.date DESC, build.time DESC, lastjobstart IS NULL, lastjobstart, qajob.date LIMIT 1";
+ my $request = "
+SELECT
+ changelogentry.id,
+ changelogentry.dscuri,
+ build.id from build,
+ changelogentry
+ LEFT JOIN
+ qajob
+ ON
+ changelogentry.id=qajob.changelogentry_id
+ AND
+ qajob.qatool_id=".$qatool->id."
+WHERE
+ build.changelogentry_id=changelogentry.id
+ AND
+ buildisok='1'
+ ORDER BY
+ lastjobstart IS NOT NULL,
+ lastjobstart
+ LIMIT 1";
+# TODO improve the ORDER BY
my @array = $dbh->selectrow_array($request);
my $changelogentry_id = $array[0];
More information about the Collab-qa-commits
mailing list