Mark Struberg created OPENJPA-2771: -------------------------------------- Summary: It seems like h2 'unlimited' is not "LIMIT 0" but rather "LIMIT -1" Key: OPENJPA-2771 URL: https://issues.apache.org/jira/browse/OPENJPA-2771 Project: OpenJPA Issue Type: Bug Components: jdbc Affects Versions: 3.0.0 Reporter: Mark Struberg Assignee: Mark Struberg Fix For: 3.0.1
Our H2Dictionary currently sets {{LIMIT 0 OFFSET 3}} when a {{Query#setFirstResult(3)}} is set without any {{setMaxResults}}. This results in zero entries in the result list. When I set {{LIMIT -1}, then all works fine. According to the h2database documentation at http://h2database.com/html/grammar.html we can assume the followint: {quote}LIMIT and FETCH FIRST/NEXT ROW(S) ONLY limits the number of rows returned by the query (no limit if null or smaller than zero). OFFSET specified how many rows to skip{quote} If I read this correctly then we can skip the whole LIMIT clause if no {{setMaxResults}} was set. -- This message was sent by Atlassian JIRA (v7.6.3#76005)