[ 
https://issues.apache.org/jira/browse/DERBY-6904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Harshvardhan Gupta updated DERBY-6904:
--------------------------------------
    Attachment: 6904.diff

The attached patch covers the following issues -

DERBY-6904 Enhance ALTER TABLE to allow CYCLE option to be changed.

DERBY-6905 Enhance SYS.SYSCOLUMNS to report the CYCLE value for an IDENTITY 
column

DERBY-6903 ALTER TABLE ALTER COLUMN resets CYCLE option of IDENTITY column

The idea was to add 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.

I have manually tested with different queries for all the above scenarios. I 
will be writing test cases over coming days and fixing older one which are 
exepected to break due to changes in SYSCOLUMNS view.

Also, while testing I encountered the following behaviour present in the latest 
derby release:

If increment step is changed, the current value of syssequences is not changed 
however current value in syscolumns is changed. Interestingly, this only affect 
the SYSCOLUMNS view and not the generation of sequences since SYSSEQUENCES is 
consistent.
I found DERBY-6579 which addressed the bug and made SYSSEQUENCES consistent. 
Please clarify whether the SYSCOLUMNS behaviour is a deliberate one or should 
be filed as a bug.


 




> 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
>            Priority: Minor
>         Attachments: 6904.diff
>
>
> 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)

Reply via email to