]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
sg-report-job-history: Cope if history too short
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 29 May 2015 14:14:41 +0000 (14:14 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 18 Jun 2015 15:31:04 +0000 (16:31 +0100)
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@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
sg-report-job-history

index e4f35bf01955fee7f9be94348fbb5a7e47dd22b3..76cb146d7b5086997f28cd03e4d6ab07719997a5 100755 (executable)
@@ -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