diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-10-09 08:37:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-10-09 08:37:48 +0000 |
commit | 878a91a283a7cd50e88ab23bec97ecce5be39ad8 (patch) | |
tree | 1c1a2c4c88dd7e00913bdc26a5f435c52c37dba5 /lib/redmine | |
parent | e7f1780d7dba000aa399535547f0c6607d0a9b69 (diff) | |
download | redmine-878a91a283a7cd50e88ab23bec97ecce5be39ad8.tar.gz redmine-878a91a283a7cd50e88ab23bec97ecce5be39ad8.zip |
Reverts r15891 (#23318).
Deadlocks with MySQL.
git-svn-id: http://svn.redmine.org/redmine/trunk@15892 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/nested_set/issue_nested_set.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/redmine/nested_set/issue_nested_set.rb b/lib/redmine/nested_set/issue_nested_set.rb index e939f96b6..afbe6b995 100644 --- a/lib/redmine/nested_set/issue_nested_set.rb +++ b/lib/redmine/nested_set/issue_nested_set.rb @@ -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 |