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 "QingpingXu (JIRA)" <ji...@apache.org> on 2008/01/25 04:42:36 UTC

[jira] Created: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

truncateTable crashed, Caused by: java.lang.NullPointerException
----------------------------------------------------------------

                 Key: DERBY-3352
                 URL: https://issues.apache.org/jira/browse/DERBY-3352
             Project: Derby
          Issue Type: Bug
          Components: Services
    Affects Versions: 10.3.2.1, 10.3.1.4
         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
            Reporter: QingpingXu
            Priority: Critical
             Fix For: 10.0.2.2


Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。

here's the example source code and stack trace:

Src:
        public static void main(String[] args)
	{
		
		try
		{
			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
			
			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
			
			Statement stat = conn.createStatement();
			stat.executeUpdate("create table m (uri varchar(256),f int)");
			stat.executeUpdate("create index aa on m (uri)");
			stat.executeUpdate("truncate table m");
			
			System.out.println("Truncate table m successfully!");
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
Error:

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.Util.newEmbedSQLException(Util.java:88)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
	at update.UpdateURI.main(UpdateURI.java:34)
Caused by: java.lang.NullPointerException
	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Dyre Tjeldvoll updated DERBY-3352:
----------------------------------

    Attachment: derby-3352.diff

I think the problem seen in debug mode is caused by the 'AlterTableConstantAction.collation' array not being initialized. I've attached a patch (derby-3352.diff) which initializes 'collation' along with 'ordering' which appears to be used in a similar way in truncateTable. With this change the repro runs without an NPE. All tests pass.

I guess one could make the argument that truncate table should be disabled in debug mode as well, but I have not looked into that.

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>         Attachments: derby-3352.diff
>
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Knut Anders Hatlen updated DERBY-3352:
--------------------------------------

    Fix Version/s:     (was: 10.0.2.2)

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

Posted by Mike Matrigali <mi...@sbcglobal.net>.
I didn't think truncate table was supported so didn't look at that code,
I can delete the dead code, and if anyone wants it, it is always in
svn.  I didn't see any tests for the code, and the supporte version
throws a not supported exception.

Knut Anders Hatlen (JIRA) wrote:
>      [ https://issues.apache.org/jira/browse/DERBY-3352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Knut Anders Hatlen updated DERBY-3352:
> --------------------------------------
> 
>     Derby Info: [Regression]
> 
> The NullPointerException seems to have been introduced in this commit:
> 
> ------------------------------------------------------------------------
> r528033 | mikem | 2007-04-12 18:58:30 +0200 (Thu, 12 Apr 2007) | 6 lines
> 
> DERBY-2537, 1st incremental checking for this issue.  This changes builds
> the framework for storing/retrieving the collation metadata in store and for
> passing that info down from language into store.  Some paths still have
> default collation hard coded and have been marked TODO-COLLATION.
> 
> 
> ------------------------------------------------------------------------
> 
>> truncateTable crashed, Caused by: java.lang.NullPointerException
>> ----------------------------------------------------------------
>>
>>                 Key: DERBY-3352
>>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>>             Project: Derby
>>          Issue Type: Bug
>>          Components: Services
>>    Affects Versions: 10.3.1.4, 10.3.2.1
>>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>>            Reporter: QingpingXu
>>            Priority: Critical
>>
>> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
>> here's the example source code and stack trace:
>> Src:
>>         public static void main(String[] args)
>> 	{
>> 		
>> 		try
>> 		{
>> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
>> 			
>> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
>> 			
>> 			Statement stat = conn.createStatement();
>> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
>> 			stat.executeUpdate("create index aa on m (uri)");
>> 			stat.executeUpdate("truncate table m");
>> 			
>> 			System.out.println("Truncate table m successfully!");
>> 		}
>> 		catch (Exception ex)
>> 		{
>> 			ex.printStackTrace();
>> 		}
>> 	}
>> Error:
>> 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.Util.newEmbedSQLException(Util.java:88)
>> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
>> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
>> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
>> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
>> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
>> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
>> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
>> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
>> 	at update.UpdateURI.main(UpdateURI.java:34)
>> Caused by: java.lang.NullPointerException
>> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
>> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
>> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
>> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
>> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
>> 	... 3 more
> 


[jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Knut Anders Hatlen updated DERBY-3352:
--------------------------------------

    Derby Info: [Regression]

The NullPointerException seems to have been introduced in this commit:

------------------------------------------------------------------------
r528033 | mikem | 2007-04-12 18:58:30 +0200 (Thu, 12 Apr 2007) | 6 lines

DERBY-2537, 1st incremental checking for this issue.  This changes builds
the framework for storing/retrieving the collation metadata in store and for
passing that info down from language into store.  Some paths still have
default collation hard coded and have been marked TODO-COLLATION.


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

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

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

When I run the repro (tried it on trunk, 10.3.2.1, 10.3.1.4, 10.2.2.1, 10.1.3.1) I get this error:

    ERROR 0A000: Feature not implemented: truncate table.

Am I doing something wrong?

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>             Fix For: 10.0.2.2
>
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Dyre Tjeldvoll resolved DERBY-3352.
-----------------------------------

    Resolution: Fixed

Merged to 10.4 in revision 643002.

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Assignee: Dyre Tjeldvoll
>            Priority: Critical
>             Fix For: 10.4.0.0, 10.4.1.0
>
>         Attachments: derby-3352.diff, test.diff
>
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Dyre Tjeldvoll updated DERBY-3352:
----------------------------------

       Derby Info: [Regression]  (was: [Regression, Patch Available])
    Fix Version/s: 10.4.1.0
                   10.4.0.0
         Assignee: Dyre Tjeldvoll

Thanks for review and test case, Knut.
Committed revision 642996. (Both the patch and the JUnit tests).  

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Assignee: Dyre Tjeldvoll
>            Priority: Critical
>             Fix For: 10.4.0.0, 10.4.1.0
>
>         Attachments: derby-3352.diff, test.diff
>
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Knut Anders Hatlen updated DERBY-3352:
--------------------------------------

    Attachment: test.diff

I'm not familiar with this code, but the fix looks simple and correct to me. To see that it actually did what it intended to do, I wrote a small JUnit test that verified that the NPE was fixed and that the table was correctly truncated. See the attached patch. The test also checks that a "not implemented" exception is thrown in insane builds.

If we keep the TRUNCATE TABLE code in trunk, although only enabled in debug builds, I think it is worth checking in the test. Since we don't know the state of this code, it's good to have a place where we can add tests for it as a first step towards enabling it in non-debug builds as well (if it's decided that it's a good thing to have TRUNCATE TABLE in Derby).

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>         Attachments: derby-3352.diff, test.diff
>
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

Dyre Tjeldvoll updated DERBY-3352:
----------------------------------

    Derby Info: [Patch Available, Regression]  (was: [Regression])

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>         Attachments: derby-3352.diff
>
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

QingpingXu commented on DERBY-3352:
-----------------------------------

i download the source code from svn and compile it all by myself.

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

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

Thanks, I also see the NPE when I run with a debug-enabled build.

That's very strange. With a debug-enabled build, it works without failure on 10.2, but fails with NPE on 10.3 and trunk. With a non-debug build, it fails with 0A000 (feature not implemented) on all versions.

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3352) truncateTable crashed, Caused by: java.lang.NullPointerException

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

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

I found this comment in AlterTableNode.init(Object):

		//truncate table is not suppotted in this release
		//semantics are not yet clearly defined by SQL Council yet
		//truncate will be allowed only in DEBUG builds for testing purposes.

That explains why we get 0A000 on the released jars, at least.

> truncateTable crashed, Caused by: java.lang.NullPointerException
> ----------------------------------------------------------------
>
>                 Key: DERBY-3352
>                 URL: https://issues.apache.org/jira/browse/DERBY-3352
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.1.4, 10.3.2.1
>         Environment: Windows XP.SP2 , Eclipse 3.2.2 , JDK 1.5_05 
>            Reporter: QingpingXu
>            Priority: Critical
>
> Since derby 10.3.2.1, when truncate a table which has index , a java.lang.NullPointerException is throwed;but the same src runs successfully with derby 10.2.2.0。
> here's the example source code and stack trace:
> Src:
>         public static void main(String[] args)
> 	{
> 		
> 		try
> 		{
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
> 			
> 			Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true");
> 			
> 			Statement stat = conn.createStatement();
> 			stat.executeUpdate("create table m (uri varchar(256),f int)");
> 			stat.executeUpdate("create index aa on m (uri)");
> 			stat.executeUpdate("truncate table m");
> 			
> 			System.out.println("Truncate table m successfully!");
> 		}
> 		catch (Exception ex)
> 		{
> 			ex.printStackTrace();
> 		}
> 	}
> Error:
> 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.Util.newEmbedSQLException(Util.java:88)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1574)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1315)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:618)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:176)
> 	at update.UpdateURI.main(UpdateURI.java:34)
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.truncateTable(AlterTableConstantAction.java:1462)
> 	at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:531)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:64)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:370)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1225)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.