summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-11-18 13:31:18 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2015-11-18 13:31:18 +0100
commit9eefae69171ba199d34bccf504902500a980fcb3 (patch)
tree5b4a70ccd2ecc0947d2d04e0d7ff26e59952d51d /lib/gitlab
parentcc11c44ba997eb32dfa48ea225ae4c6942bc8610 (diff)
downloadgitlab-ce-9eefae69171ba199d34bccf504902500a980fcb3.tar.gz
Fix UNION syntax for MySQL
Apparently MySQL doesn't support this syntax: (...) UNION (...) instead it only supports: ... UNION ...
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/sql/union.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/sql/union.rb b/lib/gitlab/sql/union.rb
index 1a62eff0b31..1cd89b3a9c4 100644
--- a/lib/gitlab/sql/union.rb
+++ b/lib/gitlab/sql/union.rb
@@ -23,11 +23,11 @@ module Gitlab
# (thus fixing this problem), at a slight performance cost.
fragments = ActiveRecord::Base.connection.unprepared_statement do
@relations.map do |rel|
- "(#{rel.reorder(nil).to_sql})"
+ rel.reorder(nil).to_sql
end
end
- fragments.join(' UNION ')
+ fragments.join("\nUNION\n")
end
end
end