summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Stark <stark@gitlab.com>2018-02-13 22:49:57 +0100
committerGreg Stark <stark@gitlab.com>2018-02-13 22:49:57 +0100
commit5e4b672465b8d0f79c4437865e95364eb3f6b175 (patch)
tree39cf439dca7ef64ea25a9e1aae71850a2f676a65
parent91002b129a6e8644c288bd3174eae8942285ca81 (diff)
downloadgitlab-ce-recursive-join-union-all.tar.gz
Use UNION ALL instead of UNION on the recursive query for nested namespacesrecursive-join-union-all
-rw-r--r--lib/gitlab/group_hierarchy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/group_hierarchy.rb b/lib/gitlab/group_hierarchy.rb
index 42ded7c286f..73a190cd78c 100644
--- a/lib/gitlab/group_hierarchy.rb
+++ b/lib/gitlab/group_hierarchy.rb
@@ -85,7 +85,8 @@ module Gitlab
descendants_table = descendants.alias_to(groups_table)
union = SQL::Union.new([model.unscoped.from(ancestors_table),
- model.unscoped.from(descendants_table)])
+ model.unscoped.from(descendants_table)],
+ remove_duplicates: false)
relation = model
.unscoped