db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4693) column rename looses 'identity' attribute.
Date Sun, 06 Jun 2010 15:59:54 GMT

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

Bryan Pendleton updated DERBY-4693:
-----------------------------------

    Attachment: patch.diff

Attached 'patch.diff' contains a proposed fix to the problem,
and a handful of regression tests. The essence of the fix
is to observe that, since RENAME COLUMN more-or-less
drops and re-adds the column, we need to ensure that when
the column is re-added, if it is an Autoincrement column, 
we set the CREATE_AUTOINCREMENT flag that the parser
sets when initially creating the table.

Regression tests completed successfully. Comments or
suggestions about the patch are welcome.


> column rename looses 'identity' attribute.
> ------------------------------------------
>
>                 Key: DERBY-4693
>                 URL: https://issues.apache.org/jira/browse/DERBY-4693
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.1.4, 10.6.1.0
>         Environment: ubuntu, java 1.5
>            Reporter: Brett Sutton
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: patch.diff
>
>
> renaming an identity column causes the column to loose its 'identity' attribute.
> you can reproduce the problem as follows:
> CREATE TABLE njr_version ( id INTEGER generated always as identity, databaseVersion INTEGER);
> insert into njr_version (databaseVersion) values (10);
> -- column inserted successfully.
> rename column njr_version.id to idVersion;
> insert into njr_version (databaseVersion) values (10);
> Error: Column 'IDVERSION'  cannot accept a NULL value.
> To compound this problem there is no way to restore the renamed column's identity attribute
as the alter command doesn't let you set an identity attribute. The only work around is to
create a new table and copy the data across.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message