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 "Yip Ng (JIRA)" <ji...@apache.org> on 2007/01/05 23:58:27 UTC

[jira] Commented: (DERBY-2218) Null Pointer Exception when an IN list contains an untyped NULL subquery ("values null").

    [ https://issues.apache.org/jira/browse/DERBY-2218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462632 ] 

Yip Ng commented on DERBY-2218:
-------------------------------

Happens in 10.1.3 too

2007-01-05 22:55:13.328 GMT Thread[main,5,main] (XID = 115), (SESSIONID = 0), (DATABASE = wombat), (DRDAID = null), Cleanup action starting
2007-01-05 22:55:13.328 GMT Thread[main,5,main] (XID = 115), (SESSIONID = 0), (DATABASE = wombat), (DRDAID = null), Failed Statement is: select * from t1 where i in (1,2,(values null))
java.lang.NullPointerException
	at org.apache.derby.impl.sql.compile.SubqueryNode.setDataTypeServices(SubqueryNode.java:2303)
	at org.apache.derby.impl.sql.compile.SubqueryNode.bindExpression(SubqueryNode.java:536)
	at org.apache.derby.impl.sql.compile.ValueNodeList.bindExpression(ValueNodeList.java:137)
	at org.apache.derby.impl.sql.compile.BinaryListOperatorNode.bindExpression(BinaryListOperatorNode.java:164)
	at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:554)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java:247)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:161)
	at org.apache.derby.impl.sql.compile.ReadCursorNode.bind(ReadCursorNode.java:74)
	at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:250)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:332)
	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:513)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:487)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:313)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:433)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:312)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:203)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55)
	at org.apache.derby.tools.ij.main(ij.java:60)
Cleanup action completed



> Null Pointer Exception when an IN list contains an untyped NULL subquery ("values null").
> -----------------------------------------------------------------------------------------
>
>                 Key: DERBY-2218
>                 URL: https://issues.apache.org/jira/browse/DERBY-2218
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.2, 10.2.2.1, 10.2.3.0, 10.3.0.0
>            Reporter: A B
>            Priority: Minor
>
> If a query specifies an IN list that contains a subquery which returns an untyped NULL value, Derby will throw an NPE at bind time.
> ij> create table t1 (i int);
> 0 rows inserted/updated/deleted
> ij> select * from t1 where i in (1, 2, (values null));
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> I verified the error against the latest 10.2 and 10.3 trunks; it could very well exist in earlier versions, too, but I haven't checked.
> Stack trace (from 10.2.2) is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.SubqueryNode.setDataTypeServices(SubqueryNode.java:2289)
> 	at org.apache.derby.impl.sql.compile.SubqueryNode.bindExpression(SubqueryNode.java:529)
> 	at org.apache.derby.impl.sql.compile.ValueNodeList.bindExpression(ValueNodeList.java:130)
> 	at org.apache.derby.impl.sql.compile.BinaryListOperatorNode.bindExpression(BinaryListOperatorNode.java:161)
> 	at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:540)
> 	at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java:249)
> 	at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:162)
> 	at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:253)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:345)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira