MySQL Forums
Forum List  »  InnoDB

errno 150 - foreign key problems
Posted by: Paul Blazek
Date: June 09, 2006 03:50PM

I'm using 5.0.19 on Linux and MySQL Admin 1.1.9. I was changing column names in some tables with foreign key references, and I am now at the point that I cannot change a table from MyISAM to InnoDB due to a non-existant foreign key constraint. SHOW CREATE TABLE FUN_Function yields:

CREATE TABLE `FUN_Function` (
`FUNlFunctionKey` int(11) NOT NULL default '0',
`FUNvc255Description` varchar(255) collate latin1_general_ci NOT NULL default '',
`FUNTCOlFunctionAccessKey` int(11) NOT NULL default '0',
`FUNvc50Group1` varchar(50) collate latin1_general_ci default NULL,
`FUNvc50Group2` varchar(50) collate latin1_general_ci default NULL,
PRIMARY KEY (`FUNlFunctionKey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci

yet when I try to ALTER TABLE FUN_Function ENGINE=InnoDB the result is:

ERROR 1025 (HY000): Error on rename of './TXCAD/#sql-5912_86' to './TXCAD/FUN_Function' (errno: 150)

and SHOW INNODB STATUS yields:

LATEST FOREIGN KEY ERROR
------------------------
060609 17:45:48 Error in foreign key constraint of table TXCAD/FUN_Function:
there is no index in the table which would contain
the columns as the first columns, or the data types in the
table do not match to the ones in the referenced table. Constraint:
,
CONSTRAINT FK_FUN_Function_COD_Code FOREIGN KEY (FUNCODlFunctionAccessKey) REFERENCES COD_Code (CODlCodeKey)

This FK reference is left over from before I made changes to the column names, but nothing I do seems to get rid of the CONSTRAINT. Suggestions, please?

Options: ReplyQuote


Subject
Views
Written By
Posted
errno 150 - foreign key problems
57606
June 09, 2006 03:50PM
9432
December 07, 2006 07:28AM
5907
October 07, 2008 05:55PM


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.