db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1528) Preparing "SELECT INTO table SELECT FROM (...)" may cause NullPointerException and subsequent internal errors reported by RawStore module
Date Tue, 18 Jul 2006 11:28:14 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1528?page=all ]

Knut Anders Hatlen updated DERBY-1528:
--------------------------------------

    Attachment: repro1528_npe.java

Another repro. This one causes a NullPointerException in sane mode as well as in insane mode.
Output from the test is included below.

preparing: insert into t select x, length(x) from (values ?) v(x)

java.lang.NullPointerException
	at org.apache.derby.impl.sql.compile.UnaryOperatorNode.bindUnaryOperator(UnaryOperatorNode.java:350)
	at org.apache.derby.impl.sql.compile.UnaryOperatorNode.bindExpression(UnaryOperatorNode.java:316)
	at org.apache.derby.impl.sql.compile.DB2LengthOperatorNode.bindExpression(DB2LengthOperatorNode.java:84)
	at org.apache.derby.impl.sql.compile.ResultColumn.bindExpression(ResultColumn.java:579)
	at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(ResultColumnList.java:558)
	at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:526)
	at org.apache.derby.impl.sql.compile.SelectNode.bindExpressionsWithTables(SelectNode.java:655)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressionsWithTables(DMLStatementNode.java:272)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.bindResultSetsWithTables(DMLStatementNode.java:196)
	at org.apache.derby.impl.sql.compile.InsertNode.bind(InsertNode.java:242)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:344)
	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:118)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:713)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:128)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java:62)
	at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java:92)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:712)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:556)
	at repro1528_npe.main(repro1528_npe.java:18)

----------

executing: select * from t

ERROR 40XT0: An internal error was identified by RawStore module.
	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:294)
	at org.apache.derby.impl.store.raw.xact.Xact.setActiveState(Xact.java:1772)
	at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Xact.java:1271)
	at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(OpenConglomerate.java:865)
	at org.apache.derby.impl.store.access.heap.Heap.open(Heap.java:614)
	at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(RAMTransaction.java:478)
	at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(RAMTransaction.java:1315)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex(DataDictionaryImpl.java:7339)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(DataDictionaryImpl.java:1532)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(DataDictionaryImpl.java:1442)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.getSchemaDescriptor(QueryTreeNode.java:1504)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.getSchemaDescriptor(QueryTreeNode.java:1456)
	at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(FromBaseTable.java:2379)
	at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(FromBaseTable.java:2107)
	at org.apache.derby.impl.sql.compile.FromList.bindTables(FromList.java:300)
	at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(SelectNode.java:472)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(DMLStatementNode.java:220)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:158)
	at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:252)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:344)
	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:118)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:713)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:567)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:516)
	at repro1528_npe.main(repro1528_npe.java:27)

> Preparing "SELECT INTO table SELECT FROM (...)" may cause NullPointerException and subsequent
internal errors reported by RawStore module
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1528
>                 URL: http://issues.apache.org/jira/browse/DERBY-1528
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.1
>            Reporter: Knut Anders Hatlen
>         Attachments: repro1528_assert.java, repro1528_npe.java
>
>
> When preparing a "INSERT INTO table SELECT FROM (...)" statement,
> Derby in some cases throw a NullPointerException or an
> AssertFailure. This happens when a '?' occurs in a VALUES statement in
> the from list. If one tries to access the table after the
> NullPointerException, this exception is thrown:
> ERROR 40XT0: An internal error was identified by RawStore module.
> Example:
> ij> create table t (text varchar(20), len int);
> 0 rows inserted/updated/deleted
> ij> prepare p as 'insert into t select x, length(x) from (values(?)) as v(x)';
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> ij> select * from t;
> ERROR 40XT0: An internal error was identified by RawStore module.
> Replacing '?' with 'CAST (? AS VARCHAR(20))' fixes the problem, but
> there is enough information in the query to determine the type of the
> parameter even without the cast.

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

        

Mime
View raw message