JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-3026

[Derby] Allow select/delete/update conditions with comparison to NULL using '='

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fedora Linux 9, Sun Java 1.6.0_07, JRuby 1.1.4, ActiveRecord-jdbc-adapter 0.8.2, activerecord 2.1.1
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      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.

        Activity

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Uwe Kubosch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: