Grails
  1. Grails
  2. GRAILS-9013

SimpleMapDatastore does not remove null values from the index

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.4
    • Component/s: Persistence, Testing
    • Labels:
      None
    • Testcase included:
      yes

      Description

      Saving an entity with null for a property, then updating the property to a not-null value still retains the null value in the property index. The below test fails because it still finds the author with a null pseudonym.

          def 'Null is de-indexed'() {
              def author = new AuthorWithPseudonym(name: 'Samuel Clemens').save(failOnError: true)
              author.pseudonym = 'Mark Twain'
              author.save(failOnError: true)
      
              expect:
              !AuthorWithPseudonym.findByPseudonymIsNull()
          }
      

        Activity

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Daniel Wiell
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development