]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Incorrect filtering for unset values when using 'is not' filter.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 23 Jan 2008 20:07:17 +0000 (20:07 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 23 Jan 2008 20:07:17 +0000 (20:07 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1098 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index 3a1b5a19eeb870d8a57393012e180939984e4d7f..adfd5f42af49c218e74c3df6e24522cd360f5992 100644 (file)
@@ -300,7 +300,7 @@ class Query < ActiveRecord::Base
       when "="
         sql = sql + "#{db_table}.#{db_field} IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
       when "!"
-        sql = sql + "#{db_table}.#{db_field} NOT IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
+        sql = sql + "(#{db_table}.#{db_field} IS NULL OR #{db_table}.#{db_field} NOT IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + "))"
       when "!*"
         sql = sql + "#{db_table}.#{db_field} IS NULL"
       when "*"