Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
A colleague had lots of fun debugging this table:
CREATE TABLE `mail` (
`mail_id` int(11) unsigned NOT NULL auto_increment,
`user` varchar(64) default NULL,
`mail_type_id` int(10) unsigned NOT NULL,
`domain_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`mail_id`),
KEY `mail_type_id` (`mail_type_id`),
KEY `domain_id` (`domain_id`,`user`),
CONSTRAINT `mail_ibfk_2` FOREIGN KEY (`mail_type_id`) REFERENCES
`mail_type` (`mail_type_id`) ON UPDATE CASCADE,
CONSTRAINT `mail_ibfk_4` FOREIGN KEY (`domain_id`) REFERENCES `domain`
(`domain_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
And after much debugging of a particular problem, ran into this:
mysql> select * from mail where mail_type_id = 6 and user = '';
+---------+------+--------------+-----------+
| mail_id | user | mail_type_id | domain_id |
+---------+------+--------------+-----------+
| 25006 | NULL | 6 | 28 |
| 25008 | NULL | 6 | 3728 |
...
| 4603476 | NULL | 6 | 13579 |
| 4603507 | NULL | 6 | 3511 |
+---------+------+--------------+-----------+
364 rows in set (0.00 sec)
How the heck is a NULL value equal to the empty string?
NULL values are not allowed in indexes, so it sort of looks like MySQL is using the empty string for the index value but returning the correct 'NULL' value for the field when displayed. Damn.
$ mysql --version
mysql Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i686) using
readline 5.0
Index? (Score:2)
You don't have index for 'user' column so it must be something else.
Ilya Martynov (http://martynov.org/ [martynov.org])
Re: (Score:2)
There's a key with the user column.
What am I misunderstanding?
Re: (Score:2)
Ilya Martynov (http://martynov.org/ [martynov.org])
Re: (Score:2)
Ilya Martynov (http://martynov.org/ [martynov.org])
corrupted database? (Score:2)
mysql> show create table mail\G*************************** 1. row ***************************
Table: mail
Create Table: CREATE TABLE `mail` (
`mail_id` int(11) unsigned NOT NULL auto_increment,
`user` varchar(64) default NULL,
`mail_type_id` int(10) unsigned NOT NULL,
`domain_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`mail_id`),
KEY `mail_type_id` (`mail_type_id`),
KEY `domain_id` (`domain_id`,`user`)
) ENGINE=InnoDB AUTO_INCREMENT=25
Ilya Martynov (http://martynov.org/ [martynov.org])
Re: (Score:1)
I can reproduce by the following:
mysql> CREATE TABLE `foo` (
-> `mail_id` int(11) unsigned NOT NULL auto_increment,
`user` varchar(64) default NULL,
-> `user` varchar(64) default NULL,
-> `mail_type_id` int(10) unsigned NOT NULL,
-> `domain_id`
Oracle like feature? (Score:2)
Ilya Martynov (http://martynov.org/ [martynov.org])
Re: (Score:1)
Re: (Score:2)
Ilya Martynov (http://martynov.org/ [martynov.org])
Known mysql bug (Score:2)
Ilya Martynov (http://martynov.org/ [martynov.org])