[Db] UK e NULL
Giovanni R.
linfo2003 a libero.it
Sab 2 Giu 2007 14:01:07 CEST
Domenico L. wrote:
> scopro a mie spese che per mysql (ver 4.0) che i campi facenti parte
> di un Unique index se valorizzati a null estromettono il record in
> questione dal controllo di univocità.... che bello....
A suo tempo non fu una bella scoperta neppure per me. :-(
Standard SQL-92:
"A unique constraint is satisfied if and only if no two rows in a table
have the same non-null values in the unique columns."
Standard SQL-2003:
"If there are no two rows in T such that the value of each column in one
row is non-null and is not distinct from the value of the corresponding
column in the other row, then the result of the <unique predicate> is
True; otherwise, the result of the <unique predicate> is False."
cfr. http://bugs.mysql.com/bug.php?id=8173
(l'avevano riportato come bug, ma non lo è)
Ciao, Giovanni
Maggiori informazioni sulla lista
Db