Commit 8e00a2aa authored by jplang's avatar jplang

Cast as decimal(30,0) instead of integer (#21249).

git-svn-id: https://svn.redmine.org/redmine/trunk@16197 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 9349a71e
......@@ -976,7 +976,7 @@ class Query < ActiveRecord::Base
"#{queried_table_name}.id #{not_in} IN (" +
"SELECT customized_id FROM #{CustomValue.table_name}" +
" WHERE customized_type='#{queried_class}' AND custom_field_id=#{custom_field_id}" +
" AND value <> '' AND CAST(value AS integer) IN (" +
" AND CAST(CASE value WHEN '' THEN '0' ELSE value END AS decimal(30,0)) IN (" +
" SELECT customized_id FROM #{CustomValue.table_name}" +
" WHERE customized_type='#{target_class}' AND custom_field_id=#{chained_custom_field_id}" +
" AND #{sql_for_field(field, operator, value, CustomValue.table_name, 'value')}))"
......@@ -998,7 +998,7 @@ class Query < ActiveRecord::Base
"#{queried_table_name}.id #{not_in} IN (" +
"SELECT customized_id FROM #{CustomValue.table_name}" +
" WHERE customized_type='#{queried_class}' AND custom_field_id=#{custom_field_id}" +
" AND value <> '' AND CAST(value AS integer) IN (" +
" AND CAST(CASE value WHEN '' THEN '0' ELSE value END AS decimal(30,0)) IN (" +
" SELECT id FROM #{target_table_name} WHERE #{sql_for_field(field, operator, value, filter[:field].format.target_class.table_name, attribute)}))"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment