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