mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Reverted r16053 (#23318).
SQL error with PostgreSQL. git-svn-id: http://svn.redmine.org/redmine/trunk@16054 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
10b3e3e323
commit
575f4032a2
@ -158,8 +158,7 @@ module Redmine
|
||||
self.class.reorder(:id).where(:root_id => sets_to_lock).lock(lock).ids
|
||||
else
|
||||
sets_to_lock = [id, parent_id].compact
|
||||
inner_join_statement = self.class.select(:root_id).where(id: sets_to_lock).distinct(:root_id).to_sql
|
||||
self.class.reorder(:id).joins("INNER JOIN (#{inner_join_statement}) as i2 ON #{self.class.table_name}.root_id = i2.root_id").lock.ids
|
||||
self.class.reorder(:id).where("root_id IN (SELECT root_id FROM #{self.class.table_name} WHERE id IN (?))", sets_to_lock).lock.ids
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user