db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A B (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3033) select query results in nullpointer exception in skipScan()
Date Tue, 18 Sep 2007 19:12:43 GMT

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

A B commented on DERBY-3033:
----------------------------

> I haven't seen any code path that is going through
> NoPutResultSetImpl.clearOrderableCache, so I don't
> have any information to share regarding the code
> comment [...]

It's possible that the comment is just a red herring--if clearOrderableCache() is not in play,
then there's probably no point going further down that road.  The information that you provided
above certainly has potential--great investigation.

> the optimizer may have re-arranged this

To add to this: I think that for the optimizer to re-arrange the join order between dispatcher_locks,
dicom_send_requests, and studies, all of those result sets must (I *think*?) appear in the
same compile-time FromList.  That means that the NOT EXISTS subquery will have to be "flattened"
into the "select distinct st.study_id, ..." query.  So it may be useful to look at SubqueryNode.preprocess()
to see a) if the NOT EXISTS subquery is in fact being flattened, and b) if the column references
that result from that flattening are set up correctly.

If the NOT EXISTS subquery is in fact being flattened, it might be good to stop the debugger
just after "modification of access paths" has occured on the relevant FromList (the one containing
dispatcher_locks, dicom_send_requests, and studies) to see what join order (and join strategies)
the optimizer has chosen.  Perhaps that'll provide some insight as to whether or not the optimizer
re-arrangement is in play here...?

Of course I'm just offering top-of-my-head suggestions; feel free to ignore and continue with
your current path of investigation, as that certainly seems to be yielding some very useful
information...

> 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
>            Assignee: Bryan Pendleton
>         Attachments: bug4736.sql, 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