You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Yip Ng (JIRA)" <de...@db.apache.org> on 2006/08/09 19:57:17 UTC

[jira] Commented: (DERBY-1574) NullPointerException in UPDATE with COALESCE and subquery

    [ http://issues.apache.org/jira/browse/DERBY-1574?page=comments#action_12426994 ] 
            
Yip Ng commented on DERBY-1574:
-------------------------------

I have reviewed the latest patch and it looks good.  I confirmed that without this patch, it will throw NPE from the above case.  After applying the patch, The arguments in the coalesce now gets handled properly and returns the expected result:

ij> update t1 set i = coalesce((select i from t2 where t2.i=t1.i), 0);
0 rows inserted/updated/deleted
WARNING 02000: No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table.

I think this patch is ready to be committed.  +1

> 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.0.2.0, 10.0.2.1, 10.0.2.2, 10.1.1.0, 10.2.0.0, 10.1.2.1, 10.1.3.0, 10.1.4.0, 10.1.3.1, 10.1.3.2
>         Environment: Java 1.5.0_06
>            Reporter: Christian d'Heureuse
>         Assigned To: Dag H. Wanvik
>            Priority: Minor
>             Fix For: 10.2.0.0
>
>         Attachments: derby1574-2.diff, derby1574-2.stat, 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