Pierre, I tested this with versions 3.23.46 and .48 on Linux and they worked ok:
mysql> CREATE TABLE FIRST (NAME VARCHAR(15), COD VARCHAR(10) NOT NULL, PRIMARY -> KEY(COD)) TYPE=INNODB; Query OK, 0 rows affected (0.02 sec) mysql> CREATE TABLE SECOND (ID INT NOT NULL, F_COD VARCHAR(10), PRIMARY -> KEY(ID), INDEX PAR_IND(F_COD), FOREIGN KEY(F_COD) REFERENCES FIRST(COD)) -> TYPE=INNODB; Query OK, 0 rows affected (0.04 sec) mysql> But on Windows there was bug in database case in some earlier versions. See http://www.innodb.com/bugfixes.html Are you running on Windows? Check also with SHOW TABLE STATUS that the table FIRST was really created in your test. Best regards, Heikki Tuuri Innobase Oy --- Order technical MySQL/InnoDB support at https://order.mysql.com/ See http://www.innodb.com for the online manual and latest news on InnoDB Pierre Radulescu wrote in message ... >Hi, > >I am trying two create two innodb tables: > >1. >CREATE TABLE FIRST (NAME VARCHAR(15), COD VARCHAR(10) NOT NULL, PRIMARY >KEY(COD)) TYPE=INNODB; > >2. >CREATE TABLE SECOND (ID INT NOT NULL, F_COD VARCHAR(10), PRIMARY >KEY(ID), INDEX PAR_IND(F_COD), FOREIGN KEY(F_COD) REFERENCES FIRST(COD)) >TYPE=INNODB; > >The second table cannot be created (errno: 150) > >Thanks in advance for help! > >Pierre --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php