Commit bfc8ba04 authored by James Fargher's avatar James Fargher

Merge branch 'omit-useless-labels-clause' into 'master'

Omit WHERE clause for NOT labels filter when empty

See merge request gitlab-org/gitlab!73230
parents 1d408874 dce09398
......@@ -82,6 +82,8 @@ module Issuables
if root_namespace
label_ids = find_label_ids(label_names).flatten(1)
return issuables if label_ids.empty?
issuables.where(label_link_query(target_model, label_ids: label_ids).arel.exists.not)
else
issuables.where(label_link_query(target_model, label_names: label_names).arel.exists.not)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment