Details
-
Bug
-
Resolution: Done
-
Major
-
4.2.0.Final
-
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