[ 
https://issues.apache.org/jira/browse/DERBY-3330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573084#action_12573084
 ] 

Daniel John Debrunner commented on DERBY-3330:
----------------------------------------------

I think the upgrade handling of IndexDescriptorImpl is too complex.

IndexDescriptorImpl uses a FormatableHashtable to store some of its state, the 
format of this can handle additional or missing keys. Thus the additional 
boolean required by this change can simply be added to the hash table, so the 
writeExternal has an additional:

     fh.putBoolean ("isUniqueWhenNotNull", isUniqueWhenNotNull);

and the readExternal can have:

   if (fh.containsKey("isUniqueWhenNotNull")
       isUniqueWhenNotNull = fh.getBoolean("isUniqueWhenNotNull");
   else
       isUniqueWhenNotNull = ?? ; // what ever is the correct value for old 
indexes.

Of course good to comment the real code with when & why these changes were made.

> 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: 10.4.0.0
>         Environment: all
>            Reporter: Anurag Shekhar
>            Assignee: Anurag Shekhar
>         Attachments: BTreeController.diff, derby-3330-testcase.diff, 
> derby-3330.diff, derby-3330v10.diff, derby-3330v2.diff, derby-3330v3.diff, 
> derby-3330v4.diff, derby-3330v5.diff, derby-3330v6.diff, derby-3330v7.diff, 
> derby-3330v8.diff, derby-3330v9.diff, FunctionalSpec_DERBY-3330-V2.html, 
> FunctionalSpec_DERBY-3330.html, UniqueConstraint_Implementation.html, 
> UniqueConstraint_Implementation_V2.html, 
> UniqueConstraint_Implementation_V3.html
>
>
> 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.

Reply via email to