Hi, I'm running into a weird error. I'm running MySQL 5.0.22 on a Fedore Core machine.
I have a table called cxml_foldercontent with (among others) these columns:
- id
- referenceFileId (used to reference cxml_foldercontent.id)
I'm trying to execute: ALTER TABLE cxml_foldercontent DROP PRIMARY KEY
and getting the error:
ERROR 1025 (HY000): Error on rename of './production/#sql-f3d_8a5ab' to './production/cxml_foldercontent' (errno: 150)
The command: "show engine innodb status" tells me:
080628 16:18:06 Error in foreign key constraint of table production/#sql-2f22_2078fd:
there is no index in referenced table which would contain
the columns as the first columns, or the data types in the
referenced table do not match to the ones in table. Constraint:
,
CONSTRAINT #sql-2f22_2078fd_ibfk_56 FOREIGN KEY (referenceFileId) REFERENCES cxml_foldercontent (id) ON DELETE SET NULL
The index in the foreign key in table is referenceFileId
See
http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html
but I've used both Java's DatabaseMetadata and "show create table cxml_foldercontent" to verify that there is not a Foreign Key on the referenceFileId column anymore at all, nor any remaining indices.
I'm thinking this is a MySQL bug.
Edited 2 time(s). Last edit at 06/28/2008 02:23PM by Bradley Wagner.