Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2771

It seems like h2 'unlimited' is not "LIMIT 0" but rather "LIMIT -1"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Component/s: jdbc
    • Labels:
      None

      Description

      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:

      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

      If I read this correctly then we can skip the whole LIMIT clause if no setMaxResults was set.

        Attachments

          Activity

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              struberg Mark Struberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: