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 "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/06/01 22:03:05 UTC

[jira] [Commented] (DERBY-6904) Enhance ALTER TABLE to allow CYCLE option to be changed.

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

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

Commit 1797283 from [~bryanpendleton] in branch 'code/trunk'
[ https://svn.apache.org/r1797283 ]

DERBY-6903: ALTER TABLE ALTER COLUMN resets CYCLE option
DERBY-6904: Enhance ALTER TABLE to allow CYCLE option to be changed
DERBY-6905: Enhance SYS.SYSCOLUMNS to report the CYCLE value
DERBY-6906: Allow a GENERATED column to explicitly specify NO CYCLE

This patch was contributed by Harshvardhan Gupta (harshvardhan145 at gmail dot com)

The patch adds the CYCLE property as a fundamental property associated
with a column similar to current increment value, current increment step etc.

 *  SYS.SYSCOLUMNS extended to hold the cycle value of identity column.
 *  Extended the grammar to accept "cycle","no cycle" in alter clause
    and changed the underlying column descriptor and sequencing objects.
 *  ALTER clause not involving cycle option (i.e increment and restart)
    won't affect the cycle option.

The code flow for the upgrade handling was modelled after Derby-534
for introducing a new in column SYSTRIGGERS. There are new behaviors
for SYSCOLUMNS in both soft- and hard-upgrade scenarios.

> Enhance ALTER TABLE to allow CYCLE option to be changed.
> --------------------------------------------------------
>
>                 Key: DERBY-6904
>                 URL: https://issues.apache.org/jira/browse/DERBY-6904
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.13.1.0
>            Reporter: Bryan Pendleton
>            Assignee: Harshvardhan Gupta
>            Priority: Minor
>         Attachments: 6904_2.diff, 6904_3.diff, 6904_4.diff, 6904.diff, columnMismatch, compareDbName
>
>
> It would be nice to have a variant of the ALTER TABLE statement,
> similar to the SET INCREMENT BY or SET RESTART WITH variants,
> that allowed a user to change the CYCLE option on an IDENTITY column.
> I think that the code flow for this could be closely modelled on the
> code flow for the SET INCREMENT BY variant: after the statement
> is parsed, we simply need to drop and recreate the underlying SEQUENCE
> object with the desired CYCLE option (and preserving all the other
> aspects of the underlying SEQUENCE object.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)