MySQL Forums
Forum List  »  InnoDB

Error code 1025 when dropping Primary Key with no exported FKs
Posted by: Bradley Wagner
Date: June 28, 2008 02:21PM

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.

Options: ReplyQuote


Subject
Views
Written By
Posted
Error code 1025 when dropping Primary Key with no exported FKs
5237
June 28, 2008 02:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.