Re: InnoDB foreign key constraints

2002-06-10 Thread Heikki Tuuri
Markus, the problem is that name_id is UNSIGNED in the first table and SIGNED in the second. As stated in the manual, integer columns must have the same signedness and size in a foreign key constraint. Regards, Heikki Innobase Oy - Original Message - From: "Markus Lervik" <[EMAIL PROT

RE: InnoDB foreign key constraints

2002-06-10 Thread Wouter van Vliet
on't agree to these terms, you should return this email in no more than 24 hours stating the reason of disagreement. -Oorspronkelijk bericht----- Van: Markus Lervik [mailto:[EMAIL PROTECTED]] Verzonden: maandag 10 juni 2002 10:45 Aan: Kiss Dániel CC: [EMAIL PROTECTED] Onderwerp: Re: Inno

Re: InnoDB foreign key constraints

2002-06-10 Thread Markus Lervik
On Monday 10 Jun 2002 11:44 am, Markus Lervik wrote: > mysql> show create table ip_name_tbl\G > *** 1. row *** >Table: ip_name_tbl > Create Table: CREATE TABLE `ip_name_tbl` ( [snip] > `name_id` int(11) NOT NULL default '0', [snip] > mysq

Re: InnoDB foreign key constraints

2002-06-10 Thread Markus Lervik
On Monday 10 Jun 2002 11:17 am, you wrote: > First of all the referenced key must be on PRIMARY KEY. ...which means my 'id' -field can't be a primary key, right? > But I've seen in your table definition a quite strange thing. You have a > UNIQUE and an ORDINARY key definition on the same field.

Re: InnoDB foreign key constraints

2002-06-10 Thread
Heya! You need an INDEX. Try doing this first : alter table ip_name_tbl add INDEX(name_id); And add then your constraint. EG mysql> SHOW CREATE TABLE ip_name_tbl\G *** 1. row *** Table: ip_name_tbl Create Table: CREATE TABLE `ip_name_tbl

Re: InnoDB foreign key constraints

2002-06-10 Thread Kiss Dániel
First of all the referenced key must be on PRIMARY KEY. But I've seen in your table definition a quite strange thing. You have a UNIQUE and an ORDINARY key definition on the same field. Here: ... > UNIQUE KEY `name_id` (`name_id`), <- THIS IS THE FIRST DEFINITION > UNIQUE KEY `comp_name` (`

Re: InnoDB Foreign Key Constraints

2002-05-13 Thread Heikki Tuuri
Daniel, - Original Message - From: "Daniel Rand" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Monday, May 13, 2002 5:24 PM Subject: InnoDB Foreign Key Constraints > Hi, > > Does anyone know if it's possible to set up a foreign key constraint where > one table references