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-3330) provide support for unique constraint over nullable columns
Date Fri, 18 Jan 2008 10:04:36 GMT

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

Anurag Shekhar updated DERBY-3330:

    Attachment: derby-3330.diff

I am running the tests and will be updating the patch based on the test results.

Description of patch
modified files 

Added new methods to support almost unique index for unique constraint

Added new CreateIndexConstantAction method to support a new parameter (almost unique) for
indexes. This property is stored and used while executing this action.
execute method of this class uses this property to use AlmostUniqueIndexSortObserver and AlmostUniqueMergeSort.
This two classes provide special sorting routine which considers two row as duplicate only
if all the key parts are non null.

changed the scope of few attributes to protected so that AlmostUniqueMergeSort can  access

removed final to allow AlmostUniqueExternalSortFactory to extend from it.
moved creation of MergeSort to a protected method so that extending class 
can return a different class.

added a new property almostUnique and getter and setters for the same.

added a new private method to compare the record with immediate left and right records to
check for duplicate.

added code to store and retrieve new attribute "almostUnique" to the file system.

added property string for AlmostUniqueExternalSortFactory.

Added entry for AlmostUniqueExternalSortFactory.

New files
This class implements duplicate checking routine to reject non null duplicate keys.
This class extends from ExternalSortFactory and overrides getMergeSort methods to return AlmostUniqueMergeSort.

This class extends MergeSort and overrides compare methods to ignore last keypart (location)
while checking for duplicate keys.

> provide support for unique constraint over nullable columns
> -----------------------------------------------------------
>                 Key: DERBY-3330
>                 URL: https://issues.apache.org/jira/browse/DERBY-3330
>             Project: Derby
>          Issue Type: New Feature
>          Components: Store
>    Affects Versions:
>         Environment: all
>            Reporter: Anurag Shekhar
>            Assignee: Anurag Shekhar
>         Attachments: derby-3330.diff
> Allow unique constraint over nullable field. Right now derby support unique constraint
only over not null columns.

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

View raw message