Skip to content

Commit

Permalink
fix(manager): systems_affected columns should never be NULL when appl…
Browse files Browse the repository at this point in the history
…ying filters

...and for some reason postgresql executes the query faster

RHINENG-5256
  • Loading branch information
jdobes committed Dec 6, 2023
1 parent 1758124 commit 7df1c2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manager/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,9 @@ def _filter_cve_by_affecting_host_type(query, args, kwargs):
expr = None
for arg in affecting:
if arg == HostType.RPMDNF:
expr |= fn.COALESCE(count_subquery.c.systems_affected_rpmdnf_, 0) != 0
expr |= count_subquery.c.systems_affected_rpmdnf_ != 0
elif arg == HostType.EDGE:
expr |= fn.COALESCE(count_subquery.c.systems_affected_edge_, 0) != 0
expr |= count_subquery.c.systems_affected_edge_ != 0
elif arg == HostType.NONE:
expr |= (fn.COALESCE(count_subquery.c.systems_affected_rpmdnf_, 0) + fn.COALESCE(count_subquery.c.systems_affected_edge_, 0)) == 0
if expr:
Expand Down

0 comments on commit 7df1c2b

Please sign in to comment.