Fix UNION syntax for MySQL

Apparently MySQL doesn't support this syntax:

    (...) UNION (...)

instead it only supports:

    ...
    UNION
    ...
This commit is contained in:
Yorick Peterse
2015-11-18 13:31:18 +01:00
parent cc11c44ba9
commit 9eefae6917
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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