Derby
  1. Derby
  2. DERBY-4435

Emptying index fails with NPE doing replacement import of empty file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0
    • Fix Version/s: 10.4.2.1, 10.5.3.1, 10.6.1.0
    • Component/s: Store
    • Labels:
      None
    • Environment:
      Doing replacement import resulting in an empty table, where the table has at least one index.
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Crash, Regression, Seen in production

      Description

      When importing data from an empty file, with the replacement option enabled (non-zero last argument in the import procedure call), Derby fails with a NullPointerException when emptying the index(es) .

      Stack trace, insane build:
      java.sql.SQLException: Import error on line 1 of file [snip]: Java exception: ': java.lang.NullPointerException'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
      ...
      Caused by: java.lang.NullPointerException
      at org.apache.derby.impl.sql.execute.InsertResultSet.emptyIndexes(InsertResultSet.java:2348)
      at org.apache.derby.impl.sql.execute.InsertResultSet.updateAllIndexes(InsertResultSet.java:1820)
      at org.apache.derby.impl.sql.execute.InsertResultSet.bulkInsertCore(InsertResultSet.java:1356)
      at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:444)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1235)
      ... 44 more

      Stack trace, sane build:
      java.sql.SQLException: The exception 'java.sql.SQLException: An internal error was identified by RawStore module.' was thrown while evaluating an expression.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
      ...
      Caused by: ERROR 40XT0: An internal error was identified by RawStore module.
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276)
      at org.apache.derby.impl.store.raw.xact.Xact.abort(Xact.java:917)
      at org.apache.derby.impl.store.access.RAMTransaction.abort(RAMTransaction.java:1985)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doRollback(GenericLanguageConnectionContext.java:1496)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userRollback(GenericLanguageConnectionContext.java:1404)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.rollback(TransactionResourceImpl.java:244)
      at org.apache.derby.impl.jdbc.EmbedConnection.rollback(EmbedConnection.java:1764)
      ... 40 more

      A quick investigation suggests DERBY-2537 added the code that fails.

      Problem reported by a user on the Derby user list, see http://thread.gmane.org/gmane.comp.apache.db.derby.user/11764

      1. Derby4435Repro.java
        3 kB
        Kristian Waagan

        Activity

        Gavin made changes -
        Workflow jira [ 12481282 ] Default workflow, editable Closed status [ 12801056 ]
        Knut Anders Hatlen made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Brett Wooldridge made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Kristian Waagan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Kristian Waagan made changes -
        Affects Version/s 10.6.0.0 [ 12313727 ]
        Kristian Waagan made changes -
        Fix Version/s 10.4.2.1 [ 12313401 ]
        Fix Version/s 10.5.3.1 [ 12314182 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Mamta A. Satoor made changes -
        Fix Version/s 10.6.0.0 [ 12313727 ]
        Mamta A. Satoor made changes -
        Assignee Mamta A. Satoor [ mamtas ]
        Kristian Waagan made changes -
        Bug behavior facts [Seen in production, Crash] [Crash, Regression, Seen in production]
        Affects Version/s 10.5.3.0 [ 12314117 ]
        Affects Version/s 10.4.2.0 [ 12313345 ]
        Affects Version/s 10.3.3.0 [ 12313142 ]
        Issue & fix info [Repro attached]
        Kristian Waagan made changes -
        Field Original Value New Value
        Attachment Derby4435Repro.java [ 12424120 ]
        Kristian Waagan created issue -

          People

          • Assignee:
            Mamta A. Satoor
            Reporter:
            Kristian Waagan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development