Bug #12432 | Crash on SELECT with unusual condition on foreign key | ||
---|---|---|---|
Submitted: | 8 Aug 2005 12:17 | Modified: | 9 Aug 2005 6:53 |
Reporter: | Tobias Hofer | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.11 | OS: | Linux (Debian GNU/Linux (Sarge)) |
Assigned to: | Bugs System | CPU Architecture: | Any |
[8 Aug 2005 12:17]
Tobias Hofer
[8 Aug 2005 15:00]
Tobias Hofer
Corrected synopsis from '..unusable..' to '..unusual..'.
[9 Aug 2005 5:58]
Jan Lindström
Thank you for your bug report. However I can't repeat this bug using 4.1.14bk. mysql> CREATE TABLE `Parent` ( -> `id` bigint(20) NOT NULL auto_increment, -> PRIMARY KEY (`id`) -> ) ENGINE=InnoDB; Query OK, 0 rows affected (0.01 sec) mysql> CREATE TABLE `Child` ( -> `id` bigint(20) NOT NULL auto_increment, -> `parent` bigint(20) NOT NULL default '0', -> PRIMARY KEY (`id`), -> KEY `parent` (`parent`), -> CONSTRAINT `Child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `Parent` (`id`) ON -> DELETE CASCADE -> ) ENGINE=InnoDB; Query OK, 0 rows affected (0.01 sec) mysql> SELECT * FROM Child AS c LEFT JOIN Parent AS p ON c.parent=p.id WHERE -> p.id=-1; Empty set (0.00 sec) Could you provide contents of tables Child and Parent as small as possible using mysqldump. Regards Jan
[9 Aug 2005 6:30]
Tobias Hofer
There's no need for any content. It looks like the crash is caused by the where clause (with a negative test value)
[9 Aug 2005 6:53]
Jan Lindström
I can't repeat this bug using current release. Please consider upgrading to 4.1.13. mysql> CREATE TABLE `Parent` (`id` bigint(20) NOT NULL auto_increment, -> PRIMARY KEY (`id`)) ENGINE=InnoDB; Query OK, 0 rows affected (0.01 sec) mysql> CREATE TABLE `Child` (`id` bigint(20) NOT NULL auto_increment, -> `parent` bigint(20) NOT NULL default '0', PRIMARY KEY (`id`), -> KEY `parent` (`parent`), -> CONSTRAINT `Child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `Parent` (`id`) ON DELETE CASCADE) ENGINE=InnoDB; Query OK, 0 rows affected (0.01 sec) mysql> insert into Parent values(-1); Query OK, 1 row affected (0.01 sec) mysql> insert into Child values(null,-1); Query OK, 1 row affected (0.00 sec) mysql> commit; Query OK, 0 rows affected (0.00 sec) mysql> insert into Parent values(2); Query OK, 1 row affected (0.01 sec) mysql> insert into Child values(null,2); Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM Child AS c LEFT JOIN Parent AS p ON c.parent=p.id WHERE -> p.id=-1; +----+--------+----+ | id | parent | id | +----+--------+----+ | 1 | -1 | -1 | +----+--------+----+ 1 row in set (0.00 sec) Regards, Jan