[
https://issues.apache.org/jira/browse/DERBY-6006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508712#comment-13508712
]
Knut Anders Hatlen commented on DERBY-6006:
-------------------------------------------
Debug versions produce another error. And all executions of the INSERT ...
ORDER BY statements fail with the debug version, not only the fourth execution.
Stack trace with 10.9.1.0 debug:
ERROR XSCH5: In a base table there was a mismatch between the requested column
number 1 and the maximum number of columns 1.
at
org.apache.derby.iapi.error.StandardException.newException(StandardException.java:295)
at
org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:235)
at
org.apache.derby.impl.store.access.heap.HeapController.insert(HeapController.java:575)
at
org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:457)
at
org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1155)
at
org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:508)
at
org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:443)
at
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:324)
at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1715)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1370)
at org.apache.derby.impl.tools.ij.ij.ExecuteStatement(ij.java:2521)
at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1158)
at
org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
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)
> NullPointerException in INSERT INTO ... SELECT FROM ... ORDER BY
> ----------------------------------------------------------------
>
> Key: DERBY-6006
> URL: https://issues.apache.org/jira/browse/DERBY-6006
> Project: Derby
> Issue Type: Bug
> Components: Store
> Affects Versions: 10.9.1.0
> Reporter: Knut Anders Hatlen
>
> A NullPointerException was reported by Harm-Jan Zwinderman on derby-user:
> http://mail-archives.apache.org/mod_mbox/db-derby-user/201211.mbox/%3C50B66527.5040906%40gmail.com%3E
> I've managed to reproduce it on 10.9.1.0 like this:
> ij version 10.9
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table t(x double);
> 0 rows inserted/updated/deleted
> ij> insert into t values (0);
> 1 row inserted/updated/deleted
> ij> prepare ps as 'insert into t select 1 from t order by x';
> ij> execute ps;
> 1 row inserted/updated/deleted
> ij> execute ps;
> 2 rows inserted/updated/deleted
> ij> execute ps;
> 4 rows inserted/updated/deleted
> ij> execute ps;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> Full stack trace:
> java.lang.NullPointerException
> at
> org.apache.derby.impl.store.access.conglomerate.ConglomerateUtil.createFormatIds(Unknown
> Source)
> at org.apache.derby.impl.store.access.heap.Heap.create(Unknown Source)
> at
> org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.createConglomerate(Unknown
> Source)
> at
> org.apache.derby.impl.store.access.RAMTransaction.createConglomerate(Unknown
> Source)
> at
> org.apache.derby.impl.sql.execute.TemporaryRowHolderImpl.insert(Unknown
> Source)
> at
> org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown
> Source)
> at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown
> Source)
> at
> org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
> Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
> Source)
> at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
> Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
> Source)
> at org.apache.derby.impl.tools.ij.ij.ExecuteStatement(Unknown Source)
> at org.apache.derby.impl.tools.ij.ij.ijStatement(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)
> at org.apache.derby.iapi.tools.run.main(Unknown Source)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira