Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4488

Nullpointer when performing INSERT INTO

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0
    • Fix Version/s: 10.3.3.1, 10.4.2.1, 10.5.3.1, 10.6.1.0
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Regression

      Description

      To replicate, execute the following 4 queries:

      CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))

      INSERT INTO feed VALUES (1, 'fst')

      CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)

      INSERT INTO tbl(col1) SELECT 1 FROM feed

      The result of the last INSERT INTO query is:
      java.lang.NullPointerException
      at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
      at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
      at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
      at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
      at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

        Attachments

        1. setTopResult.diff
          10 kB
          Knut Anders Hatlen
        2. debug info.txt
          5 kB
          Huib
        3. d4488.sql
          0.3 kB
          Knut Anders Hatlen

          Activity

            People

            • Assignee:
              knutanders Knut Anders Hatlen
              Reporter:
              huib Huib
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: