Subject Re: [firebird-support] Unique index NULL == NULL?
Author Helen Borrie
At 08:29 PM 12/11/2003 -0500, you wrote:
>Thanks for your response, Helen. I have a follow up question:
>
>At 06:18 PM 11/12/2003, you wrote:
> >In this case, the condition UNIQUE can not be True if ( SELECT UCL FROM TN
> >) could output two rows having all segments non-null and all of the
> >corresponding segments matching.
>
>This seems to indicate to me that (1, NULL, NULL) <> (1, NULL,
>NULL), because all segments are not non-null. Is that correct?

It is supposed to be. However, a bug seems to have shown up. I suggest
you watch the thread in firebird-devel, 'Bug in Unique with Nulls'.


> >For multi-column result sets of (
> >SELECT UCL FROM TN ), the common rules for NULLs are applied, i.e. (1,
> >NULL) is distinct from (NULL, 1) and one (NULL, NULL) is distinct from any
> >other (NULL, NULL).
>
>But is (1, NULL) distinct from (1, NULL)?

Yes, it is supposed to be - but see the earlier comment about a putable bug.


>In a test case, if I have a unique constraint on three columns, and I
>insert (NULL, NULL, NULL), I can do this repeatedly. But if I insert (1,
>NULL, NULL) a second time, I get a constraint violation.

Correct observation, incorrect behaviour. You would help if you would join
the thread and confirm your observation, along with your test
findings. You will need to subscribe to the list:

<mailto: firebird-devel-request@...?subject=subscribe>


heLen