Allow select/delete/update conditions with comparison to NULL using '='
-----------------------------------------------------------------------

                 Key: JRUBY-3026
                 URL: http://jira.codehaus.org/browse/JRUBY-3026
             Project: JRuby
          Issue Type: Improvement
          Components: ActiveRecord-JDBC
    Affects Versions: JRuby 1.1.4
         Environment: Fedora Linux 9, Sun Java 1.6.0_07, JRuby 1.1.4, 
ActiveRecord-jdbc-adapter 0.8.2, activerecord 2.1.1
            Reporter: Uwe Kubosch
            Priority: Minor
             Fix For: JRuby 1.1.5
         Attachments: activerecord-jdbc_null.patch

When using conditions with parameters like

Entry.find(:all, :conditions => ['title = ?', my_expression])

the resulting SQL statement fails on DerbyDB (JavaDB) if the given parameter 
computes til nil since DerbyDB does not allow comparison with NULL using the 
equals operator.  DerbyDB demands using "IS NULL" when comparing to NULL.

I have attached a patch with test that allows most uses to succeed.

Please review and comment.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to