[jira] [Updated] (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:all-tabpanel ] Harshvardhan Gupta updated DERBY-6904: -- Attachment: 6904_4.diff Thanks for reviewing the patch. Your comments are much appreciated. As you rightly pointed out, cycling feature requires only boolean for storage and processing. The new changes are attached in 6904_4.diff which uses boolean data type. Also I have made changes to IdentitySequenceTest by changing them to reflect the new expected behaviour. Other than two of the above test cases, we should add new test cases to completely cover all the functionality introduced with this patch. I am creating new subtasks for tracking test coverage and documentation. > 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)
[jira] [Updated] (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:all-tabpanel ] Harshvardhan Gupta updated DERBY-6904: -- Attachment: 6904_3.diff I have completed work on the hard upgrade strategy with the attached patch 6904_3.diff. All the test suites now pass with soft upgrades and hard upgrades. I also manually tested the expected behaviour using ij. I now have to add test cases for the newly added functionality. The patch resolves the following related issues : DERBY-6903, DERBY-6904, DERBY-6905 and DERBY-6906 > 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.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)
[jira] [Updated] (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:all-tabpanel ] Harshvardhan Gupta updated DERBY-6904: -- Attachment: 6904_2.diff Thanks Bryan, Soft Upgrade Strategy - In the attached updated patch, I tweaked the SYSColumnsRowFactory to serve all columns except the newly introduced one while running a database in soft upgrade mode. (i.e both forward and backward compatible). The code flow was modelled after Derby-534 for introducing a new in column SYSTRIGGERS.. Since most test suites used only soft upgrade mode, I passed all the test suites except the upgradeTests package which explicitly boots the old databases in hard upgrade mode other than soft upgrade mode. I am yet to implement a hard upgrade strategy. Should we look at the SYSSEQUENCES column and populated the value in SYSCOLUMNS as part of explicit hard upgrade? The updated patch passed all the test suites other than upgradeTests test suite where some tests require a hard update strategy. I also tested soft updates using IJ for database created using 10.13, the created databases are both backward and forward compatible with 10.14. > 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_2.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)
[jira] [Updated] (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:all-tabpanel ] Harshvardhan Gupta updated DERBY-6904: -- Attachment: compareDbName columnMismatch Some of the existing tests are failing with one of the following reasons - 1)Engine Shutdown: Expected XJ015 but was XSCH5 in method assertSQLState Referring to https://db.apache.org/derby/docs/10.2/ref/rrefexcept71493.html , I think this error is mostly due to addition of a new column in SYSCOLUMNS which is not there in existing DB jars when they are brought to memory in test packages. (HSCH5 is a heap class SQLState) 2) compareDatabaseNames throws mismatch error while building a connection. I think these errors are a direct result of the above error when shutdown is not clean. I am attaching both the error stacks for reference. Please take a look at the error stacks and give your inputs. > 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, 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)
[jira] [Updated] (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: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)