Re: strange unique index behaviour on null values
Sergei Golubchik <[email protected]>
| Newsgroups | gmane.comp.db.mysql.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hi!
Looks like a bug#2483.
http://bugs.mysql.com/bug.php?id=2483
Use this url to follow the progress of this issue.
(you may also add your test case there)
On Jan 26, mehdi wrote:
> 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
>
Regards,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <[email protected]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com
--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/[email protected]