strange unique index behaviour on null values

mehdi <[email protected]>
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
hi all,

I get a very strange result from mysql when selecting null values from a 
unique indexed innodb table.

so this is the structure and content of my table:

##################################
CREATE TABLE `testunique` (
  `id` varchar(10) default NULL,
  `a` char(2) NOT NULL default '',
  `b` char(2) NOT NULL default '',
  UNIQUE KEY `id` (`id`)
) TYPE=InnoDB;

INSERT INTO `testunique` VALUES (NULL, 'e', 'f');
INSERT INTO `testunique` VALUES (NULL, 'v', 's');
INSERT INTO `testunique` VALUES (NULL, 'r', 's');
INSERT INTO `testunique` VALUES ('eee', 'f', 'f');
##################################

now, if I do a 

##################################
select * from testunique where id is null
##################################

I always get only the first row.
If I remove the unique index then I get the expected result. also there is no problem if I use myisam.
I am using mysql 4.0.16 on a debian box.

thanks for your help.

bye




-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.