Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 68169 invoked from network); 19 Dec 2007 17:07:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Dec 2007 17:07:07 -0000 Received: (qmail 50797 invoked by uid 500); 19 Dec 2007 17:06:56 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 50582 invoked by uid 500); 19 Dec 2007 17:06:56 -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 50573 invoked by uid 99); 19 Dec 2007 17:06:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2007 09:06:55 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Wed, 19 Dec 2007 17:06:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0A584714211 for ; Wed, 19 Dec 2007 09:06:43 -0800 (PST) Message-ID: <24278298.1198084003032.JavaMail.jira@brutus> Date: Wed, 19 Dec 2007 09:06:43 -0800 (PST) From: "A B (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Resolved: (DERBY-3253) NullPointer Exception (NPE) from query with IN predicate containing two values and joining a view with a large table. ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. In-Reply-To: <19743332.1196821182998.JavaMail.jira@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 [ https://issues.apache.org/jira/browse/DERBY-3253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] A B resolved DERBY-3253. ------------------------ Resolution: Fixed Fix Version/s: 10.4.0.0 Committed d3253_v3.patch with svn #605616: URL: http://svn.apache.org/viewvc?rev=605616&view=rev Many thanks (again) to Bryan for the review and discussion--I appreciate your time! I ran the svn merge command to port this back to 10.3 and it merged with no errors: svn merge -r 605615:605616 https://svn.apache.org/repos/asf/db/derby/code/trunk I'll kick off the 10.3 regression tests today. If they pass and if no issues arise in trunk for the new couple of days, I plan to commit to 10.3 by the end of the week... > NullPointer Exception (NPE) from query with IN predicate containing two values and joining a view with a large table. ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-3253 > URL: https://issues.apache.org/jira/browse/DERBY-3253 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.3.1.4, 10.4.0.0 > Reporter: Stan Bradbury > Assignee: A B > Fix For: 10.4.0.0 > > Attachments: 3253ReproDB.zip, d3253_v1.patch, d3253_v2_incomplete.patch, d3253_v3.patch > > > With a single value in the IN clause the query does not fail. > > Run the following query in the attached database (v 10.3 db). > SELECT A.TIMESTAMP, B.F_NAMEADDR, B.TOTAL_F, > B.TOTAL_FS, B.TOTAL_FT, B.TOTAL_FX > FROM TIME A, THE_VIEW B > WHERE B.T_ID = A.T_ID AND B.F_NAMEADDR IN ('one.two.three.oscar','one.two.three.kathy') > ORDER BY A.TIMESTAMP ASC; > > result > ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > Stack trace: > Failed Statement is: SELECT A.TIMESTAMP, B.F_NAMEADDR, B.TOTAL_F, > B.TOTAL_FS, B.TOTAL_FT, B.TOTAL_FX > FROM TIME A, THE_VIEW B > WHERE B.T_ID = A.T_ID AND B.F_NAMEADDR IN ('one.two.three.oscar','one.two.three.kathy') > ORDER BY A.TIMESTAMP ASC > ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. > at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) > at org.apache.derby.iapi.error.StandardException.unexpectedUserException(Unknown Source) > at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source) > at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source) > at org.apache.derby.impl.sql.execute.NestedLoopJoinResultSet.getNextRowCore(Unknown Source) > at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.getRowFromResultSet(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.getNextRowFromRS(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown Source) > at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source) > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) > at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source) > at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source) > at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source) > at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source) > at org.apache.derby.impl.tools.ij.Main.go(Unknown Source) > at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source) > at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source) > at org.apache.derby.tools.ij.main(Unknown Source) > Caused by: java.lang.NullPointerException > at org.apache.derby.exe.ac601a400fx0116xa813xc2f7x00000010a3602.e8(Unknown Source) > ... 21 more > ============= begin nested exception, level (1) =========== > java.lang.NullPointerException > at org.apache.derby.exe.ac601a400fx0116xa813xc2f7x00000010a3602.e8(Unknown Source) > at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source) > at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source) > at org.apache.derby.impl.sql.execute.NestedLoopJoinResultSet.getNextRowCore(Unknown Source) > at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.getRowFromResultSet(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.getNextRowFromRS(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(Unknown Source) > at org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown Source) > at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source) > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) > at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source) > at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source) > at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source) > at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source) > at org.apache.derby.impl.tools.ij.Main.go(Unknown Source) > at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source) > at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source) > at org.apache.derby.tools.ij.main(Unknown Source) > ============= end nested exception, level (1) =========== > Schema info: > CREATE TABLE TIME ("T_ID" BIGINT NOT NULL, "TIMESTAMP" TIMESTAMP NOT NULL, "DAY" INTEGER NOT NULL, "WEEK" INTEGER NOT NULL, "MONTH" INTEGER NOT NULL, "YEAR_COL" INTEGER NOT NULL); > CREATE TABLE F ("F_ID" BIGINT NOT NULL, "T_ID" BIGINT NOT NULL, "F_NAMEADDR" VARCHAR(250) NOT NULL, "TOTAL_F" BIGINT NOT NULL, "TOTAL_FS" BIGINT NOT NULL, "TOTAL_FT" BIGINT NOT NULL, "TOTAL_FX" BIGINT NOT NULL); > CREATE VIEW the_view AS SELECT T.T_ID AS T_ID , T.F_NAMEADDR AS F_NAMEADDR, > T.TOTAL_F AS TOTAL_F, T.TOTAL_FS AS TOTAL_FS, T.TOTAL_FT AS TOTAL_FT , T.TOTAL_FX AS TOTAL_FX > FROM F AS T > WHERE T.T_ID = (SELECT MAX(T_ID) FROM F); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.