Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-1034

ScriptedSQL - complex expression doesn't filter correctly anymore

    XMLWordPrintable

Details

    Description

      Filtering of complex expression stopped work in recent scriptedsql version. Example shown in reproduce steps worked in older versions.

      Sample used: scripted-sql-with-mysql

      Steps to reproduce

      1. create users
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '{"uid": "C11548686815", "firstName": "1548686815", "lastName": "1548686815", "timestamp": "1548686815", "organization": "1548686815" ,"email": "uid=C11548686815"}' --request POST "http://localhost:8080/openidm/system/hrdb/account/?_action=create"
        
        Response Content:
        {"_id":"8","uid":"C11548686815","cars":[],"lastName":"1548686815","firstName":"1548686815","email":"uid=C11548686815","fullName":"","organization":"1548686815"}
        
      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '{"uid": "C21548686815", "firstName": "1548686815", "lastName": "1548686815", "timestamp": "1548686815", "organization": "1548686815" ,"email": "uid=C21548686815"}' --request POST "http://localhost:8080/openidm/system/hrdb/account/?_action=create"
      
      Response Content:
      {"_id":"9","uid":"C21548686815","cars":[],"lastName":"1548686815","firstName":"1548686815","email":"uid=C21548686815","fullName":"","organization":"1548686815"}
      
      1. filter users on system/hrdb/account
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "http://localhost:8080/openidm/system/hrdb/account/?_queryFilter=uid%20sw%20"UNKNOWN"%20or%20uid%20co%20"1548686815"%20and%20!(uid%20sw%20"C2")"
        
        Response Content:
        {"result":[{"_id":"8","uid":"C11548686815","cars":[],"lastName":"1548686815","firstName":"1548686815","email":"uid=C11548686815","fullName":"","organization":"1548686815"},{"_id":"9","uid":"C21548686815","cars":[],"lastName":"1548686815","firstName":"1548686815","email":"uid=C21548686815","fullName":"","organization":"1548686815"}],"resultCount":2,"pagedResultsCookie":null,"totalPagedResultsPolicy":"NONE","totalPagedResults":-1,"remainingPagedResults":-1}
        

      same result with

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "http://localhost:8080/openidm/system/hrdb/account/?_queryFilter=uid+sw+'UNKNOWN'+or+uid+co+'1548686815'+and+!(uid+sw+'C2')"
      

      By this we can see that !(uid sw "C2") stopped working and uid with starting C2 is not correctly filtered

      Attachments

        Issue Links

          Activity

            People

              petr.jurica Petr Jurica [X] (Inactive)
              michal.orlik@profiq.cz Michal Orlik
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: