mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-25 20:46:12 +10:00
Fix UNION syntax for MySQL
Apparently MySQL doesn't support this syntax:
(...) UNION (...)
instead it only supports:
...
UNION
...
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user