db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4798) NPE in nested outer join
Date Sat, 11 Sep 2010 22:54:33 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908381#action_12908381
] 

Dag H. Wanvik commented on DERBY-4798:
--------------------------------------

The call from NoPutResultSetImpl.clearOrderableCache() to Qualifier.getOrderable isn't the
only call site that relies on the removed lines. Tracing shows that also the call to Qualifier.getOrderable
from
HashScanResultSet.getNextRowCore (in the example query) will provoke the NPE.
Cf. Kathey's stack trace in DERBY-3033 for old bug #4736:

        at java.lang.Thread.dumpStack(Thread.java:1206)
	at org.apache.derby.impl.sql.execute.BaseActivation.getColumnFromRow(BaseActivation.java:1484)
	at org.apache.derby.exe.ac0b5b0099x012bx02f8x63e3x000003d2b1a047.e19(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
	at org.apache.derby.impl.sql.execute.GenericQualifier.getOrderable(GenericQualifier.java:96)
	at org.apache.derby.impl.sql.execute.HashScanResultSet.getNextRowCore(HashScanResultSet.java:395)
	at org.apache.derby.impl.sql.execute.NestedLoopLeftOuterJoinResultSet.getNextRowCore(NestedLoopLeftOuterJoinResultSet.java:104)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(ProjectRestrictResultSet.java:261)
	at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(BasicNoPutResultSetImpl.java:477)
	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:429)
	at org.apache.derby.impl.jdbc.EmbedResultSet.next(EmbedResultSet.java:373)

> NPE in nested outer join
> ------------------------
>
>                 Key: DERBY-4798
>                 URL: https://issues.apache.org/jira/browse/DERBY-4798
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0
>            Reporter: Dag H. Wanvik
>
> Using the schema from DERBY-4712 and running the original randomized query generator
used to find DERBY-4712, http://code.google.com/p/h2database/source/browse/trunk/h2/src/test/org/h2/test/db/TestNestedJoins.java,
I have uncovered yet another bug (NPE), which appears to be a different beast. This one is
a regression in 10.5 (works in 10.4 and older). This is the failing query:
> SELECT t0.x0,
>        t1.x1,
>        t2.x2,
>        t3.x3,
>        t4.x4,
>        t5.x5,
>        t6.x6,
>        t7.x7
> FROM ((t0
>          LEFT OUTER JOIN ((t1
>                            LEFT OUTER JOIN (t2
>                                             LEFT OUTER JOIN t3
>                                               ON t2.x2 = t3.x3 )
>                              ON t1.x1 = t2.x2 )
>                           LEFT OUTER JOIN (t4
>                                            INNER JOIN (t5
>                                                        LEFT OUTER JOIN t6
>                                                          ON t5.x5 = t6.x6 )
>                                              ON t4.x4 = t5.x5 )
>                             ON t1.x1 = t5.x5 )
>            ON t0.x0 = t5.x5 )
>         LEFT OUTER JOIN t7
>           ON t3.x3 = t7.x7 ); 
> Relevant part of the stack trace (using 10.5 trunk @ svn 995846):
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.BaseActivation.getColumnFromRow(BaseActivation.java:1458)
> 	at org.apache.derby.exe.ac4ac48095x012axfc73x9c5dx000003d485d847.e19(Unknown Source)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
> 	at org.apache.derby.impl.sql.execute.GenericQualifier.getOrderable(GenericQualifier.java:96)
> 	at org.apache.derby.impl.sql.execute.NoPutResultSetImpl.clearOrderableCache(NoPutResultSetImpl.java:307)
> 	at org.apache.derby.impl.sql.execute.HashScanResultSet.resetProbeVariables(HashScanResultSet.java:359)
> 	at org.apache.derby.impl.sql.execute.HashScanResultSet.openCore(HashScanResultSet.java:322)
> 	at org.apache.derby.impl.sql.execute.JoinResultSet.openRight(JoinResultSet.java:283)
> 	at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(JoinResultSet.java:152)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(ProjectRestrictResultSet.java:181)
> 	at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(BasicNoPutResultSetImpl.java:251)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:416)

-- 
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