db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DERBY-6738) NPE when using NULLIF together with LEFT JOIN
Date Mon, 15 Sep 2014 15:15:33 GMT
Knut Anders Hatlen created DERBY-6738:
-----------------------------------------

             Summary: NPE when using NULLIF together with LEFT JOIN
                 Key: DERBY-6738
                 URL: https://issues.apache.org/jira/browse/DERBY-6738
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.11.1.1, 10.10.2.0, 10.9.1.0, 10.8.3.0, 10.7.1.1, 10.6.2.1, 10.5.3.0,
10.4.2.0, 10.3.3.0, 10.2.2.0
            Reporter: Knut Anders Hatlen


If the test case for DERBY-4594 is changed to use NULLIF instead of COALESCE, we get a NullPointerException.

{code:sql}
create table d4594_t1 (a1 int);
create table d4594_t2 (a2 int);
insert into d4594_t1 values 1;
-- this works fine
select 1 from d4594_t1 join d4594_t2 on 1=1 where nullif(a2, 0) <> 1;
-- this fails with NPE
select 1 from d4594_t1 left join d4594_t2 on 1=1 where nullif(a2, 0) <> 1;
{code}

Full stack trace on trunk:

{noformat}
java.lang.NullPointerException
        at org.apache.derby.iapi.types.SQLInteger.equals(SQLInteger.java:414)
        at org.apache.derby.exe.aced8940a7x0148x79ddxe38cx000006b33ad02.e2(Unknown Source)
        at org.apache.derby.impl.services.reflect.DirectCall.invoke(ReflectGeneratedClass.java:105)
        at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(ProjectRestrictResultSet.java:302)
        at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(ProjectRestrictResultSet.java:287)
        at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(BasicNoPutResultSetImpl.java:488)
        at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:448)
        at org.apache.derby.impl.jdbc.EmbedResultSet.next(EmbedResultSet.java:392)
        at org.apache.derby.tools.JDBCDisplayUtil.indent_DisplayResults(JDBCDisplayUtil.java:388)
        at org.apache.derby.tools.JDBCDisplayUtil.indent_DisplayResults(JDBCDisplayUtil.java:344)
        at org.apache.derby.tools.JDBCDisplayUtil.indent_DisplayResults(JDBCDisplayUtil.java:247)
        at org.apache.derby.tools.JDBCDisplayUtil.DisplayResults(JDBCDisplayUtil.java:235)
        at org.apache.derby.impl.tools.ij.utilMain.displayResult(utilMain.java:456)
        at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:530)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:371)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:247)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
        at org.apache.derby.iapi.tools.run.main(run.java:53)
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message