I have this table :
CREATE TABLE IF NOT EXISTS `interlocuteur_fonction` (
`id_interlocuteur_fonction` int(11) NOT NULL AUTO_INCREMENT,
`id_interlocuteur` int(11) NOT NULL,
`id_fonction_interlocuteur` int(11) NOT NULL,
`defaut` varchar(1) NOT NULL,
PRIMARY KEY (`id_interlocuteur_fonction`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2227 ;
When i try this query :
ALTER TABLE `interlocuteur_fonction` engine=InnoDB
I received an error message:
#1025 - Error on rename of './preprod_test/#sql-457_210' to './preprod_test/interlocuteur_fonction' (errno: 150)
Output of SHOW ENGINE INNODB STATUS:
LATEST FOREIGN KEY ERROR
------------------------
130328 12:00:36 Error in foreign key constraint of table
ilang2_test/interlocuteur_fonction:
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 the ones in the referenced table
or one of the ON ... SET NULL columns is declared NOT NULL.
Constraint:
,
CONSTRAINT "interlocuteur_fonction_id_interlocuteur_id_interlocuteur" FOREIGN KEY
("id_interlocuteur") REFERENCES "interlocuteurs" ("id_interlocuteur")
InnoDB: Renaming table `preprod_test`.`#sql-457_1bb` to
`preprod_test`.`interlocuteur_fonction` failed!
Any idea is highly appreciated. Thanks.