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

NullPointerException on INSERT after ALTER TABLE ... DROP COLUMN

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.1.4, 10.4.1.3
    • 10.3.2.1, 10.4.1.3
    • SQL
    • None

    Description

      ij version 10.3
      ij> connect 'jdbc:derby:bugdb;create=true';
      ij> create table t (
      x varchar(12),
      y varchar(12),
      id int primary key generated by default as identity
      );
      0 rows inserted/updated/deleted
      ij> alter table t drop column y;
      0 rows inserted/updated/deleted
      ij> insert into t values 'a';
      ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
      java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
      at org.apache.derby.tools.ij.main(Unknown Source)
      at org.apache.derby.iapi.tools.run.main(Unknown Source)
      Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      ... 18 more
      Caused by: java.lang.NullPointerException
      at org.apache.derby.impl.sql.compile.ResultColumn.columnTypeAndLengthMatch(Unknown Source)
      at org.apache.derby.impl.sql.compile.ResultColumnList.columnTypesAndLengthsMatch(Unknown Source)
      at org.apache.derby.impl.sql.compile.InsertNode.bindStatement(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)
      ... 11 more

      Attachments

        1. bug.sql
          0.2 kB
          Knut Anders Hatlen
        2. d3175_codeChangeOnly.diff
          2 kB
          Bryan Pendleton
        3. fixWithTest.diff
          4 kB
          Bryan Pendleton
        4. fixWith3177Case.diff
          26 kB
          Bryan Pendleton
        5. preserveAutoincValue.diff
          36 kB
          Bryan Pendleton
        6. preserveFixWithComments.diff
          38 kB
          Bryan Pendleton
        7. merge10_3.diff
          38 kB
          Bryan Pendleton

        Issue Links

          Activity

            People

              bryanpendleton Bryan Pendleton
              knutanders Knut Anders Hatlen
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: