Derby
  1. Derby
  2. DERBY-5614

NullPointerException with INSERT INTO [global temporary table] SELECT ... FROM [VTI]

    Details

    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Crash

      Description

      Inserting into a global temporary table (GTT) while selecting data from a VTI fails with a NullPointerException:

      Caused by: java.lang.NullPointerException
      at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.getEmptyHeapRow(WriteCursorConstantAction.java:324)
      at org.apache.derby.impl.sql.execute.InsertResultSet.bulkInsertCore(InsertResultSet.java:1209)
      at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:466)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:443)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:324)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
      ... 6 more

      Investigation exposed the fact that bulk insert doesn't support a GTT as the target, and further that Derby enables bulk insert when the source is a VTI.

      1. derby-5614-1a-disable_bulkinsert_gtt.diff
        0.9 kB
        Kristian Waagan
      2. derby-5614-1b-disable_bulkinsert_gtt.diff
        16 kB
        Kristian Waagan
      3. repro.sql
        1 kB
        Dag H. Wanvik

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Kristian Waagan
              Reporter:
              Kristian Waagan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development