ERROR 1005 (HY000): (errno: 150) details for show create table andinnodb status given

ERROR 1005 (HY000): (errno: 150) details for show create table andinnodb status given

am 22.02.2011 19:00:24 von hari jayaram

--20cf3054ac132b7075049ce2c1bc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi I am getting a Foreign key error .

The command that gives the error is

ALTER TABLE child ADD CONSTRAINT child_parent_fk FOREIGN KEY (id) REFERENCE=
S
parent(id) ON DELETE NO ACTION ON UPDATE NO ACTION;

And the error message is

ERROR 1005 (HY000): Can't create table
'./testforeignkeysyntax_lap/#sql-1515_130f.frm' (errno: 150)

I have attached the create table syntax for both the parent and child table=
s
and the innodb status below. I am quite a newbie and want to know what I am
doing wrong.
My mysql version is mysql Ver 14.12 Distrib 5.0.51b, for
apple-darwin9.0.0b5 (i686) using readline 5.0

Thanks for your help

Hari


mysql> show create TABLE parent;
+--------+-------------------------------------------------- ---------------=
------------------------------------------------------------ --------+
| Table | Create Table
|
+--------+-------------------------------------------------- ---------------=
------------------------------------------------------------ --------+
| parent | CREATE TABLE `parent` (
`id` varchar(128) default NULL,
`name` varchar(256) default NULL
) ENGINE=3DInnoDB DEFAULT CHARSET=3Dlatin1 |
+--------+-------------------------------------------------- ---------------=
------------------------------------------------------------ --------+
1 row in set (0.00 sec)


mysql> show create TABLE child;
+-------+--------------------------------------------------- ---------------=
------------------------------------------------------------ ----+
| Table | Create Table
|
+-------+--------------------------------------------------- ---------------=
------------------------------------------------------------ ----+
| child | CREATE TABLE `child` (
`toy` varchar(64) default NULL,
`id` varchar(128) default NULL
) ENGINE=3DInnoDB DEFAULT CHARSET=3Dlatin1 |
+-------+--------------------------------------------------- ---------------=
------------------------------------------------------------ ----+
1 row in set (0.00 sec)



mysql> ALTER TABLE child ADD CONSTRAINT child_parent_fk FOREIGN KEY (id)
REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE NO ACTION;
ERROR 1005 (HY000): Can't create table
'./testforeignkeysyntax_lap/#sql-1515_130f.frm' (errno: 150)



mysql> show innodb status;
+----------------------------------------------------------- ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
---------------------------------+
| Status












|
+----------------------------------------------------------- ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
---------------------------------+
|
==================== =====3D=
============
110222 12:55:47 INNODB MONITOR OUTPUT
==================== =====3D=
============
Per second averages calculated from the last 53 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 45, signal count 45
Mutex spin waits 0, rounds 40, OS waits 2
RW-shared spins 84, OS waits 42; RW-excl spins 1, OS waits 1
------------------------
LATEST FOREIGN KEY ERROR
------------------------
110222 12:54:53 Error in foreign key constraint of table
bioscreencast_lap/#sql-1515_130f:
FOREIGN KEY (id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE NO
ACTION:
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint.
Note that the internal storage type of ENUM and SET changed in
tables created with >=3D InnoDB-4.1.12, and such columns in old tables
cannot be referenced by such columns in new tables.
See
http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-co nstraints.html
for correct foreign key definition.
------------
TRANSACTIONS
------------
Trx id counter 0 15987
Purge done for trx's n:o < 0 15982 undo n:o < 0 0
History list length 3
Total number of lock structs in row lock hash table 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, OS thread id 2957864960
MySQL thread id 4879, query id 6565 localhost root
show innodb status
---TRANSACTION 0 15877, not started, OS thread id 2955325440
MySQL thread id 4859, query id 6230 localhost root
---TRANSACTION 0 0, not started, OS thread id 2957660160
MySQL thread id 4870, query id 6176 localhost root
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
54 OS file reads, 433 OS file writes, 183 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.17 writes/s, 0.06 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2,
0 inserts, 0 merged recs, 0 merges
Hash table size 34679, used cells 0, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 0 3789251
Log flushed up to 0 3789251
Last checkpoint at 0 3789251
0 pending log writes, 0 pending chkp writes
96 log i/o's done, 0.02 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 17436514; in additional pool allocated 982784
Buffer pool size 512
Free buffers 446
Database pages 65
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 60, created 5, written 491
0.00 reads/s, 0.00 creates/s, 0.23 writes/s
Buffer pool hit rate 1000 / 1000
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread id 2957045760, state: waiting for server activity
Number of rows inserted 0, updated 1, deleted 0, read 22199
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
==================== =====3D=
===3D
|
+----------------------------------------------------------- ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
---------------------------------+
1 row in set, 1 warning (0.00 sec)

--20cf3054ac132b7075049ce2c1bc--

Re: ERROR 1005 (HY000): (errno: 150) details for show create tableand innodb status given

am 22.02.2011 20:02:13 von shawn.l.green

Hello Hari,

You already posted the best answer we could provide :)

