diff mbox series

[OSSTEST,05/13] sg-report-host-history: Get job status from mainquery

Message ID 20191108185001.3319-6-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Speed up and restore host history | expand

Commit Message

Ian Jackson Nov. 8, 2019, 6:49 p.m. UTC
We are going to need this as part of our data reuse cache key, so we
need it this early.  This change hardly slows the query down.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-report-host-history | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/sg-report-host-history b/sg-report-host-history
index d47784d9..81a7a8d8 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -122,8 +122,9 @@  sub mainquery () {
     our @params = keys %hosts;
 
     our $runvarq //= db_prepare(<<END);
-	SELECT flight, job, name, val
+	SELECT flight, job, name, val, status
 	  FROM runvars
+          JOIN jobs USING (flight, job)
 	 WHERE $namecond
 	   AND ($valcond)
 	   AND $flightcond
@@ -186,10 +187,9 @@  sub reporthost ($) {
 END
 
     our $infoq //= db_prepare(<<END);
-	SELECT blessing, branch, intended, status
+	SELECT blessing, branch, intended
 	  FROM flights
-	  JOIN jobs USING (flight)
-	 WHERE flight=? AND job=?
+	 WHERE flight=? AND ?!='X'
 END
 
     our $allocdq //= db_prepare(<<END);