db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anurag Shekhar (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-3502) Unique Constraint's backing index when shared with existing indexes doesn't behave as expected
Date Thu, 06 Mar 2008 15:22:58 GMT

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

Anurag Shekhar updated DERBY-3502:

    Attachment: derby-3502v1.diff

Description of Derby-3502.diff
This patch fixes backing index related issues described in DERBY-3456. 
There were three problems

1. While creating backing index for unique constraint it was sharing existing
 non unique constraint. This happened because while determining the 
possibility of sharing an index the newly introduced attribute, 
UniqueWithDuplicateNulls was ignored.

2. While creating index descriptor for backing index when the index is shared with another
unique index the newly introduced parameter was ignored. this resulted in creating of a non
unique index when the unique index is dropped.

3. While checking for the need of creation of a new replacement index the new parameter was
ignored. So while dropping the unique constraint a new index 
wasn't created instead the existing index was used if the sharing index was a 
non unique index, This resulted in wrongly enforced uniqueness on non null keys.

I have modified following files to fix these issues 

Modified to use  UniqueWithDuplicateNulls while deciding about sharing indexes.
Modified to pass UniqueWithDuplicateNulls attribute while creating descriptor for unique constraint
even when there is no new index.

In drop method added additional check using UniqueWithDuplicateNulls to see if a new index
is required.

Test case based on Army's descriptions.

> Unique Constraint's backing index when shared with existing indexes doesn't behave as
> ----------------------------------------------------------------------------------------------
>                 Key: DERBY-3502
>                 URL: https://issues.apache.org/jira/browse/DERBY-3502
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>            Reporter: Anurag Shekhar
>            Assignee: Anurag Shekhar
>         Attachments: derby-3502v1.diff
> Unique Constraint now uses non unique backing indexes with new attribute UniqueWithDuplicateNulls.
This index has following sharing properties
> 1. Can use an existing unique index.
> 2. Non Unique indexes (and foreign key) can use this index.
> While dropping a unique index a new index for unique constraint should be created.
> when a unique constraint is dropped a new index for a non unique index or foreign key
should be created. 
> Army has found several issues in actual behavior. This problems are listed in DERBY-3456.

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

View raw message