Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 28432 invoked from network); 25 Mar 2008 09:21:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Mar 2008 09:21:31 -0000 Received: (qmail 36916 invoked by uid 500); 25 Mar 2008 09:21:29 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 36885 invoked by uid 500); 25 Mar 2008 09:21:29 -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 36875 invoked by uid 99); 25 Mar 2008 09:21:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Mar 2008 02:21:29 -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, 25 Mar 2008 09:20:58 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B8B02234C0AC for ; Tue, 25 Mar 2008 02:19:25 -0700 (PDT) Message-ID: <2003437462.1206436765755.JavaMail.jira@brutus> Date: Tue, 25 Mar 2008 02:19:25 -0700 (PDT) From: "Thomas Nielsen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3538) NullPointerException during execution for query with LEFT OUTER JOIN whose inner table selects all constants. In-Reply-To: <1591152449.1205472444391.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-3538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581842#action_12581842 ] Thomas Nielsen commented on DERBY-3538: --------------------------------------- Sorry for the very late reply. Just for the record I saw no problems with the patch applied. > NullPointerException during execution for query with LEFT OUTER JOIN whose inner table selects all constants. > ------------------------------------------------------------------------------------------------------------- > > Key: DERBY-3538 > URL: https://issues.apache.org/jira/browse/DERBY-3538 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1 > Reporter: A B > Assignee: A B > Priority: Minor > Fix For: 10.1.3.2, 10.2.2.1, 10.3.2.2, 10.4.1.0, 10.5.0.0 > > Attachments: d3538_notTested.diff, derby-3538_diff.txt > > > For a query having a LEFT OUTER JOIN such that the right, or "inner", table is a SELECT subquery whose result column list consists entirely of constants, Derby may throw an execution-time NPE while trying to apply the join predicate. I say "may" because it depends on which join strategy the optimizer chooses. > Using optimizer overrides I was able to reproduce this problem against trunk with the following (admittedly nonsense) query: > create table t1 (i int, j int); > insert into t1 values (-1, -2), (-2, -4), (-3, -9); > select * from > t1 left outer join > (select -1 a, 1 b from t1) x0 --DERBY-PROPERTIES joinStrategy=NESTEDLOOP > on x0.a = t1.i; > I |J |A |B > ----------------------------------------------- > -1 |-2 |-1 |1 > -1 |-2 |-1 |1 > -1 |-2 |-1 |1 > ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > Running the same query also failed with the same NPE on 10.0.2.1, even though optimizer overrides don't exist there. So I'm marking all known releases to be affected by this issue. > Note: while this particular query may not make much sense, I have seen a user with a very large, auto-generated query that, when executed, fails due to this problem. So it is worth investigating... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.