db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drv <drvyv...@uk.ibm.com>
Subject Simple unary operand "is [not] null" bug with VTIs
Date Tue, 17 May 2011 16:10:24 GMT

Hi - I am the lead developer of the Gaian Database which is based on Derby...
The Gaian Database uses the Virtual Table Interface classes to link up Derby
nodes in a network and attach any number and types of data sources off each
node...
http://www.alphaworks.ibm.com/tech/gaiandb

We have come across the following exception when running this query against
sample logical table LT0 using the GaianTable VTI:
"select * from new com.ibm.db2j.GaianTable('LT0') T where misc is not null"

java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001,
SQLERRMC: java.lang.NullPointerException¶¶XJ001.U
        at
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)
        at org.apache.derby.client.am.Connection.prepareStatement(Unknown
Source)
        at
com.ibm.gaiandb.tools.SQLRunner.getPreparedStatement(SQLRunner.java:865)
        at com.ibm.gaiandb.tools.SQLRunner.executeSQL(SQLRunner.java:757)
        at
com.ibm.gaiandb.tools.SQLRunner.executeSQLRepeat(SQLRunner.java:687)
        at
com.ibm.gaiandb.tools.SQLRunner.processSQLLine(SQLRunner.java:667)
        at com.ibm.gaiandb.tools.SQLRunner.processSQLs(SQLRunner.java:611)
        at com.ibm.gaiandb.tools.SQLRunner.processArgs(SQLRunner.java:481)
        at
com.ibm.gaiandb.tools.SQLDerbyRunner.main(SQLDerbyRunner.java:154)
Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error:
SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC:
java.lang.NullPointerException¶¶XJ001.U
        at org.apache.derby.client.am.Statement.completeSqlca(Unknown
Source)
        at
org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown
Source)
        at
org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown
Source)
        at
org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown
Source)
        at
org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown
Source)
        at
org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown
Source)
        at
org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown
Source)
        at
org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown
Source)
        at
org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown
Source)
        at org.apache.derby.client.am.PreparedStatement.prepare(Unknown
Source)
        at org.apache.derby.client.am.Connection.prepareStatementX(Unknown
Source)
        ... 8 more

===============================================

I have also managed to trap the exception on the server-side using our UDP
server driver for Derby:


Caused by: com.ibm.gaiandb.udpdriver.server.UDPDriverServerException:
ThreadWorker createClientState() failed.
	at
com.ibm.gaiandb.udpdriver.server.RunnableWorker.createClientState(RunnableWorker.java:393)
	at
com.ibm.gaiandb.udpdriver.server.RunnableWorker.processQueryRequest(RunnableWorker.java:146)
	... 4 more
Caused by: java.sql.SQLException: Java exception: ':
java.lang.NullPointerException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
	at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
Source)
	at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown
Source)
	at
com.ibm.gaiandb.udpdriver.server.RunnableWorker.createClientState(RunnableWorker.java:385)
	... 5 more
Caused by: java.sql.SQLException: Java exception: ':
java.lang.NullPointerException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
	at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
	... 17 more
Caused by: java.lang.NullPointerException
	at
org.apache.derby.impl.sql.compile.UnaryComparisonOperatorNode.getAbsoluteColumnPosition(Unknown
Source)
	at
org.apache.derby.impl.sql.compile.UnaryComparisonOperatorNode.generateAbsoluteColumnId(Unknown
Source)
	at
org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(Unknown
Source)
	at
org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(Unknown
Source)
	at org.apache.derby.impl.sql.compile.FromVTI.getScanArguments(Unknown
Source)
	at org.apache.derby.impl.sql.compile.FromVTI.generate(Unknown Source)
	at
org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(Unknown
Source)
	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(Unknown
Source)
	at
org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(Unknown
Source)
	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(Unknown
Source)
	at
org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(Unknown
Source)
	at org.apache.derby.impl.sql.compile.CursorNode.generate(Unknown Source)
	at org.apache.derby.impl.sql.compile.StatementNode.generate(Unknown Source)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
	at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
	at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
Source)
	... 10 more
	
===============================================

This behaviour is the same with versions 10.3, 10.4, 10.5 and 10.8

I believe this is a simple bug in method getAbsoluteColumnPosition() of
class org.apache.derby.impl.sql.compile.UnaryComparisonOperatorNode -
probably some object that hasn't been initialised for VTIs...

Any help in fixing this would be much appreciated.

Thanks
David
-- 
View this message in context: http://old.nabble.com/Simple-unary-operand-%22is--not--null%22-bug-with-VTIs-tp31639442p31639442.html
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Mime
View raw message