diff options
Diffstat (limited to 'packages/utils.py')
-rw-r--r-- | packages/utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/utils.py b/packages/utils.py index 2a43a08b..ab3c074f 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -109,7 +109,11 @@ SELECT p.id, q.id AND p.arch_id != q.arch_id AND p.id != q.id ) - WHERE p.arch_id IN (%s, %s) + WHERE p.arch_id in (%s, %s) + AND ( + q.arch_id in (%s, %s) + OR q.id IS NULL + ) AND ( q.id IS NULL OR p.pkgver != q.pkgver @@ -118,7 +122,7 @@ SELECT p.id, q.id ) """ cursor = connection.cursor() - cursor.execute(sql, [arch_a.id, arch_b.id]) + cursor.execute(sql, [arch_a.id, arch_b.id, arch_a.id, arch_b.id]) results = cursor.fetchall() # column A will always have a value, column B might be NULL to_fetch = [row[0] for row in results] |