Hi,

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


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

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

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

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

Is it BUG or Behaviour?

Regards,
Deep

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.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