Bug #9158 | REPLACE can duplicate on a UNIQUE index | ||
---|---|---|---|
Submitted: | 14 Mar 2005 6:15 | Modified: | 14 Mar 2005 8:05 |
Reporter: | B Jones | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.9 | OS: | Linux (Linux) |
Assigned to: | CPU Architecture: | Any |
[14 Mar 2005 6:15]
B Jones
[14 Mar 2005 7:06]
Sergei Golubchik
It's a duplicate of bug#6829. See http://bugs.mysql.com/bug.php?id=6829 for details
[14 Mar 2005 8:05]
Heikki Tuuri
Hi! The Oracle behavior is more complex than I knew. For a single-column UNIQUE index Oracle DOES allow several null rows. But for a multi-column UNIQUE index it does only allow several null rows if ALL the columns in the index columns are null! Regards, Heikki http://www-rohan.sdsu.edu/doc/oracle/server803/A54643_01/ch7.htm " Combining UNIQUE Key and NOT NULL Integrity Constraints In Figure 23-3 and Figure 23-4, UNIQUE key constraints allow the input of nulls unless you also define NOT NULL constraints for the same columns. In fact, any number of rows can include nulls for columns without NOT NULL constraints because nulls are not considered equal to anything. A null in a column (or in all columns of a composite UNIQUE key) always satisfies a UNIQUE key constraint. Columns with both unique keys and NOT NULL integrity constraints are common. This combination forces the user to enter values in the unique key and also eliminates the possibility that any new row's data will ever conflict with an existing row's data. Note: Because of the search mechanism for UNIQUE constraints on more than one column, you cannot have identical values in the non-null columns of a partially null composite UNIQUE key constraint. "