summaryrefslogtreecommitdiffstats
path: root/app/models/issue_query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-04 10:08:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-04 10:08:29 +0000
commit9a66463ff8464e5780923f0f9476524fdbc6d978 (patch)
tree7886abb299b21c0fb25daf48875898c8ef6210d7 /app/models/issue_query.rb
parenta8083fb9a81d442be19cf3b528f2e4bc5bfe1ba5 (diff)
downloadredmine-9a66463ff8464e5780923f0f9476524fdbc6d978.tar.gz
redmine-9a66463ff8464e5780923f0f9476524fdbc6d978.zip
Prevent sqlserver adapter from breaking the sub-query (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11116 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r--app/models/issue_query.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index b0e282f89..81e6e1cef 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -209,7 +209,7 @@ class IssueQuery < Query
index = (index ? index + 1 : -1)
# insert the column after estimated_hours or at the end
@available_columns.insert index, QueryColumn.new(:spent_hours,
- :sortable => "(SELECT COALESCE(SUM(hours), 0) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id)",
+ :sortable => "COALESCE((SELECT SUM(hours) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id), 0)",
:default_order => 'desc',
:caption => :label_spent_time
)