It is expected behavior, you can make the unique key a primary key
instead. This should prevent this situation.

Ed 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 11, 2006 7:42 AM
To: mysql@lists.mysql.com
Subject: UNIQUE KEY vs NULLs

Hi,

I have an InnoDB table similar to this:

CREATE TABLE Target
(IMSI VARCHAR(15) ASCII,
 IMEI VARCHAR(15) ASCII,
 UNIQUE KEY (IMSI, IMEI));

After playing a bit with it, I managed to add duplicate records, if one
of
the fields was a NULL:

+-----------------+-----------------+
| IMSI            | IMEI            |
+-----------------+-----------------+
| NULL            | 35195600126418  |
| NULL            | 35195600126418  |
+-----------------+-----------------+


Is this a bug, or a feature? :-)

If it is a feature, than how can I assure uniqueness for a table in a
sense
that won't allow such duplicates?

Thx

ImRe



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to