db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3033) select query results in nullpointer exception in skipScan()
Date Wed, 19 Sep 2007 17:48:13 GMT

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

Bryan Pendleton commented on DERBY-3033:

I've been trying to understand the structure and content of the generated code for
the activation, by using derby.debug.true=DumpClassFile and decompiling the
resulting class files.

I can see the generated startKeyGetter method for the TableScanResultSet
which accesses dicom_send_requests via the sendreq_study_id_fk index:

    public Object e7()
        throws StandardException
        e8.setColumn(1, (NumberDataValue)getColumnFromRow(5, 1));
        return e8;

And I can see the generated code in fillResultSet which is setting up the
TableScanResultSet to make this call:

                                this, 1457, 21, getMethod("e6"), 9, getMethod("e7"),
                                1, null, -1, true, e9, "DICOM_SEND_REQUESTS", null,
                                "SENDREQ_STUDY_ID_FK", true, false, -1, -1, 6,
                                false, 0, false, 1.2960000000000003D, 265.16399630200306D),

All of the generated code looks reasonable and valid, though I don't have
much experience reading the generated code.

I'm now wondering if this is an order-of-operations thing. During the nested loop
join, the following event should occur:
 - the current row from the outer side of the join should be fetched
 - the probe for the inner side of the join should be set up
 - the values from the outer side of the join should be passed to the
   index positioning logic on the inner side.

It is the "startKeyGetter" method that does that last step, but I wonder if it's
trying to access the start key values before the project/restrict processing has
pushed the values of the current row up from the outer side of the join.

> 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:
>         Environment: Windows XP, Java 5.0, JDBC, Derby
>            Reporter: Haolan Qin
>            Assignee: Bryan Pendleton
>         Attachments: bug4736.sql, d3033-sane-ij-session-, 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.

View raw message