db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3033) select query results in nullpointer exception in skipScan()
Date Fri, 14 Sep 2007 18:50:32 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527603
] 

Kathey Marsden commented on DERBY-3033:
---------------------------------------

FYI: Here is the case from bug 4736 that was giving an  NPE in getColumnFromRow before the
fix to check for a null row was added.  I tend to think that fix was wrong, that there is
some root cause for the null row which needs to be addressed instead, and hopefully that is
the same root cause for the DERBY-3033 test case.  I am off of playing with DERBY-3033 for
a while.  Hope someone else can pick this up given what Haolan, Army and I have found so far.

Kathey


create table a (a1 int not null primary key, a2 int, a3 int, a4 
int, a5 int, a6 int);
create table b (b1 int not null primary key, b2 int, b3 int, b4 
int, b5 int, b6 int);
create table c (c1 int not null, c2 int, c3 int not null, c4 
int, c5 int, c6 int);
create table d (d1 int not null, d2 int, d3 int not null, d4 
int, d5 int, d6 int);

alter table c add primary key (c1,c3);
alter table d add primary key (d1,d3);

insert into a values 
(1,1,3,6,NULL,2),(2,3,2,4,2,2),(3,4,2,NULL,NULL,NULL),
                     
(4,NULL,4,2,5,2),(5,2,3,5,7,4),(7,1,4,2,3,4),
                     (8,8,8,8,8,8),(6,7,3,2,3,4);

insert into b values 
(6,7,2,3,NULL,1),(4,5,9,6,3,2),(1,4,2,NULL,NULL,NULL),
                     
(5,NULL,2,2,5,2),(3,2,3,3,1,4),(7,3,3,3,3,3),(9,3,3,3,3,3);

insert into c values 
(3,7,7,3,NULL,1),(8,3,9,1,3,2),(1,4,1,NULL,NULL,NULL),
                     
(3,NULL,1,2,4,2),(2,2,5,3,2,4),(1,7,2,3,1,1),(3,8,4,2,4,6);

insert into d values 
(1,7,2,3,NULL,3),(2,3,9,1,1,2),(2,2,2,NULL,3,2),
                     
(1,NULL,3,2,2,1),(2,2,5,3,2,3),(2,5,6,3,7,2);



select a1,b1,c1,c3,d1,d3 
  from D join (A left outer join (B join C on b2=c2) on a1=b1) 
on d3=b3 and d1=a2;

A1             |B1             |C1             |C3             
|D1             |D3             
----------------------------------------------------------------
-------------------------------
1              |1              |4              |2              
|1              |2              
ERROR 38000: The exception 'java.lang.NullPointerException' was 
thrown while evaluating an expression.
ERROR 38000: The exception 'java.lang.NullPointerException' was 
thrown while evaluating an expression.
 at 
com.ibm.db2j.protocol.Database.Errors.StandardException.newExcep
tion(StandardException.java:386)
 at 
com.ibm.db2j.protocol.Database.Errors.StandardException.unexpect
edUserException(StandardException.java:567)
 at 
com.ibm.db2j.impl.BasicServices.ClassManager.Reflect.DirectCall.
invoke(ReflectGeneratedClass.java:118)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.GenericQua
lifier.getOrderable(GenericQualifier.java:87)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.HashScanRe
sultSet.getNextRowCore(HashScanResultSet.java:477)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.NestedLoop
JoinResultSet.getNextRowCore(NestedLoopJoinResultSet.java:116)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.ProjectRes
trictResultSet.getNextRowCore(ProjectRestrictResultSet.java:249)

 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.BasicNoPut
ResultSetImpl.getNextRow(BasicNoPutResultSetImpl.java:479)
 at 
com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalResultSet.movePos
ition(LocalResultSet.java:297)
 at 
com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalResultSet.next(Lo
calResultSet.java:251)
 at 
com.ibm.db2j.util.JDBCDisplayUtil.indent_DisplayResults(JDBCDisp
layUtil.java:335)
 at 
com.ibm.db2j.util.JDBCDisplayUtil.indent_DisplayResults(JDBCDisp
layUtil.java:272)
 at 
