db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1574) NullPointerException in UPDATE with COALESCE and subquery
Date Thu, 27 Jul 2006 02:42:14 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1574?page=all ]

Dag H. Wanvik updated DERBY-1574:
---------------------------------

    Attachment: predicatePushdown.diff
                derby1574.diff

I looked at it out of curiosity (I am not very familiar with this part
of the code); it seems the problem is related to the fact that the
preprocess phase has not been run prior to the optimize phase for the
subquery, leading to the referencedTableMap being empty (immediate
cause for NPE).

I made this experiment patch which seems to work for the case in the
issue.  It should not be committed until someone more knowledgeable of
this part of the code has looked at it (it may be altogether the wrong
solution for all I know). Also I had to guess a bit at where the call to
preprocess should be placed as well as the arguments, so caveats apply.

I ran derbylang, but had a small diff in the execution plan (enclosed).
It may not be a problem, not sure.



> NullPointerException in UPDATE with COALESCE and subquery
> ---------------------------------------------------------
>
>                 Key: DERBY-1574
>                 URL: http://issues.apache.org/jira/browse/DERBY-1574
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.1, 10.1.3.0, 10.1.2.1, 10.1.1.0, 10.0.2.1, 10.0.2.0, 10.0.2.2,
10.1.3.2, 10.1.4.0, 10.2.0.0
>         Environment: Java 1.5.0_06
>            Reporter: Christian d'Heureuse
>            Priority: Minor
>         Attachments: derby1574.diff, predicatePushdown.diff
>
>
> The following statements generate a NullPointerException:
> CREATE TABLE t1 (i INTEGER);
> CREATE TABLE t2 (i INTEGER);
> UPDATE t1
>    SET i = COALESCE(
>       (SELECT i FROM t2 WHERE t2.i=t1.i),
>       0);
> Any further SQL statements generate an internal error in RawStore, e.g.:
> SELECT * FROM t1;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message