[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: remote_scheduler: join on the notes table only when needed

Holger Levsen holger at moszumanska.debian.org
Sun Aug 9 12:59:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 3a689b4f8b6755adaf170e0d1a27453d197a6225
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sun Aug 9 12:43:26 2015 +0000

    reproducible: remote_scheduler: join on the notes table only when needed
---
 bin/reproducible_remote_scheduler.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index 2e5f7a9..59e2498 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -106,15 +106,16 @@ if arch not in ARCHS:
     sys.exit(1)
 
 if issue or status or built_after or built_before:
-    formatter = dict(suite=suite)
+    formatter = dict(suite=suite, notes_table='')
     log.info('Querying packages with given issues/status...')
     query = 'SELECT s.name ' + \
-            'FROM sources AS s, notes AS n, results AS r ' + \
-            'WHERE n.package_id=s.id AND r.package_id=s.id ' + \
+            'FROM sources AS s, {notes_table} results AS r ' + \
+            'WHERE r.package_id=s.id ' + \
             'AND s.suite = "{suite}" AND r.status != "blacklisted" '
     if issue:
-        query += 'AND n.issues LIKE "%{issue}%" '
+        query += 'AND n.package_id=s.id AND n.issues LIKE "%{issue}%" '
         formatter['issue'] = issue
+        formatter['notes_table'] = 'notes AS n,'
     if status:
         query += 'AND r.status = "{status}"'
         formatter['status'] = status

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list