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

Regression: SQL token bind indices not incremented correctly when LIST BindType

    Details

      Description

      When the bindToken method of a LIST BindType is performed the indices are not incremented and the remaining tokens are bound to the incorrect position.

      Example: Consider this portion of the SQL: "originproperty in (${list:originproperties}) AND originresourcecollection = ${origincollection} " in RelationshipResources

      • Let the originproperties LIST contain: "reports", "bestFriend"
      • Let the origincollection STRING equal "managed/user"
      • The SQL string goes through the bindToken method the first time when it is for a LIST BindType and it comes out looking like:
        "originproperty in (reports, bestFriend) AND originresourcecollection = '?' "
      • Then when the SQL string goes through the method on line 476 the second time it is for a STRING BindType and it comes out looking like:
        "originproperty in (reports, managed/user) AND originresourcecollection = '?' " ... Notice bestFriend was overwritten due to the position being behind by 1 so it put "managed/user" in the position for 2 instead of the position for 3

      We would expect: "originproperty in (reports, bestFriend) AND originresourcecollection = managed/user" but the binding is incorrect because the count did not increment for all list positions.

      This started occuring when list logic was moved to the BindType enum in this commit https://stash.forgerock.org/projects/OPENIDM/repos/openidm/commits/609c0849ad9d61d8998f3a44bd6c0f58b4edde6f

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                katie.gonzalez Katie Gonzalez
                Reporter:
                katie.gonzalez Katie Gonzalez
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: