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] [Commented] (DERBY-6565) ROW_NUMBER function throws NullPointerException in UPDATE statement
Date Wed, 06 Aug 2014 07:27:12 GMT

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

Knut Anders Hatlen commented on DERBY-6565:
-------------------------------------------

Thanks for fixing this bug, Dag. You mentioned that we should test the MERGE statement too.
I didn't see a test for that, so I ran one manually. Your patch indeed fixes the UPDATE clause
of the merge statement:

{noformat}
ij> merge into t1 using t2 on (t1.x=t2.x) when matched then update set x = row_number()
over ();
ERROR 42ZC2: Window function is illegal in this context: '<update source>' clause
{noformat}

However, there seems to be a problem with the INSERT clause of the MERGE statement. I've filed
DERBY-6689. (Ordinary INSERT statements don't seem to have this problem though.)

> ROW_NUMBER function throws NullPointerException in UPDATE statement
> -------------------------------------------------------------------
>
>                 Key: DERBY-6565
>                 URL: https://issues.apache.org/jira/browse/DERBY-6565
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.10.2.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>            Priority: Minor
>             Fix For: 10.11.1.1
>
>         Attachments: derby-6565-forbid.diff, derby-6565-forbid.status, derby-6565.diff
>
>
> A NullPointerException is raised with this (possibly illegal?) UPDATE statement:
> {noformat}
> ij version 10.10
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> insert into t values 1;
> 1 row inserted/updated/deleted
> ij> update t set x = row_number() over ();
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message