Derby
  1. Derby
  2. DERBY-1528

Preparing "INSERT INTO table SELECT FROM (...)" may cause NullPointerException and subsequent internal errors reported by RawStore module

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1.3.1
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Normal
    • Issue & fix info:
      High Value Fix, Repro attached, Workaround attached

      Description

      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 from (values) as v';
      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.

      1. repro1528_assert.java
        1 kB
        Knut Anders Hatlen
      2. repro1528_npe.java
        1 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Attaching a repro which causes an AssertFailure when running in sane mode (NullPointerException otherwise). This is what it prints:

        preparing: insert into t select * from (values ?) v

        org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Type is null for column exposedName: SQLCol1
        name: SQLCol1
        tableName: V
        isNameGenerated: true
        sourceTableName: null
        type: null
        columnDescriptor: null
        isGenerated: false
        isGeneratedForUnmatchedColumnInInsert: false
        isGroupingColumn: false
        isReferenced: false
        isRedundant: false
        virtualColumnId: 1
        resultSetNumber: -1
        dataTypeServices: null
        clause: 1

        at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:119)
        at org.apache.derby.impl.sql.compile.ResultColumn.columnTypeAndLengthMatch(ResultColumn.java:1027)
        at org.apache.derby.impl.sql.compile.ResultColumnList.columnTypesAndLengthsMatch(ResultColumnList.java:1599)
        at org.apache.derby.impl.sql.compile.InsertNode.bind(InsertNode.java:449)
        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_assert.main(repro1528_assert.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_assert.main(repro1528_assert.java:27)

        Show
        Knut Anders Hatlen added a comment - Attaching a repro which causes an AssertFailure when running in sane mode (NullPointerException otherwise). This is what it prints: preparing: insert into t select * from (values ?) v org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Type is null for column exposedName: SQLCol1 name: SQLCol1 tableName: V isNameGenerated: true sourceTableName: null type: null columnDescriptor: null isGenerated: false isGeneratedForUnmatchedColumnInInsert: false isGroupingColumn: false isReferenced: false isRedundant: false virtualColumnId: 1 resultSetNumber: -1 dataTypeServices: null clause: 1 at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:119) at org.apache.derby.impl.sql.compile.ResultColumn.columnTypeAndLengthMatch(ResultColumn.java:1027) at org.apache.derby.impl.sql.compile.ResultColumnList.columnTypesAndLengthsMatch(ResultColumnList.java:1599) at org.apache.derby.impl.sql.compile.InsertNode.bind(InsertNode.java:449) 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_assert.main(repro1528_assert.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_assert.main(repro1528_assert.java:27)
        Hide
        Knut Anders Hatlen added a comment -

        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 from (values ?) v

        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)

        Show
        Knut Anders Hatlen added a comment - 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 from (values ?) v 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)
        Hide
        Knut Anders Hatlen added a comment -

        Triaged for 10.5.2.

        Show
        Knut Anders Hatlen added a comment - Triaged for 10.5.2.
        Hide
        Dag H. Wanvik added a comment -

        Does Derby attempt to propagate type information down into subqueries?

        Show
        Dag H. Wanvik added a comment - Does Derby attempt to propagate type information down into subqueries?
        Hide
        Knut Anders Hatlen added a comment -

        Probably not, but I don't know.

        It might be that the SQL standard doesn't allow the query, but it should at least not raise a NullPointerException.

        For the record, PostgreSQL accepts the following statement without a cast:

        insert into t select x, length from (values) as v

        MySQL does not accept it, but then it doesn't allow any VALUES sub-queries, parameterized or not. It does allow a parameter without an explicit cast with its own corresponding (non-standard) syntax, though:

        insert into t select x, length from (select ? as x) v

        Show
        Knut Anders Hatlen added a comment - Probably not, but I don't know. It might be that the SQL standard doesn't allow the query, but it should at least not raise a NullPointerException. For the record, PostgreSQL accepts the following statement without a cast: insert into t select x, length from (values ) as v MySQL does not accept it, but then it doesn't allow any VALUES sub-queries, parameterized or not. It does allow a parameter without an explicit cast with its own corresponding (non-standard) syntax, though: insert into t select x, length from (select ? as x) v
        Hide
        Knut Anders Hatlen added a comment -

        Checked "Workaround attached" since the statement works if the parameter is wrapped in a cast.

        Show
        Knut Anders Hatlen added a comment - Checked "Workaround attached" since the statement works if the parameter is wrapped in a cast.
        Hide
        Knut Anders Hatlen added a comment -

        Back to the question about whether Derby attempts to propagate type information down into subqueries, it looks as if it might be doing so. For instance, this query works fine:

        ij> create table t(x int);
        0 rows inserted/updated/deleted
        ij> insert into t select * from (values null) v;
        1 row inserted/updated/deleted

        If type information hadn't been propagated into the subquery, I'd expect the untyped null to cause some kind of error.

        Show
        Knut Anders Hatlen added a comment - Back to the question about whether Derby attempts to propagate type information down into subqueries, it looks as if it might be doing so. For instance, this query works fine: ij> create table t(x int); 0 rows inserted/updated/deleted ij> insert into t select * from (values null) v ; 1 row inserted/updated/deleted If type information hadn't been propagated into the subquery, I'd expect the untyped null to cause some kind of error.
        Hide
        Dag H. Wanvik added a comment -

        I think the null here should give an error according to the standard..

        Show
        Dag H. Wanvik added a comment - I think the null here should give an error according to the standard..
        Hide
        Kathey Marsden added a comment -

        On trunk (10.11) repro1528_assert.java gives an NPE rather than an assert:
        Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:42)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:
        5)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
        ... 11 more
        Caused by: java.lang.NullPointerException
        at org.apache.derby.impl.sql.compile.BaseTypeCompiler.numberStorable(BaseTypeCompiler.java:305)
        at org.apache.derby.impl.sql.compile.NumericTypeCompiler.numberStorable(NumericTypeCompiler.java:53)
        at org.apache.derby.impl.sql.compile.NumericTypeCompiler.storable(NumericTypeCompiler.java:326)

        repro1528_npe gives the same NPE

        at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:1017)
        at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:1009)
        at org.apache.derby.impl.sql.compile.ResultColumnList.checkStorableExpressions(ResultColumnList.java:1083)
        at org.apache.derby.impl.sql.compile.InsertNode.bindStatement(InsertNode.java:459)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:403)
        at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:100)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageCon
        ctionContext.java:1107)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:133)
        ... 4 more

        ----------

        executing: select * from t

        java.sql.SQLNonTransientConnectionException: No current connection.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:77)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:146)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:162)
        at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Util.java:331)
        at org.apache.derby.impl.jdbc.EmbedStatement.checkExecStatus(EmbedStatement.java:1541)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:675)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:640)
        at repro1528_assert.main(repro1528_assert.java:27)
        Caused by: java.sql.SQLException: No current connection.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:42)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:
        5)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)

        Show
        Kathey Marsden added a comment - On trunk (10.11) repro1528_assert.java gives an NPE rather than an assert: Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:42) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java: 5) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71) ... 11 more Caused by: java.lang.NullPointerException at org.apache.derby.impl.sql.compile.BaseTypeCompiler.numberStorable(BaseTypeCompiler.java:305) at org.apache.derby.impl.sql.compile.NumericTypeCompiler.numberStorable(NumericTypeCompiler.java:53) at org.apache.derby.impl.sql.compile.NumericTypeCompiler.storable(NumericTypeCompiler.java:326) repro1528_npe gives the same NPE at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:1017) at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:1009) at org.apache.derby.impl.sql.compile.ResultColumnList.checkStorableExpressions(ResultColumnList.java:1083) at org.apache.derby.impl.sql.compile.InsertNode.bindStatement(InsertNode.java:459) at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:403) at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:100) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageCon ctionContext.java:1107) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:133) ... 4 more ---------- executing: select * from t java.sql.SQLNonTransientConnectionException: No current connection. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:77) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:146) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:162) at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Util.java:331) at org.apache.derby.impl.jdbc.EmbedStatement.checkExecStatus(EmbedStatement.java:1541) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:675) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:640) at repro1528_assert.main(repro1528_assert.java:27) Caused by: java.sql.SQLException: No current connection. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:42) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java: 5) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)

          People

          • Assignee:
            Unassigned
            Reporter:
            Knut Anders Hatlen
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development