Jackrabbit Oak
  1. Jackrabbit Oak
  2. OAK-546

Query: unexpected result on negative limit / offset

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6
    • Component/s: core, jcr
    • Labels:
      None

      Description

      Currently, running a query with limit of -1 never returns any rows, the same as when using limit = 0.

      Either the query engine should fail with a negative limit or offset (IllegalArgumentException), or it should ignore negative values (unlimited result rows for limit, probably no offset for offset = -1).

      I would prefer IllegalArgumentException, but I can also live with -1 = unlimited, at least for "limit".

        Issue Links

          Activity

          Jukka Zitting made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Jukka Zitting made changes -
          Fix Version/s 0.6 [ 12323297 ]
          Hide
          Thomas Mueller added a comment -

          Jackrabbit 2.x also throws an exception on negative limit or offset:

          QueryImpl.setLimit:
          if (limit < 0)

          { throw new IllegalArgumentException("limit must not be negative"); }
          Show
          Thomas Mueller added a comment - Jackrabbit 2.x also throws an exception on negative limit or offset: QueryImpl.setLimit: if (limit < 0) { throw new IllegalArgumentException("limit must not be negative"); }
          Thomas Mueller made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Thomas Mueller added a comment -

          Revision 1431357 (oak-core) and
          revision 1431360 (oak-jcr):
          throw IllegalArgumentException for negative values

          Show
          Thomas Mueller added a comment - Revision 1431357 (oak-core) and revision 1431360 (oak-jcr): throw IllegalArgumentException for negative values
          Thomas Mueller made changes -
          Field Original Value New Value
          Link This issue relates to OAK-545 [ OAK-545 ]
          Thomas Mueller created issue -

            People

            • Assignee:
              Thomas Mueller
              Reporter:
              Thomas Mueller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development