From f50b11cfa293b3d86e3728f53f0e8965909e8e33 Mon Sep 17 00:00:00 2001 From: Anton Gladky Date: Tue, 16 Aug 2022 22:18:47 +0200 Subject: Use COALESCE for the querry. Thanks to Florian for the tip --- lib/python/security_db.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 35d61f104b..0c0d6dfe46 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -2074,9 +2074,7 @@ class DB: cursor = self.cursor() last_bug = None - show_ignored_sql = "" - if (not show_ignored): - show_ignored_sql = "AND source_package_status.debian_bug_file = 1" + show_ignored_sql = f" AND COALESCE (debian_bug_file = {1 if show_ignored else 0}, NULL)" result = [] for bug, pkg in cursor.execute( -- cgit v1.2.3