substring: Define negative index for substring function

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major
    • V4.01_WD01
    • Affects Version/s: V4.0_ERRATA02
    • Component/s: URL Conventions
    • None
    • Environment:

      [Proposed]

    • Hide

      In ODATA-781 we defined that a negative index in substring is explicitly undefined, since we did not define a behavior and there were at least two valid interpretations, and that interoperable clients should not use negative indexes.

      In 4.01, we agreed that negative indexes should mean count from the end.

      in particular, substring(string,-n,m) is equivalent to substring(string,length(string)-n,m)

      Show
      In ODATA-781 we defined that a negative index in substring is explicitly undefined, since we did not define a behavior and there were at least two valid interpretations, and that interoperable clients should not use negative indexes. In 4.01, we agreed that negative indexes should mean count from the end. in particular, substring(string,-n,m) is equivalent to substring(string,length(string)-n,m)
    • Show
      https://www.oasis-open.org/apps/org/workgroup/odata/download.php/59028/odata-v4.01-wd01-part1-protocol.docx https://www.oasis-open.org/apps/org/workgroup/odata/download.php/59029/odata-v4.01-wd01-part2-url-conventions.docx

      This could be a "bad request" returning no results at all, or it could evaluate to null, which may just lead to excluding the offending instance from the result.

      Or a mix of both: negative start index is "bad request", start index or desired length beyond the end of the first argument is "null".

            Assignee:
            handl
            Reporter:
            handl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: