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 a3c13b17..55a2901a 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -111,7 +111,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 @@ -120,7 +124,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] |