[
https://issues.apache.org/jira/browse/DERBY-6565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14085929#comment-14085929
]
Knut Anders Hatlen commented on DERBY-6565:
-------------------------------------------
SQL 2011, part 2, 6.10 <window function>, syntax rule 4 seems to indicate that
a window function can only appear in an <order by clause> or a <select list>.
If so, we can probably fix it by making UpdateNode raise a StandardException at
bind time.
> 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
> Attachments: 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)