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

[OSSTEST PATCH 54/82] host reuse: Use literal for the hosts_infraprioritygroup runvar



From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

At some point this might make the database smarter about indexing.
It's certainly clearer.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/JobDB/Executive.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 8c235d45..8fde2934 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -403,19 +403,19 @@ sub jobdb_set_hosts_infraprioritygroup ($$$$;$) { # method
                (job = ?) AS thisjob
           FROM runvars
          WHERE flight=?
-           AND name=?
+           AND name='$vn'
       ORDER BY thisjob DESC
 END
     my $insertq = $dbh_tests->prepare(<<END);
-        INSERT INTO runvars (flight,job, name,val, synth)
-                     VALUES (?,     ?,   ?,   ?,   't')
+        INSERT INTO runvars (flight,job, name,  val, synth)
+                     VALUES (?,     ?,   '$vn', ?,   't')
 END
 
     my $resulting;
     db_retry($dbh_tests,[],sub {
        my $use = 1;
        $resulting = undef;
-        $queryq->execute($job, $flight, $vn);
+        $queryq->execute($job, $flight);
        while (my ($tjob, $tval, $thisjob) = $queryq->fetchrow_array()) {
            if ($thisjob) {
                logm("$vn: job is already in group $tval");
@@ -431,7 +431,7 @@ END
        }
        $resulting = "$use:$group_key";
        logm("$vn: inserting job into group $resulting");
-       $insertq->execute($flight,$job,$vn, $resulting);
+       $insertq->execute($flight,$job, $resulting);
     });
     $rref->{$vn} = $resulting if $rref && defined $resulting;
 }
-- 
2.20.1




 


Rackspace

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