From dev-return-25942-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Sat Feb 2 09:22:04 2019 Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43F8F18E0B for ; Sat, 2 Feb 2019 09:22:04 +0000 (UTC) Received: (qmail 78101 invoked by uid 500); 2 Feb 2019 09:22:04 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 78058 invoked by uid 500); 2 Feb 2019 09:22:04 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 78047 invoked by uid 99); 2 Feb 2019 09:22:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2019 09:22:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 83773C237F for ; Sat, 2 Feb 2019 09:22:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 4o4ynpF1gC6W for ; Sat, 2 Feb 2019 09:22:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A6CD65FB27 for ; Sat, 2 Feb 2019 09:22:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0B183E02ED for ; Sat, 2 Feb 2019 09:22:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5EE72243E2 for ; Sat, 2 Feb 2019 09:22:00 +0000 (UTC) Date: Sat, 2 Feb 2019 09:22:00 +0000 (UTC) From: "Mark Struberg (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (OPENJPA-2771) It seems like h2 'unlimited' is not "LIMIT 0" but rather "LIMIT -1" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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)