db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen (JIRA) <j...@apache.org>
Subject [jira] Commented: (DERBY-2212) Add "Unique where not null" to create index
Date Thu, 22 Nov 2007 13:59:43 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544809
] 

Øystein Grøvlen commented on DERBY-2212:
----------------------------------------

Thanks, for the updated func spec, Anurag.

I agree with the others who have commented that it would be good if
you also include some implementation notes in your spec.  

I do not see that you have addressed my previous comments from Oct 31:

  - I would still like that you explicitly state whether you propose
    to keep the existing behavior for unique index.

  - I still have a hard time understanding the section on hard
    upgrade.  What do you mean by "No update will be required ..."?
    Update of what?  What is the difference between what is stated in
    the second sentence and in the first part of the third sentence?

Some comments on the test case section: 

   - I also think you should test updates that change column values
     to/from null, not just inserts.

   - I do not understand what you mean by testing "null
     ordering of unique constraints".  

   - I would think adding of not null constraints also need to be
     tested.  

   - You will probably also need some upgrade tests.



> Add "Unique where not null" to create index
> -------------------------------------------
>
>                 Key: DERBY-2212
>                 URL: https://issues.apache.org/jira/browse/DERBY-2212
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.2.1.6
>            Reporter: Oleksandr Alesinskyy
>            Assignee: Anurag Shekhar
>         Attachments: derby-2212preview.diff, derby-2212preview2.diff, FunctionalSpec.html,
FunctionalSpecV3.html, FunctionalSpecV3_comment.html, FunctionlaSpecv2.html
>
>
> Derby prohibits creation of unique constraints on nullable colums (as well if only some
columns in the constraint list are nullable) and treat nulls in unique indexes as normal values
(i.e. only one row with null values in indexed columns may be inserted into the table). This
bahavior is very restrictive, does not completely comply with SQL standards (both letter and
intent) as well as with business needs and intending meaning of NULL values (2 null values
are not considered as equal, this comparision shall return NULL, and for selection criteria
boolean null is treated as FALSE).
> This behavior, as far as I can see, is modelled after DB2 (and differs from behavior
of most other major databases, like SyBase, Oracle, etc.).
> But even DB2 provide some means to alleviate these restrictions, namely "UNIQUE WHERE
NOT NULL" clause for CREATE INDEX statement.
> It will be very good if such "UNIQUE WHERE NOT NULL" clause will be introduced in Derby.
> Regards,
> Oleksandr Alesinskyy

-- 
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