Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 75241 invoked from network); 29 Oct 2006 23:16:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2006 23:16:25 -0000 Received: (qmail 56419 invoked by uid 500); 29 Oct 2006 23:16:36 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 56387 invoked by uid 500); 29 Oct 2006 23:16:36 -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 56377 invoked by uid 99); 29 Oct 2006 23:16:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 15:16:36 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 15:16:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1E46D7142E7 for ; Sun, 29 Oct 2006 15:15:18 -0800 (PST) Message-ID: <32427446.1162163718121.JavaMail.root@brutus> Date: Sun, 29 Oct 2006 15:15:18 -0800 (PST) From: "Yip Ng (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2014) NullPointerException with NULLIF in GROUP BY clause In-Reply-To: <22537169.1162060876528.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DERBY-2014?page=all ] Yip Ng updated DERBY-2014: -------------------------- Attachment: derby2014-trunk-stat01.txt derby2014-trunk-diff01.txt Attaching patch derby2014-trunk-diff01.txt for DERBY-2014. Again the NPE happens in isEquivalent() method where it does not handle value is null. (same symptom as DERBY-2008) and the patch addresses this + additonal testcases. derbyall + junit suite passes. > NullPointerException with NULLIF in GROUP BY clause > --------------------------------------------------- > > Key: DERBY-2014 > URL: http://issues.apache.org/jira/browse/DERBY-2014 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.2.1.6, 10.3.0.0 > Environment: Any > Reporter: Yip Ng > Assigned To: Yip Ng > Attachments: derby2014-trunk-diff01.txt, derby2014-trunk-stat01.txt > > > A NPE occurs when NULLIF is used in the GROUP BY clause. > ij> create table t1 (c1 int); > 0 rows inserted/updated/deleted > ij> insert into t1 values 1,2,2,3; > 4 rows inserted/updated/deleted > ij> select nullif(c1,c1) from t1 group by nullif(c1,c1); > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > Stacktrace: > java.lang.NullPointerException > at org.apache.derby.impl.sql.compile.ConstantNode.isEquivalent(ConstantNode.java:285) > at org.apache.derby.impl.sql.compile.CastNode.isEquivalent(CastNode.java:1044) > at org.apache.derby.impl.sql.compile.ConditionalNode.isEquivalent(ConditionalNode.java:518) > at org.apache.derby.impl.sql.compile.GroupByList.findGroupingColumn(GroupByList.java:244) > at org.apache.derby.impl.sql.compile.VerifyAggregateExpressionsVisitor.skipChildren(VerifyAggregateExpressionsVisitor.java:146) > at org.apache.derby.impl.sql.compile.ConditionalNode.accept(ConditionalNode.java:484) > at org.apache.derby.impl.sql.compile.ResultColumn.accept(ResultColumn.java:1515) > at org.apache.derby.impl.sql.compile.QueryTreeNodeVector.accept(QueryTreeNodeVector.java:159) > at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:619) > at org.apache.derby.impl.sql.compile.FromSubquery.bindExpressions(FromSubquery.java:262) > at org.apache.derby.impl.sql.compile.FromList.bindExpressions(FromList.java:337) > at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:500) > at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java:249) > at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:162) > at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:253) > at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:345) > at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119) > at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517) > at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321) > at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517) > at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370) > at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268) > at org.apache.derby.impl.tools.ij.Main.go(Main.java:204) > at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170) > at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56) > at org.apache.derby.tools.ij.main(ij.java:71) > sysinfo: > ------------------ Java Information ------------------ > Java Version: 1.4.2_12 > Java Vendor: Sun Microsystems Inc. > Java home: C:\jdk142\jre > Java classpath: classes;. > OS name: Windows XP > OS architecture: x86 > OS version: 5.1 > Java user name: yip > Java user home: C:\Documents and Settings\Administrator > Java user dir: C:\derby\trunk > java.specification.name: Java Platform API Specification > java.specification.version: 1.4 > --------- Derby Information -------- > JRE - JDBC: J2SE 1.4.2 - JDBC 3.0 > [C:\derby\trunk\classes] 10.3.0.0 alpha - (1) > ------------------------------------------------------ > ----------------- Locale Information ----------------- > Current Locale : [English/United States [en_US]] > Found support for locale: [de_DE] > version: 10.3.0.0 alpha - (1) > Found support for locale: [es] > version: 10.3.0.0 alpha - (1) > Found support for locale: [fr] > version: 10.3.0.0 alpha - (1) > Found support for locale: [it] > version: 10.3.0.0 alpha - (1) > Found support for locale: [ja_JP] > version: 10.3.0.0 alpha - (1) > Found support for locale: [ko_KR] > version: 10.3.0.0 alpha - (1) > Found support for locale: [pt_BR] > version: 10.3.0.0 alpha - (1) > Found support for locale: [zh_CN] > version: 10.3.0.0 alpha - (1) > Found support for locale: [zh_TW] > version: 10.3.0.0 alpha - (1) > ------------------------------------------------------ -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira