[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 07/12] sg-report-job-history: Cope if history too short



If there have been less than 99 relevant flights, the inner SELECT (to
determine the minimum flight number) would return NULL.  And anything
> NULL is NULL and NULL is treated as false.  So the host runvar
identification would break.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-job-history |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sg-report-job-history b/sg-report-job-history
index e4f35bf..76cb146 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -182,10 +182,11 @@ END
         FROM runvars
         JOIN flights USING (flight)
        WHERE ($cond)
-         AND flight >= (
+         AND flight >= COALESCE(
+             (
              SELECT flight $fromstuff
              LIMIT 1 OFFSET $offset
-          )
+            ), 0)
      ORDER BY name;
 END
     $hostsq->execute(@params, @params); # sql text contains $cond twice
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.