You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2011/03/29 10:29:05 UTC

[jira] [Created] (DERBY-5160) NullPointerException when adding column without specifying type

NullPointerException when adding column without specifying type
---------------------------------------------------------------

                 Key: DERBY-5160
                 URL: https://issues.apache.org/jira/browse/DERBY-5160
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.7.1.1, 10.6.2.1, 10.6.1.0, 10.5.3.0, 10.5.2.0, 10.5.1.1
            Reporter: Knut Anders Hatlen


When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:

ij> create table t(x int);
0 rows inserted/updated/deleted
ij> alter table t add column y;
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
	at org.apache.derby.tools.ij.main(ij.java:59)
	at org.apache.derby.iapi.tools.run.main(run.java:53)
Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
	... 17 more
Caused by: java.lang.NullPointerException
	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas resolved DERBY-5160.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.8.0.0

Thanks, Knut. Tests passed cleanly except for known Heisenbugs. Committed at subversion revision 1087457.

> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Rick Hillegas
>             Fix For: 10.8.0.0
>
>         Attachments: derby-5160-01-aa-needsDatatype.diff
>
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012382#comment-13012382 ] 

Knut Anders Hatlen commented on DERBY-5160:
-------------------------------------------

This is a regression in 10.5.1.1. Earlier releases correctly raised a syntax error:

ij version 10.4
ij> connect 'jdbc:derby:db;create=true';
ij> create table t(x int);
0 rows inserted/updated/deleted
ij> alter table t add column y;
ERROR 42X01: Syntax error: Encountered "" at line 1, column 26.

> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-5160.
-------------------------------------


Verified fix on trunk. Closing.

> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Rick Hillegas
>             Fix For: 10.8.0.0
>
>         Attachments: derby-5160-01-aa-needsDatatype.diff
>
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014204#comment-13014204 ] 

Knut Anders Hatlen commented on DERBY-5160:
-------------------------------------------

Thanks, Rick. The fix looks good to me, and I've verified that it fixes the NPE. +1 to commit if the tests pass.

> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Rick Hillegas
>         Attachments: derby-5160-01-aa-needsDatatype.diff
>
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas reassigned DERBY-5160:
------------------------------------

    Assignee: Rick Hillegas

> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Rick Hillegas
>         Attachments: derby-5160-01-aa-needsDatatype.diff
>
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013952#comment-13013952 ] 

Knut Anders Hatlen commented on DERBY-5160:
-------------------------------------------

The NPE first occurred after this change:

------------------------------------------------------------------------
r714186 | rhillegas | 2008-11-15 00:23:26 +0100 (Sat, 15 Nov 2008) | 1 line

DERBY-3923: Make datatype declaration optional when you specify a generation clause in a CREATE/ALTER TABLE statement.
------------------------------------------------------------------------

> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (DERBY-5160) NullPointerException when adding column without specifying type

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-5160:
---------------------------------

    Attachment: derby-5160-01-aa-needsDatatype.diff

Attaching derby-5160-01-aa-needsDatatype.diff, which fixes this bug. I will run regression tests.

Touches the following files:

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

M      java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java

The fix.

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

M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/AlterTableTest.java

A new test case.


> NullPointerException when adding column without specifying type
> ---------------------------------------------------------------
>
>                 Key: DERBY-5160
>                 URL: https://issues.apache.org/jira/browse/DERBY-5160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Rick Hillegas
>         Attachments: derby-5160-01-aa-needsDatatype.diff
>
>
> When executing ALTER TABLE .. ADD COLUMN without specifying the type of the new column, I see a NullPointerException:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column y;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:616)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
> 	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
> 	at org.apache.derby.tools.ij.main(ij.java:59)
> 	at org.apache.derby.iapi.tools.run.main(run.java:53)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> 	... 17 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(AlterTableNode.java:356)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1101)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:607)
> 	... 10 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira