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

NullPointerException in generated VTI code

    XMLWordPrintableJSON

Details

    • Normal
    • Patch Available, Release Note Needed, Repro attached
    • Crash

    Description

      With the latest 10.8.2.2 binary distribution, the following short script produces a NullPointerException:

      java -Dij.exceptionTrace=true org.apache.derby.tools.ij
      ij> connect 'jdbc:derby:brydb;create=true';
      ij> create table t1 (a int);
      ij> SELECT T2., systabs., syscgs.conglomeratenumber
      FROM
      SYS.SYSTABLES systabs, sys.sysconglomerates syscgs,
      TABLE (SYSCS_DIAG.SPACE_TABLE(systabs.tablename)) AS T2
      WHERE systabs.tabletype = 'T' and systabs.tableid = syscgs.tableid;

      The exception trace is pasted below:

      ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
      java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
      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.seeNextException(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.executeStatement(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.Main.main(Unknown Source)
      at org.apache.derby.tools.ij.main(Unknown Source)
      Caused by: java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
      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.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)
      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)
      ... 15 more
      Caused by: java.lang.NullPointerException
      at org.apache.derby.exe.acf81e0010x0134x6972x0511x0000033820000.g0(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
      at org.apache.derby.impl.sql.execute.VTIResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openRight(Unknown Source)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
      ... 11 more
      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.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.executeStatement(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.Main.main(Unknown Source)
      at org.apache.derby.tools.ij.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)
      ... 19 more
      Caused by: java.lang.NullPointerException
      at org.apache.derby.exe.acf81e0010x0134x6972x0511x0000033820000.g0(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
      at org.apache.derby.impl.sql.execute.VTIResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openRight(Unknown Source)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
      ... 11 more

      Attachments

        1. derby-5554-04-ac-remapVTIarg.diff
          5 kB
          Richard N. Hillegas
        2. derby-5554-04-ab-remapVTIarg.diff
          6 kB
          Richard N. Hillegas
        3. derby-5554-04-aa-forceVTIAfterJoin.diff
          4 kB
          Richard N. Hillegas
        4. releaseNote.html
          2 kB
          Richard N. Hillegas
        5. releaseNote.html
          2 kB
          Richard N. Hillegas
        6. derby-5554-03-aa-forbidVTItoVTIjoins.diff
          2 kB
          Richard N. Hillegas
        7. derby-5554-02-aa-0argConstructor.diff
          16 kB
          Richard N. Hillegas
        8. derby-5554-01-ab-addTableIDcolumn.diff
          10 kB
          Richard N. Hillegas
        9. derby-5554-01-aa-addTableIDcolumn.diff
          11 kB
          Richard N. Hillegas

        Issue Links

          Activity

            People

              rhillegas Richard N. Hillegas
              bryanpendleton Bryan Pendleton
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: