Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-2549

unexpected results for queryFilters on integer properties when using [MSSQL] JDBC repo

    XMLWordPrintable

    Details

    • Story Points:
      0.5
    • Sprint:
      Sprint 29, Sprint 35

      Description

      When using JDBC repo, queryFilters on integer values are not behaving properly.
      What we observe is that objects that don't have the property that we are filtering are filtered out,
      but objects that do have this property are retrieved, whatever the value of the property.

      Steps to reproduce

      1) add property "number" as searchable in repo.jdbc.json

      "/userName" : {
          "searchable" : true
      },
      

      2) create 2 users, one with property "number"=100

      curl --header "If-None-Match: *" --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"userName": "rsutter", "telephoneNumber": "6669876987", "givenName": "rick", "description": "Just another John Doe or Joe Smith", "number": 100, "sn": "sutter", "mail": "rick@example.com", "password": "Th3Password"}' --request PUT "http://localhost:8080/openidm/managed/user/ricksutter"
      

      and

      curl --header "If-None-Match: *" --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"userName": "anotherrsutter", "telephoneNumber": "6669876987", "givenName": "rick", "description": "Just another John Doe or Joe Smith", "sn": "sutter", "mail": "rick@example.com", "password": "Th3Password"}' --request PUT "http://localhost:8080/openidm/managed/user/anotherricksutter"
      

      3) queryFilter with number<99 should return no user:

      curl --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --request GET "http://localhost:8080/openidm/managed/user?_queryFilter=number+lt+99"
      Response: {"result":[{"mail":"rick@example.com","sn":"sutter","passwordAttempts":"0","number":100,"lastPasswordAttempt":"Fri Nov 14 2014 21:41:26 GMT+0100 (CET)","address2":"","givenName":"rick","effectiveRoles":["openidm-authorized"],"country":"","city":"","_rev":"0","lastPasswordSet":"","postalCode":"","_id":"ricksutter","description":"Just another John Doe or Joe Smith","accountStatus":"active","telephoneNumber":"6669876987","roles":["openidm-authorized"],"effectiveAssignments":{},"postalAddress":"","stateProvince":"","userName":"rsutter"}],"resultCount":1,"pagedResultsCookie":null,"remainingPagedResults":-1}
      

      => we get 1 user which is not good

      Note: after discussion with Brendan, the property number is stored as a string currently, it could/should not work at all and we should get an error. TO analyse/discuss.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brmiller Brendan Miller
              Reporter:
              laurent.bristiel Laurent Bristiel [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: