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.jack...@eu.citrix.com>
Acked-by: Ian Campbell <ian.campb...@citrix.com>
---
 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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to