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

NULL not set correctly when adding users. It is set to string of 'null'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.5.0
    • Fix Version/s: 7.0.0
    • Environment:
      6.5.0.1 and any SQL DB repo with explicit mapping set (For my test I used mySQL 5.7)
    • Target Version/s:
    • Verified Version/s:
    • Support Ticket IDs:
    • Zendesk ID:
      42384
    • Support Ticket ID:

      Description

      Steps to reproduce:

      1) . Set up IDM 6.5.0.1 with SQL repo and explicit mapping.

      2) . Add a user via the UI or REST as long as users are there. I added two.

      Using postman, I created the following user:

      { "userName": "FR-6.5", "givenName": "ForgeRock", "sn": "Example", "password": "Welcome1", "mail": "henry@example.com" }

       

      Here is the results of adding in the user:

      { "_id": "244ca2d6-b9dc-45f9-bf36-1c3d75147946", "_rev": "0", "userName": "FR-6.5", "accountStatus": "active", "postalCode": null, "stateProvince": null, "postalAddress": null, "address2": null, "country": null, "city": null, "givenName": "ForgeRock", "description": null, "sn": "Example", "telephoneNumber": null, "mail": "henry@example.com", "kbaInfo": null, "preferences": null, "consentedMappings": null, "effectiveAssignments": [], "effectiveRoles": [] }

       
      Please note that kbainfo is set to null and was not touched when added.  My defaults for the field is set to NULL. From the JSON above it looks like it is actual null and not string 'null'
      3).  Query the database:

      mysql> select username from managed_user where kbainfo is null;
      Empty set (0.00 sec)

      mysql> select username from managed_user where kbainfo = 'null';
      ----------

      username

      ----------

      FR-6.5 

      As you can see, it looks like we are somehow touching the field and instead of leaving the default, we are updating it to string 'null'.  Also, not all fields get updated as string 'null' which causes customer confusion.  In the example above, postalCode stays as true null.  postalCode will return if queried for null.  I have tested this out in 5.5 and it did not happen there.  

      Results for 5.5

      mysql> select username from managed_user where kbainfo = 'null';

      Empty set (0.00 sec)

      mysql> select username from managed_user where kbainfo is null;

      ----------

      username

      ----------

      FR-6.5 

       

       

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              matthias.grabiak Matthias Grabiak
              Reporter:
              jesse.ontiveros Jesse Ontiveros
              QA Assignee:
              Petr Bednar [X] Petr Bednar [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: