Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 72250 invoked from network); 28 Oct 2008 19:36:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Oct 2008 19:36:06 -0000 Received: (qmail 3159 invoked by uid 500); 28 Oct 2008 19:36:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 3133 invoked by uid 500); 28 Oct 2008 19:36:10 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 3035 invoked by uid 99); 28 Oct 2008 19:36:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2008 12:36:09 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2008 19:35:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4FD0A234C23B for ; Tue, 28 Oct 2008 12:35:44 -0700 (PDT) Message-ID: <982950179.1225222544325.JavaMail.jira@brutus> Date: Tue, 28 Oct 2008 12:35:44 -0700 (PDT) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3880) NPE on a query with having clause involving a join In-Reply-To: <388414194.1221612464197.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3880?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1264= 3316#action_12643316 ]=20 Kathey Marsden commented on DERBY-3880: --------------------------------------- Thanks Army and Brian for looking at this pesky issue. With regard to DERBY= -3094, thank you for the write up. It was indeed most informative. As you = suggested I backed out the change for DERBY-3094 and found no appreciable d= ifference in the behaviour of the queries in question in this issue. I looked at the SubstituteExpressionVisitor logic and don't think it is rel= ated. The result column in question is the one created in AggregateNode.jav= a with the code node =3D (operand =3D=3D null) ? =09=09=09this.getNewNullResultExpression() : =09=09=09operand; =09=09return (ResultColumn) getNodeFactory().getNode( =09=09=09=09=09=09=09=09C_NodeTypes.RESULT_COLUMN, =09=09=09=09=09=09=09=09"##aggregate expression", =09=09=09=09=09=09=09=09node, =09=09=09=09=09=09=09=09getContextManager()); =09} where it is the operand being wrapped. I do not think this column is traver= sed with the SubstituteExpressionVisitor. > NPE on a query with having clause involving a join > -------------------------------------------------- > > Key: DERBY-3880 > URL: https://issues.apache.org/jira/browse/DERBY-3880 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.4.2.0 > Environment: Windows 2003 Server=20 > Reporter: Venkateswaran Iyer > Priority: Minor > Attachments: AggregateExpressionResultColumn.txt, querytree_fail.= txt, querytree_works.txt > > > A simple query involving a join and having clause causes a NPE. Any subse= quent executions cause severe errors. It almost looks like the underlying c= onnection was closed out. > =3D=3D=3D=3D > C:\apps\derby\db-derby-10.4.2.0-bin\db-derby-10.4.2.0-bin\bin>ij > ij version 10.4 > ij> connect 'jdbc:derby://speed:1527/ClassicModels;user=3Dsa;password=3Ds= a > '; > ij> create table t1(i int, c varchar(20)); > 0 rows inserted/updated/deleted > ij> create table t2(i int, c2 varchar(20), i2 int); > 0 rows inserted/updated/deleted > ij> insert into t1 values(1, 'abc'); > 1 row inserted/updated/deleted > ij> insert into t1 values(2, 'abc'); > 1 row inserted/updated/deleted > ij> insert into t2 values(1, 'xyz', 10); > 1 row inserted/updated/deleted > ij> insert into t2 values(1, 'aaa', 20); > 1 row inserted/updated/deleted > ij> insert into t2 values(2, 'xxx', 30); > 1 row inserted/updated/deleted > ij> select t1.i, avg(t2.i2) from t1 inner join t2 on (t1.i =3D t2.i) grou= p by t1.i > having avg(t2.i2) > 0; > ERROR XJ001: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: jav= a.lang. > NullPointerException=C2=B6=C2=B6XJ001.U --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.