From 966cc2213117c15a6b09d2c4e179b0929cff3023 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Sun, 22 Apr 2012 08:30:48 +0200 Subject: [PATCH] Fix query for certain postgresql versions. --- src/script/hydra-update-gc-roots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/hydra-update-gc-roots b/src/script/hydra-update-gc-roots index a8c9de81..e22b5764 100755 --- a/src/script/hydra-update-gc-roots +++ b/src/script/hydra-update-gc-roots @@ -94,7 +94,7 @@ foreach my $project ($db->resultset('Projects')->search({}, { order_by => ["name [ "select b2.id from Builds b2 join " . " (select distinct job, system, coalesce( " . " (select id from builds where project = b.project and jobset = b.jobset and job = b.job and system = b.system and finished = 1 and buildStatus = 0 order by id desc offset ? limit 1)" . - " , 0) nth from builds b where project = ? and jobset = ? and isCurrent = 1) x " . + " , 0) as nth from builds b where project = ? and jobset = ? and isCurrent = 1) x " . " on b2.project = ? and b2.jobset = ? and b2.job = x.job and b2.system = x.system and (id >= x.nth) where finished = 1 and buildStatus = 0" , [ '', $keepnr - 1 ], [ '', $project->name ], [ '', $jobset->name ], [ '', $project->name ], [ '', $jobset->name ] ] } },