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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/05/21 16:28:16 UTC

[jira] Updated: (DERBY-4672) NullPointerException in insert from nested select with parameter

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

Knut Anders Hatlen updated DERBY-4672:
--------------------------------------

    Attachment: repro.sql

Attaching repro script for the bug.

$ java -jar derbyrun.jar ij repro.sql
ij version 10.7
ij> connect 'jdbc:derby:db;create=true';
ij> create table t(x int);
0 rows inserted/updated/deleted
ij> prepare ps as 'insert into t select x from (select ? from t) s(x)';
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.


> NullPointerException in insert from nested select with parameter
> ----------------------------------------------------------------
>
>                 Key: DERBY-4672
>                 URL: https://issues.apache.org/jira/browse/DERBY-4672
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0, 10.4.1.3, 10.5.3.0, 10.6.1.0, 10.7.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: repro.sql
>
>
> Compilation of this statement fails with a NullPointerException:
>     insert into t select x from (select ? from t) s(x)
> It should fail, but not with a NullPointerException. The expected error is:
> ERROR 42X34: There is a ? parameter in the select list.  This is not allowed.
> I found this issue when testing the fix for DERBY-4671. It is not the same issue, since DERBY-4671 was a regression in 10.6.1, and this issue has been there for a long time (I've only tested back to 10.2.2.0, but it may have existed even before that).
> java.lang.NullPointerException
>         at org.apache.derby.impl.sql.compile.BaseTypeCompiler.numberStorable(BaseTypeCompiler.java:316)
>         at org.apache.derby.impl.sql.compile.NumericTypeCompiler.storable(NumericTypeCompiler.java:329)
>         at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:887)
>         at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:879)
>         at org.apache.derby.impl.sql.compile.ResultColumnList.checkStorableExpressions(ResultColumnList.java:953)
>         at org.apache.derby.impl.sql.compile.InsertNode.bindStatement(InsertNode.java:456)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:130)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java:63)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(EmbedPreparedStatement40.java:40)
>         at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Driver40.java:105)
>         at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1607)
>         at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1435)

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