On 2/22/2011 13:00, hari jayaram wrote:
> Hi I am getting a Foreign key error .
> ...
> I have attached the create table syntax for both the parent and child tables
> and the innodb status below. ...
> mysql> show innodb status;
> +----------------------------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------
------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ---------
------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ --------------------
------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ----------
------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ --------------------
------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ----------
------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------+
> | Status...
> |

> ------------------------
> LATEST FOREIGN KEY ERROR
> ------------------------
> 110222 12:54:53 Error in foreign key constraint of table
> bioscreencast_lap/#sql-1515_130f:
> FOREIGN KEY (id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE NO
> ACTION:
> Cannot find an index in the referenced table where the
> referenced columns appear as the first columns, or column types
> in the table and the referenced table do not match for constraint.
> Note that the internal storage type of ENUM and SET changed in
> tables created with>= InnoDB-4.1.12, and such columns in old tables
> cannot be referenced by such columns in new tables.
> See
> http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-co nstraints.html
> for correct foreign key definition.

To rephrase, a little: Columns must be indexed before they can
participate in Foreign Keys.

See the link you provided for more details.
--
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: ERROR 1005 (HY000): (errno: 150) details for show create tableand innodb status given

am 22.02.2011 20:13:22 von hari jayaram

--20cf3043477e1b6e9a049ce3c6d6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks shawn for your reply. Your simplification of the innodb status
message and this post which I just read (http://lists.mysql.com/mysql/22190=
0
)
tells me what I am doing wrong.

I need the referenced column to be indexed. I guess one way of ensuring tha=
t
is to declare it as a primary key .

So when I changed my example to do this:

mysql> create TABLE parent ( id int(16) , name varchar(128), primary key
(id))ENGINE=3DInnodb;

mysql> create TABLE child ( id int(16) , name varchar(128), parent_id
int(16))ENGINE=3DInnodb;

mysql> ALTER TABLE child ADD CONSTRAINT child_parent_id_fk FOREIGN KEY
(parent_id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE NO ACTION;
Query OK, 0 rows affected (0.22 sec)
Records: 0 Duplicates: 0 Warnings: 0


And everything works


Hari

On Tue, Feb 22, 2011 at 2:02 PM, Shawn Green (MySQL) <
shawn.l.green@oracle.com> wrote:

> Hello Hari,
>
> You already posted the best answer we could provide :)
>
>
> On 2/22/2011 13:00, hari jayaram wrote:
>
>> Hi I am getting a Foreign key error .
>> ...
>>
>> I have attached the create table syntax for both the parent and child
>> tables
>> and the innodb status below. ...
>> mysql> show innodb status;
>>
>> +----------------------------------------------------------- ------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
---------------
>>
>
> ------------------------------------------------------------ -------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
-----------------
>
> ------------------------------------------------------------ -------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
-----------------
>
> ------------------------------------------------------------ -------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ --------+
>
>> | Status...
>> |
>>
>
> ------------------------
>> LATEST FOREIGN KEY ERROR
>> ------------------------
>> 110222 12:54:53 Error in foreign key constraint of table
>> bioscreencast_lap/#sql-1515_130f:
>> FOREIGN KEY (id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE NO
>> ACTION:
>> Cannot find an index in the referenced table where the
>> referenced columns appear as the first columns, or column types
>> in the table and the referenced table do not match for constraint.
>> Note that the internal storage type of ENUM and SET changed in
>> tables created with>=3D InnoDB-4.1.12, and such columns in old tables
>> cannot be referenced by such columns in new tables.
>> See
>> http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-co nstraints.ht=
ml
>> for correct foreign key definition.
>>
>
> To rephrase, a little: Columns must be indexed before they can participat=
e
> in Foreign Keys.
>
> See the link you provided for more details.
> --
> Shawn Green
> MySQL Principal Technical Support Engineer
> Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
> Office: Blountville, TN
>

--20cf3043477e1b6e9a049ce3c6d6--

Re: ERROR 1005 (HY000): (errno: 150) details for show create tableand innodb status given

am 22.02.2011 20:22:41 von hari jayaram

--20cf30549b4976c3df049ce3e7cd
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Sorry for another email. But this is just to expand on what SHawn said..I
could also have created an index and then referenced the column.


So without a primary key. I can create the parent , then create the child
and the index .

mysql> create TABLE parent ( id int(16) , name varchar(128))ENGINE=3DInnodb=
;


mysql>create TABLE child ( id int(16) , name varchar(128), parent_id
int(16))ENGINE=3Dinnodb;


mysql> create index parent_id_fk ON parent (id);

And now the foreign key constraint works:

mysql> ALTER TABLE child ADD CONSTRAINT child_parent_id_fk FOREIGN KEY
parent_id_fk (parent_id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDAT=
E
NO ACTION;
Query OK, 0 rows affected (0.24 sec)
Records: 0 Duplicates: 0 Warnings: 0

Thanks for your prompt help.

Hari

On Tue, Feb 22, 2011 at 2:13 PM, hari jayaram wrote:

> Thanks shawn for your reply. Your simplification of the innodb status
> message and this post which I just read (
> http://lists.mysql.com/mysql/221900)
> tells me what I am doing wrong.
>
> I need the referenced column to be indexed. I guess one way of ensuring
> that is to declare it as a primary key .
>
> So when I changed my example to do this:
>
> mysql> create TABLE parent ( id int(16) , name varchar(128), primary key
> (id))ENGINE=3DInnodb;
>
> mysql> create TABLE child ( id int(16) , name varchar(128), parent_id
> int(16))ENGINE=3DInnodb;
>
> mysql> ALTER TABLE child ADD CONSTRAINT child_parent_id_fk FOREIGN KEY
> (parent_id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE NO ACTION=
;
> Query OK, 0 rows affected (0.22 sec)
> Records: 0 Duplicates: 0 Warnings: 0
>
>
> And everything works
>
>
> Hari
>
> On Tue, Feb 22, 2011 at 2:02 PM, Shawn Green (MySQL) <
> shawn.l.green@oracle.com> wrote:
>
>> Hello Hari,
>>
>> You already posted the best answer we could provide :)
>>
>>
>> On 2/22/2011 13:00, hari jayaram wrote:
>>
>>> Hi I am getting a Foreign key error .
>>> ...
>>>
>>> I have attached the create table syntax for both the parent and child
>>> tables
>>> and the innodb status below. ...
>>> mysql> show innodb status;
>>>
>>> +----------------------------------------------------------- -----------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
----------------
>>>
>>
>> ------------------------------------------------------------ ------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------
>>
>> ------------------------------------------------------------ ------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------
>>
>> ------------------------------------------------------------ ------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------------=
------------------------------------------------------------ ---------+
>>
>>> | Status...
>>> |
>>>
>>
>> ------------------------
>>> LATEST FOREIGN KEY ERROR
>>> ------------------------
>>> 110222 12:54:53 Error in foreign key constraint of table
>>> bioscreencast_lap/#sql-1515_130f:
>>> FOREIGN KEY (id) REFERENCES parent(id) ON DELETE NO ACTION ON UPDATE N=
O
>>> ACTION:
>>> Cannot find an index in the referenced table where the
>>> referenced columns appear as the first columns, or column types
>>> in the table and the referenced table do not match for constraint.
>>> Note that the internal storage type of ENUM and SET changed in
>>> tables created with>=3D InnoDB-4.1.12, and such columns in old tables
>>> cannot be referenced by such columns in new tables.
>>> See
>>>
>>> http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-co nstraints.h=
tml
>>> for correct foreign key definition.
>>>
>>
>> To rephrase, a little: Columns must be indexed before they can participa=
te
>> in Foreign Keys.
>>
>> See the link you provided for more details.
>> --
>> Shawn Green
>> MySQL Principal Technical Support Engineer
>> Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
>> Office: Blountville, TN
>>
>
>

--20cf30549b4976c3df049ce3e7cd--