Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2435

JCR-SQL2 query with order by and limit returns results when the offset exceeds the total result set size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.3.0.Final
    • 4.2.0.Final
    • Query
    • None

    Description

      JCR-SQL2 queries that contain both an order by clause and a limit (with offset) clause are incorrectly returning results when the offset exceeds the total result set size.

      If the order by clause is excluded the offset clause works as expected.

      For example assuming a queries total result set size is 10, the following query correctly returns an empty result set

      SELECT [jcr:path] FROM [car:Car] LIMIT 10 OFFSET 15
      

      but this query incorrectly returns a result set with 10 rows

      SELECT [jcr:path] FROM [car:Car] ORDER BY [jcr:path] LIMIT 10 OFFSET 15
      

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            ma6rl_jira Richard Lucas (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: