db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Matrigali (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1574) NullPointerException in UPDATE with COALESCE and subquery
Date Tue, 25 Jul 2006 20:26:14 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1574?page=all ]

Mike Matrigali updated DERBY-1574:
----------------------------------


If at all possible always include the full stack trace from derby.log when reporting a bug.
 Here is the 
stack  from the original problem against the trunk showing that the issue is in the optimizer:

2006-07-25 20:19:59.104 GMT Thread[main,5,main] (XID = 131), (SESSIONID = 0), (D
ATABASE = wombat), (DRDAID = null), Failed Statement is: UPDATE t1^M
   SET i = COALESCE(^M
      (SELECT i FROM t2 WHERE t2.i=t1.i),^M
      0)^M
java.lang.NullPointerException^M
    at org.apache.derby.iapi.util.JBitSet.or(JBitSet.java:241)^M
    at org.apache.derby.impl.sql.compile.OptimizerImpl.<init>(OptimizerImpl.java
:254)^M
    at org.apache.derby.impl.sql.compile.Level2OptimizerImpl.<init>(Level2Optimi
zerImpl.java:76)^M
    at org.apache.derby.impl.sql.compile.Level2OptimizerFactoryImpl.getOptimizer
Impl(Level2OptimizerFactoryImpl.java:98)^M
    at org.apache.derby.impl.sql.compile.OptimizerFactoryImpl.getOptimizer(Optim
izerFactoryImpl.java:159)^M
    at org.apache.derby.impl.sql.compile.ResultSetNode.getOptimizer(ResultSetNod
e.java:1635)^M
    at org.apache.derby.impl.sql.compile.SelectNode.optimize(SelectNode.java:163
9)^M
    at org.apache.derby.impl.sql.compile.SubqueryNode.optimize(SubqueryNode.java
:1683)^M
    at org.apache.derby.impl.sql.compile.SubqueryList.optimize(SubqueryList.java
:121)^M
    at org.apache.derby.impl.sql.compile.SelectNode.optimize(SelectNode.java:166
4)^M
    at org.apache.derby.impl.sql.compile.DMLStatementNode.optimize(DMLStatementN
ode.java:328)^M
    at org.apache.derby.impl.sql.compile.DMLModStatementNode.optimize(DMLModStat
ementNode.java:1352)^M
    at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.ja
va:395)^M
    at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:
118)^M
    at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareIn
ternalStatement(GenericLanguageConnectionContext.java:713)^M
    at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:567
)^M
    at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:516
)^M
    at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:313)^M
    at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:433)^M
    at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:310)^M
    at org.apache.derby.impl.tools.ij.Main.go(Main.java:207)^M
    at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:173)^M
    at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55)^M
    at org.apache.derby.tools.ij.main(ij.java:60)^M
Cleanup action completed^M

Subsequent errors in raw store indicates there is also an error handling problem in the optimizer
code
which leaves the execution context unusable for subsequent queries.  The error is:

ERROR 40XT0: An internal error was identified by RawStore module.^M
    at org.apache.derby.iapi.error.StandardException.newException(StandardExcept
ion.java:294)^M
    at org.apache.derby.impl.store.raw.xact.Xact.setActiveState(Xact.java:1772)^
M
    at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Xact.java:1271)^M
    at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Ope
nConglomerate.java:865)^M
    at org.apache.derby.impl.store.access.heap.Heap.open(Heap.java:614)^M
    at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(RAMTra
nsaction.java:478)^M
    at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(RAMTra
nsaction.java:1315)^M
    at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaInde
x(DataDictionaryImpl.java:7339)^M
    at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(Data
DictionaryImpl.java:1532)^M
    at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(
DataDictionaryImpl.java:1442)^M
    at org.apache.derby.impl.sql.compile.QueryTreeNode.getSchemaDescriptor(Query
TreeNode.java:1504)^M
    at org.apache.derby.impl.sql.compile.QueryTreeNode.getSchemaDescriptor(Query
TreeNode.java:1456)^M
    at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(FromB
aseTable.java:2379)^M
    at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(FromBase
Table.java:2107)^M
    at org.apache.derby.impl.sql.compile.FromList.bindTables(FromList.java:300)^
M
    at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(SelectNode.
java:472)^M
    at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(DMLStatemen
tNode.java:220)^M
    at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.
java:158)^M
    at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:252)^M
    at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.ja
va:344)^M
    at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:
118)^M
    at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareIn
ternalStatement(GenericLanguageConnectionContext.java:713)^M
    at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:567
)^M
    at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:516
)^M
    at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:313)^M
    at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:433)^M
    at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:312)^M
    at org.apache.derby.impl.tools.ij.Main.go(Main.java:207)^M
    at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:173)^M
    at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55)^M
    at org.apache.derby.tools.ij.main(ij.java:60)^M
Cleanup action completed^M

> NullPointerException in UPDATE with COALESCE and subquery
> ---------------------------------------------------------
>
>                 Key: DERBY-1574
>                 URL: http://issues.apache.org/jira/browse/DERBY-1574
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.1
>         Environment: Java 1.5.0_06
>            Reporter: Christian d'Heureuse
>            Priority: Minor
>
> The following statements generate a NullPointerException:
> CREATE TABLE t1 (i INTEGER);
> CREATE TABLE t2 (i INTEGER);
> UPDATE t1
>    SET i = COALESCE(
>       (SELECT i FROM t2 WHERE t2.i=t1.i),
>       0);
> Any further SQL statements generate an internal error in RawStore, e.g.:
> SELECT * FROM t1;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message