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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2008/03/24 17:15:24 UTC

[jira] Created: (DERBY-3566) Alter column set data type not allowed in soft upgrade with unique constraint

Alter column set data type not allowed in soft upgrade with unique constraint
-----------------------------------------------------------------------------

                 Key: DERBY-3566
                 URL: https://issues.apache.org/jira/browse/DERBY-3566
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.4.0.0
            Reporter: Kathey Marsden
            Priority: Minor


In 10.3 I can do this:

ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
0 rows inserted/updated/deleted
ij> alter table t0 alter v set data type varchar(2);
0 rows inserted/updated/deleted
ij>


In 10.4 soft upgrade mode I cannot:
ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
0 rows inserted/updated/deleted
ij> alter table t0 alter v set data type varchar(2);
ERROR 42Z20: Column 'V' cannot be made nullable. It is part of a primary key or unique constraint, which cannot have any
nullable columns.
ij>


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


Re: [jira] Created: (DERBY-3566) Alter column set data type not allowed in soft upgrade with unique constraint

Posted by Anurag Shekhar <An...@Sun.COM>.
It might be because of my work related to unique constraint, I will look 
into it.
anurag

Kathey Marsden (JIRA) wrote:
>
>
> In 10.4 soft upgrade mode I cannot:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> ERROR 42Z20: Column 'V' cannot be made nullable. It is part of a primary key or unique constraint, which cannot have any
> nullable columns.
> ij>
>
>
>   


[jira] Closed: (DERBY-3566) Alter column set data type not allowed in soft upgrade with unique constraint

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3566?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden closed DERBY-3566.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 10.5.0.0
                   10.4.1.0

committed to trunk and 10.4


> Alter column set data type not allowed in soft upgrade with unique constraint
> -----------------------------------------------------------------------------
>
>                 Key: DERBY-3566
>                 URL: https://issues.apache.org/jira/browse/DERBY-3566
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Anurag Shekhar
>            Priority: Minor
>             Fix For: 10.4.1.0, 10.5.0.0
>
>         Attachments: derby-3566_v1.diff
>
>
> In 10.3 I can do this:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> 0 rows inserted/updated/deleted
> ij>
> In 10.4 soft upgrade mode I cannot:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> ERROR 42Z20: Column 'V' cannot be made nullable. It is part of a primary key or unique constraint, which cannot have any
> nullable columns.
> ij>

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


[jira] Updated: (DERBY-3566) Alter column set data type not allowed in soft upgrade with unique constraint

Posted by "Anurag Shekhar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3566?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anurag Shekhar updated DERBY-3566:
----------------------------------

    Attachment: derby-3566_v1.diff

While splitting the condition to check if primary or unique constraint 
column is being set to null I had missed out one condition which 
resulted in any alter on column is wrongly assumed as making the 
column to null able.

I have fixed this problem and also added a test in upgrade suite to
change the data type in soft upgrade mode.

> Alter column set data type not allowed in soft upgrade with unique constraint
> -----------------------------------------------------------------------------
>
>                 Key: DERBY-3566
>                 URL: https://issues.apache.org/jira/browse/DERBY-3566
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Anurag Shekhar
>            Priority: Minor
>         Attachments: derby-3566_v1.diff
>
>
> In 10.3 I can do this:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> 0 rows inserted/updated/deleted
> ij>
> In 10.4 soft upgrade mode I cannot:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> ERROR 42Z20: Column 'V' cannot be made nullable. It is part of a primary key or unique constraint, which cannot have any
> nullable columns.
> ij>

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


[jira] Assigned: (DERBY-3566) Alter column set data type not allowed in soft upgrade with unique constraint

Posted by "Anurag Shekhar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3566?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anurag Shekhar reassigned DERBY-3566:
-------------------------------------

    Assignee: Anurag Shekhar

> Alter column set data type not allowed in soft upgrade with unique constraint
> -----------------------------------------------------------------------------
>
>                 Key: DERBY-3566
>                 URL: https://issues.apache.org/jira/browse/DERBY-3566
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Anurag Shekhar
>            Priority: Minor
>
> In 10.3 I can do this:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> 0 rows inserted/updated/deleted
> ij>
> In 10.4 soft upgrade mode I cannot:
> ij> create table t0 (i int not null, v varchar(1) not null, constraint  uq unique(v,i));
> 0 rows inserted/updated/deleted
> ij> alter table t0 alter v set data type varchar(2);
> ERROR 42Z20: Column 'V' cannot be made nullable. It is part of a primary key or unique constraint, which cannot have any
> nullable columns.
> ij>

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