| Subject | Re: [firebird-support] Re: nulls in unique constraints | 
|---|---|
| Author | Dmitry Yemanov | 
| Post date | 2006-07-01T05:37:19Z | 
"Ann W. Harrison" <aharrison@...> wrote:
FB 1.5 and 2.0, it's possible, but two sets {1, 1, NULL} and {1, 1, NULL}
are considered not distinct, so the second insert violate the constraint.
And this perfectly matches the SQL spec.
Dmitry
            >Why odd? The results are pretty expected.
> Interesting. I wonder what Adam was testing with that
> he got those odd results.
> CONSTRAINT UQ_test UNIQUE (a,b,c)In FB1, he cannot create an unique constraint on nullable fields at all. In
> INSERT INTO TEST (ID, A, B, C) VALUES (1, 1, 1, NULL);
> INSERT INTO TEST (ID, A, B, C) VALUES (2, 1, 1, NULL);
>
> -- above line violates unique constraint.
FB 1.5 and 2.0, it's possible, but two sets {1, 1, NULL} and {1, 1, NULL}
are considered not distinct, so the second insert violate the constraint.
And this perfectly matches the SQL spec.
Dmitry