summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/utils.py b/packages/utils.py
index f8e1f2a1..82d47bc7 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -106,7 +106,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
@@ -115,7 +119,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]