db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4391) NullPointerException when comparing indexed column with result from a set operation
Date Mon, 05 Oct 2009 11:01:31 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-4391:

    Attachment: d4391-1a.stat

It looks like checking whether ref.getSource() is null in PredicateList.markReferencedColumns()
and only calling markAllRCsInChainReferenced() on it if it's non-null makes the NPE go away
and the queries return the expected results. I'm not sure, but I think it is OK for ColumnReference.getSource()
to return null (see for example the comment in BaseTableNumbersVisitor.visit()), in which
case markReferencedColumns() should be prepared for it. The ColumnReference with no source
is generated by ResultColumnList.setUnionResultExpression().

The attached patch (d4391-1a.diff) adds the null check and also adds test cases to lang/union.sql.
All the regression tests ran cleanly with the patch.

> NullPointerException when comparing indexed column with result from a set operation
> -----------------------------------------------------------------------------------
>                 Key: DERBY-4391
>                 URL: https://issues.apache.org/jira/browse/DERBY-4391
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,,
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d4391-1a.diff, d4391-1a.stat
> I'm reporting this issue on behalf of Bernt M. Johnsen.
> If an indexed column is compared with a UNION query (or some other set operation), a
NullPointerException is raised, as can be seen by this sequence of statements in ij:
> ij> create table t(a int not null primary key, b int);
> 0 rows inserted/updated/deleted
> ij> select * from t where a < (values 4 union values 4);
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

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

View raw message