You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kathey Marsden (JIRA)" <ji...@apache.org> on 2008/02/13 23:29:08 UTC

[jira] Updated: (DERBY-3321) NullPointerException for 'NOT EXISTS' with nested subquery

     [ https://issues.apache.org/jira/browse/DERBY-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-3321:
----------------------------------

    Affects Version/s: 10.0.2.1
                       10.1.3.1
                       10.2.2.0

Verified this back to 10.0.2.1 so it's not a regression. Below is the full stack trace.
   (select bb from (select bb from b) p where a.bb=p.bb);
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:88)
        at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1946)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:613)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
        at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:330)
        at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:508)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:353)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:248)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:215)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:181)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
        at org.apache.derby.tools.ij.main(ij.java:59)
Caused by: java.lang.NullPointerException
        at org.apache.derby.impl.sql.compile.FromSubquery.getMatchingColumn(FromSubquery.java:289)
        at org.apache.derby.impl.sql.compile.FromList.bindColumnReference(FromList.java:602)
        at org.apache.derby.impl.sql.compile.ColumnReference.bindExpression(ColumnReference.java:349)
        at org.apache.derby.impl.sql.compile.ResultColumn.bindExpression(ResultColumn.java:552)
        at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(ResultColumnList.java:680)
        at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:445)
        at org.apache.derby.impl.sql.compile.SelectNode.bindTargetExpressions(SelectNode.java:597)
        at org.apache.derby.impl.sql.compile.SubqueryNode.bindExpression(SubqueryNode.java:483)
        at org.apache.derby.impl.sql.compile.UnaryOperatorNode.bindOperand(UnaryOperatorNode.java:333)
        at org.apache.derby.impl.sql.compile.UnaryLogicalOperatorNode.bindExpression(UnaryLogicalOperatorNode.java:74)
        at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:468)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java:227)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:140)
        at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(CursorNode.java:236)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:314)
        at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConne
ctionContext.java:768)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
        ... 9 more


> NullPointerException for 'NOT EXISTS' with nested subquery
> ----------------------------------------------------------
>
>                 Key: DERBY-3321
>                 URL: https://issues.apache.org/jira/browse/DERBY-3321
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.0.2.1, 10.1.3.1, 10.2.2.0, 10.3.2.1, 10.4.0.0
>            Reporter: Jørgen Løland
>            Priority: Minor
>         Attachments: derby.log
>
>
> Queries with 'not exists' followed by a nested subquery results in NPE:
> -----------8<--------------
> connect 'jdbc:derby:testdb;create=true';
> create table a (aa int, bb int);
> -- 0 rows inserted/updated/deleted
> create table b (bb int);
> -- 0 rows inserted/updated/deleted
> insert into a values (1, 1), (1, 2), (2, 2);
> -- 3 rows inserted/updated/deleted
> insert into b values (1);
> -- 1 row inserted/updated/deleted
> select * from a 
>    where not exists 
>    (select bb from b where a.bb=b.bb);
> -- AA         |BB
> -- ----------------------
> -- 1          |2
> -- 2          |2
> select bb from (select bb from b) p;
> -- BB
> -- -----------
> -- 1
> select * from a 
>    where not exists 
>    (select bb from (select bb from b) p where a.bb=p.bb);
> -- ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> ------------>8----------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.