com.ibm.db2j.util.JDBCDisplayUtil.DisplayResults(JDBCDisplayUtil
.java:261)
 at 
com.ibm.db2j.tools.ijImpl.utilMain.displayResult(utilMain.java:3
66)
 at 
com.ibm.db2j.tools.ijImpl.utilMain.doCatch(utilMain.java:419)
 at com.ibm.db2j.tools.ijImpl.utilMain.go(utilMain.java:295)
 at com.ibm.db2j.tools.ijImpl.Main.go(Main.java:196)
 at com.ibm.db2j.tools.ijImpl.Main.mainCore(Main.java:163)
 at com.ibm.db2j.tools.ijImpl40.Main.main(Main.java:49)
 at com.ibm.db2j.tools.ij.main(ij.java:57)
ERROR XJ001: Java exception: ': 
java.lang.NullPointerException'.
java.lang.NullPointerException
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.BaseActiva
tion.getColumnFromRow(BaseActivation.java:1234)
 at 
db2j.exe.ac601a400fx00f0xe017x7cc0x007f0000010012c.e8(Unknown 
Source)
 at 
com.ibm.db2j.impl.BasicServices.ClassManager.Reflect.DirectCall.
invoke(ReflectGeneratedClass.java:109)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.GenericQua
lifier.getOrderable(GenericQualifier.java:87)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.HashScanRe
sultSet.getNextRowCore(HashScanResultSet.java:477)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.NestedLoop
JoinResultSet.getNextRowCore(NestedLoopJoinResultSet.java:116)
 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.ProjectRes
trictResultSet.getNextRowCore(ProjectRestrictResultSet.java:249)

 at 
com.ibm.db2j.impl.Database.Language.Execution.Generic.BasicNoPut
ResultSetImpl.getNextRow(BasicNoPutResultSetImpl.java:479)
 at 
com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalResultSet.movePos
ition(LocalResultSet.java:297)
 at 
com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalResultSet.next(Lo
calResultSet.java:251)
 at 
com.ibm.db2j.util.JDBCDisplayUtil.indent_DisplayResults(JDBCDisp
layUtil.java:335)
 at 
com.ibm.db2j.util.JDBCDisplayUtil.indent_DisplayResults(JDBCDisp
layUtil.java:272)
 at 
com.ibm.db2j.util.JDBCDisplayUtil.DisplayResults(JDBCDisplayUtil
.java:261)
 at 
com.ibm.db2j.tools.ijImpl.utilMain.displayResult(utilMain.java:3
66)
 at 
com.ibm.db2j.tools.ijImpl.utilMain.doCatch(utilMain.java:419)
 at com.ibm.db2j.tools.ijImpl.utilMain.go(utilMain.java:295)
 at com.ibm.db2j.tools.ijImpl.Main.go(Main.java:196)
 at com.ibm.db2j.tools.ijImpl.Main.mainCore(Main.java:163)
 at com.ibm.db2j.tools.ijImpl40.Main.main(Main.java:49)
 at com.ibm.db2j.tools.ij.main(ij.java:57)
ij> 

> select query results in nullpointer exception in skipScan()
> -----------------------------------------------------------
>
>                 Key: DERBY-3033
>                 URL: https://issues.apache.org/jira/browse/DERBY-3033
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: Windows XP, Java 5.0, JDBC, Derby 10.2.2.0
>            Reporter: Haolan Qin
>         Attachments: d3033-sane-ij-session-10.3.1.5.txt, query_plan.new, query_plan.old,
test.rar, test.zip, viewer_10_1.zip
>
>
> The following error was repeatedly thrown when we tried to run a select query via JDBC.
Strangely, the exact same select query did not trigger any error when run from the command
line console. After we added an index, the error went away completely. 
> java.lang.NullPointerException
>  at org.apache.derby.impl.sql.execute.NoPutResultSetImpl.skipScan(Unknown Source)
>  at org.apache.derby.impl.sql.execute.TableScanResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.JoinResultSet.openRight(Unknown Source)
>  at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
>  at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(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.drda.DRDAStatement.execute(Unknown Source)
>  at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
>  at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)

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


Mime
View raw message