From 13df3e4191e5ee8ce378d372e0e7d8b26a2fecf1 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Tue, 1 Nov 2011 21:35:02 -0400 Subject: [PATCH] fix nrbuilds query --- src/lib/Hydra/Controller/API.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/API.pm b/src/lib/Hydra/Controller/API.pm index c4915409..5a67b39c 100644 --- a/src/lib/Hydra/Controller/API.pm +++ b/src/lib/Hydra/Controller/API.pm @@ -189,7 +189,7 @@ sub nrbuilds : Chained('api') PathPart('nrbuilds') Args(0) { $base = 60*60 if($period eq "hour"); $base = 24*60*60 if($period eq "day"); - my @stats = $c->model('DB::Builds')->search($filter, {select => ["count(*)"], as => ["nr"], group_by => ["timestamp - timestamp % $base"], order_by => "timestamp - timestamp % $base DESC", rows => $nr}) ; + my @stats = $c->model('DB::Builds')->search($filter, {select => [{ count => "*" }], as => ["nr"], group_by => ["timestamp - timestamp % $base"], order_by => "timestamp - timestamp % $base DESC", rows => $nr}) ; my @arr ; foreach my $d (@stats) { push @arr, int($d->get_column("nr"));