Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 38D08200D0E for ; Tue, 26 Sep 2017 14:54:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 376411609EA; Tue, 26 Sep 2017 12:54:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7DC561609C1 for ; Tue, 26 Sep 2017 14:54:04 +0200 (CEST) Received: (qmail 98340 invoked by uid 500); 26 Sep 2017 12:54:03 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 98331 invoked by uid 99); 26 Sep 2017 12:54:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 12:54:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3AF121A250F for ; Tue, 26 Sep 2017 12:54:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 26MjVp2kKVnt for ; Tue, 26 Sep 2017 12:54:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id CB74760E46 for ; Tue, 26 Sep 2017 12:54: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 DEACDE00A7 for ; Tue, 26 Sep 2017 12:54:00 +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 A307024252 for ; Tue, 26 Sep 2017 12:54:00 +0000 (UTC) Date: Tue, 26 Sep 2017 12:54:00 +0000 (UTC) From: "Nikita Timofeev (JIRA)" To: commits@cayenne.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CAY-2366) Incorrect EJBQL COUNT translation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 26 Sep 2017 12:54:05 -0000 [ https://issues.apache.org/jira/browse/CAY-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nikita Timofeev closed CAY-2366. -------------------------------- Resolution: Fixed Fix Version/s: 4.1.M1 4.0.B2 > Incorrect EJBQL COUNT translation > --------------------------------- > > Key: CAY-2366 > URL: https://issues.apache.org/jira/browse/CAY-2366 > Project: Cayenne > Issue Type: Bug > Affects Versions: 4.0.B2, 4.1.M1 > Reporter: Andrus Adamchik > Assignee: Nikita Timofeev > Fix For: 4.0.B2, 4.1.M1 > > > As a part of 4.0.B2 evaluation, I tried running LinkRest tests on 4.0.B2. I got a few errors related to EJBQL query with COUNT translation. Consider this query for instance: > {noformat} > select count(a) from E17 a > {noformat} > Previously it generated SQL like this: > {noformat} > SELECT COUNT(*) AS sc0 FROM utest.e17 t0 > {noformat} > Now it generates SQL with an explicit ID inside COUNT, but the alias for the column and the alias for the table do not match: > {noformat} > SELECT COUNT(t0.id1) AS sc0 FROM utest.e17 t1 > {noformat} > The result is an exception similar to this: > {noformat} > java.sql.SQLSyntaxErrorException: Column 'T0.ID1' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'T0.ID1' is not a column in the target table. > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)