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 9578A200CF7 for ; Tue, 5 Sep 2017 08:08:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 921C1165476; Tue, 5 Sep 2017 06:08:12 +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 D93A816376F for ; Tue, 5 Sep 2017 08:08:11 +0200 (CEST) Received: (qmail 89973 invoked by uid 500); 5 Sep 2017 06:08:10 -0000 Mailing-List: contact notifications-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list notifications@ofbiz.apache.org Received: (qmail 89964 invoked by uid 99); 5 Sep 2017 06:08:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2017 06:08:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 492921825F1 for ; Tue, 5 Sep 2017 06:08:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Pk8zHH2iENDi for ; Tue, 5 Sep 2017 06:08:05 +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 8C3686127B for ; Tue, 5 Sep 2017 06:08:03 +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 B6787E0F05 for ; Tue, 5 Sep 2017 06:08:02 +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 B803224177 for ; Tue, 5 Sep 2017 06:08:01 +0000 (UTC) Date: Tue, 5 Sep 2017 06:08:01 +0000 (UTC) From: "Jacques Le Roux (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OFBIZ-9676) Error of GROUP BY in SQL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 05 Sep 2017 06:08:12 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-9676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16153144#comment-16153144 ] Jacques Le Roux commented on OFBIZ-9676: ---------------------------------------- Thanks Wei for this Jira and the relation with OFBIZ-9428 :). I had a look after your comment in OFBIZ-9428 but had to time to do more yet. > Error of GROUP BY in SQL > ------------------------ > > Key: OFBIZ-9676 > URL: https://issues.apache.org/jira/browse/OFBIZ-9676 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Trunk > Reporter: Wei Zhang > > To reproduce this error: > 1. Create a view entity > {code:borderStyle=solid} > > > > > > {code} > 2. Find the view entity in groovy > {code:borderStyle=solid} > EntityQuery.use(delegator).from("ExampleTypeView").queryList() > {code} > 3. An error will occur as below > 2017-08-29 10:27:09,990 |jsse-nio-8443-exec-3 |GenericDelegator |E| Failure in findByCondition operation for entity [ExampleTypeView]: org.apache.ofbiz.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT EX.EXAMPLE_ID, EX.EXAMPLE_TYPE_ID FROM public.EXAMPLE EX GROUP BY EX.EXAMPLE_TYPE_ID (ERROR: column "ex.example_id" must appear in the GROUP BY clause or be used in an aggregate function > Position: 8). Rolling back transaction. > org.apache.ofbiz.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT EX.EXAMPLE_ID, EX.EXAMPLE_TYPE_ID FROM public.EXAMPLE EX GROUP BY EX.EXAMPLE_TYPE_ID (ERROR: column "ex.example_id" must appear in the GROUP BY clause or be used in an aggregate function > Position: 8) > at org.apache.ofbiz.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:446) ~[ofbiz.jar:?] > at org.apache.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:869) ~[ofbiz.jar:?] > at org.apache.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:141) ~[ofbiz.jar:?] > at org.apache.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1552) ~[ofbiz.jar:?] > at org.apache.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1586) [ofbiz.jar:?] > at org.apache.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) [ofbiz.jar:?] > at org.apache.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:381) [ofbiz.jar:?] > at org.apache.ofbiz.entity.util.EntityQuery$queryList$1.call(Unknown Source) [ofbiz.jar:?] > at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-all-2.4.12.jar:2.4.12] > at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-all-2.4.12.jar:2.4.12] > at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) [groovy-all-2.4.12.jar:2.4.12] > at uk.co.robertheath.mobile.FooServices.getFoo(FooServices.groovy:31) [script:?] > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112] > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112] > Kind Regards, > Wei -- This message was sent by Atlassian JIRA (v6.4.14#64029)