deep,
Thursday, September 19, 2002, 2:28:07 PM, you wrote:

dk> I am using MySQL 4.0.3 and Innodb tables for my
dk> application,  I have created a unique index on
dk> multiple column but its not working, here is sql
dk> script to generate an bug


dk> CREATE TABLE TESTING
dk> (
dk> ID INT AUTO_INCREMENT NOT NULL PRIMARY KEY ,
dk> FLD1 VARCHAR(100) NOT NULL ,
dk> FLD2 VARCHAR(15) NOT NULL,
dk> FLD3 INT NOT NULL ,
dk> FLD4 INT NOT NULL ,
dk> FLD5 INT NULL
dk> )TYPE=InnoDB;

dk> CREATE UNIQUE INDEX IX_FLD12345_TESTING ON TESTING
dk> (FLD1,FLD2,FLD3,FLD4,FLD5);

dk> INSERT INTO TESTING (FLD1,FLD2,FLD3,FLD4,FLD5)
dk> VALUES("A","B",1,2,NULL), ("A","B",1,2,NULL);

dk> Above INSERT statment tries to insert duplicate
dk> records and though UNIQUE INDEX is created it allows
dk> it. 
dk> Problem is with NULL value, if any of the index field
dk> contains NULL than only this bug is generated.

dk> Is it BUG or Behaviour?

It's not a bug, it's a behaviour feature. UNIQUE can has multiple NULL values.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to