Bug #23583 | ERROR 1005 ON ALTER TABLE | ||
---|---|---|---|
Submitted: | 24 Oct 2006 15:31 | Modified: | 25 Oct 2006 8:21 |
Reporter: | Filippo Monti | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.1.11-beta | OS: | Windows (Windows) |
Assigned to: | CPU Architecture: | Any | |
Tags: | 1005, error |
[24 Oct 2006 15:31]
Filippo Monti
[24 Oct 2006 15:44]
MySQL Verification Team
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html
[25 Oct 2006 8:21]
Filippo Monti
The problem arises because "id" is declared unsigned but not "gruppo_padre_id" I've resolved the problem in this manner: /* Formatted on 2006/10/25 10:16 (QP5 v5.50) */ CREATE TABLE `sg_gruppi` ( `id` int(9) unsigned NOT NULL AUTO_INCREMENT, `codice` varchar(12) NOT NULL, `descrizione` varchar(35) NOT NULL, `des_cassa` varchar(18) DEFAULT NULL, `gruppo_padre_id` int(9) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_gruppi_gruppo_padre` (`gruppo_padre_id`), CONSTRAINT `fk_gruppi_gruppo_padre` FOREIGN KEY (`gruppo_padre_id`) REFERENCES `sg_gruppi` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Thank's Filippo