db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6690) ROW_NUMBER should not be allowed in generation clause
Date Thu, 07 Aug 2014 16:00:14 GMT

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

ASF subversion and git services commented on DERBY-6690:
--------------------------------------------------------

Commit 1616518 from [~dagw] in branch 'code/branches/10.11'
[ https://svn.apache.org/r1616518 ]

DERBY-6690 ROW_NUMBER should not be allowed in generation clause

Backported cleanly from trunk as:

svn merge -c 1616365 https://svn.apache.org/repos/asf/db/derby/code/trunk

Patch *derby-6690* makes this illegal by adding a check in
TableElementList#bindAndValidateGeneration. I had to add an
acceptChildren method to GenerationClauseNode for the visitor to reach
down into the generation clause. Added a test to
OLAPTest#testBasicOperations for both CREATE TABLE and ALTER TABLE ADD
COLUMN.

> ROW_NUMBER should not be allowed in generation clause
> -----------------------------------------------------
>
>                 Key: DERBY-6690
>                 URL: https://issues.apache.org/jira/browse/DERBY-6690
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.10.2.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>             Fix For: 10.11.1.1, 10.12.0.0
>
>         Attachments: derby-6690.diff
>
>
> The generation clause is allowed to have a call to the ROW_NUMBER function. But it fails
when a new row is inserted. It should be disallowed in CREATE TABLE and ALTER TABLE ADD COLUMN.
> {noformat}
> ij> create table t (x int generated always as (row_number() over ()));
> 0 rows inserted/updated/deleted
> ij> insert into t values default;
> ERROR XJ001: Java exception: 'ASSERT FAILED cannot get interface without operand: org.apache.derby.shared.common.sanity.AssertFailure'.
> {noformat}



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

Mime
View raw message