Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.5.3.0, 10.6.1.0
    • Fix Version/s: 10.5.3.1, 10.6.1.0
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Urgent
    • Bug behavior facts:
      Seen in production

      Description

      A NPE occurs at org.apache.derby.iapi.util.JBitSet.or().

      A NPE occured at the same location before: http://issues.apache.org/jira/browse/DERBY-1574
      The bug was confirmed by Bryan Pendleton to show in the HEAD as well: http://mail-archives.apache.org/mod_mbox/db-derby-user/201002.mbox/%3C4B79F74E.1000005@amberpoint.com%3E

      To reproduce:
      ----------------------

      CREATE TABLE ABC (ID int PRIMARY KEY NOT NULL);
      CREATE TABLE DEF (ID int PRIMARY KEY NOT NULL);

      SELECT *
      FROM ABC t1
      WHERE (SELECT DISTINCT t2.ID FROM DEF t2)
      IN (SELECT t3.ID FROM DEF t3)

      ----------------------

      Leads to

      error message:
      Error: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.NullPointerExceptionXJ001.U
      SQLState: XJ001
      ErrorCode: -1

      Stacktrace:
      java.lang.NullPointerException
      at org.apache.derby.iapi.util.JBitSet.or(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.<init>(Unknown Source)
      at org.apache.derby.impl.sql.compile.Level2OptimizerImpl.<init>(Unknown Source)
      at org.apache.derby.impl.sql.compile.Level2OptimizerFactoryImpl.getOptimizerImpl(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerFactoryImpl.getOptimizer(Unknown Source)
      at org.apache.derby.impl.sql.compile.ResultSetNode.getOptimizer(Unknown Source)
      at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.SubqueryNode.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.SubqueryList.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(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)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<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 org.apache.derby.impl.drda.DRDAStatement.prepare(Unknown Source)
      at org.apache.derby.impl.drda.DRDAStatement.explicitPrepare(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.parsePRPSQLSTT(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
      Cleanup action completed

      1. d4549-1a.diff
        3 kB
        Knut Anders Hatlen
      2. preprocess.diff
        0.7 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Gavin made changes -
          Workflow jira [ 12499103 ] Default workflow, editable Closed status [ 12802736 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Knut Anders Hatlen made changes -
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info [Patch Available]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Issue & fix info [Patch Available]
          Knut Anders Hatlen made changes -
          Attachment d4549-1a.diff [ 12436093 ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Knut Anders Hatlen made changes -
          Assignee Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Attachment preprocess.diff [ 12435972 ]
          Murat Knecht made changes -
          Affects Version/s 10.3.1.4 [ 12312590 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-1574 [ DERBY-1574 ]
          Kristian Waagan made changes -
          Field Original Value New Value
          Affects Version/s 10.6.0.0 [ 12313727 ]
          Murat Knecht created issue -

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Murat Knecht
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development