mirror of
				https://github.com/redmine/redmine.git
				synced 2025-11-03 20:06:24 +01:00 
			
		
		
		
	Reverts r15891 (#23318).
Deadlocks with MySQL. git-svn-id: http://svn.redmine.org/redmine/trunk@15892 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
		@@ -158,10 +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
 | 
			
		||||
          self.class.reorder(:id).
 | 
			
		||||
            joins("INNER JOIN #{self.class.table_name} t2 ON #{self.class.table_name}.root_id = t2.root_id").
 | 
			
		||||
            where("t2.id IN (?)", sets_to_lock).
 | 
			
		||||
            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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user