On Thu, Nov 19, 2009 at 9:34 PM, Ye Yuan yuan4...@gmail.com wrote:
Hi Victor,
It looks to me the foreign key syntax is wrong. Can you create the
Relationship table on your database by using below ddl?
create table if not exists Relationship
(ID integer auto_increment primary key,
Parent
Hi, Martijn, Gavin.
SHOW INNODB STATUS gave me helpful messages like following:
LATEST FOREIGN KEY ERROR
090821 12:53:18 Error in foreign key constraint of table test_fk/tbl1:
FOREIGN KEY (`col1` , `col2` , `col3` )
REFERENCES
Hi,
I can't create InnoDB table with foreign key constraints using more than 3
colmuns.
When I create table `test_fk`.`tbl1`, it gives me:
Can't create table 'test_fk.tbl1' (errno: 150)
why? CREATE TABLE syntax looks perfectly right to me.
Any suggestions are welcome.
Thank you,
wabi
Run:
SHOW ENGINE INNODB STATUS \G
And look for the LATEST FOREIGN KEY ERROR section. It'll explain the reason
for the (errno: 150) message.
Regards,
Gavin Towey
-Original Message-
From: wabiko.takuma [mailto:wab...@sysrdc.ns-sol.co.jp]
Sent: Friday, August 14, 2009 3:35 AM
To:
Indexes speed up joins. Foreign keys should be indexes themselves, so they
can also speed up joins. If the FK is not an index, it won't help. So,
index your FKs
On Wed, Oct 8, 2008 at 10:43 AM, Ben A.H. [EMAIL PROTECTED] wrote:
Does using foreign keys simply enforce referential integrity OR
So you are talking about parent-child relationships in a single table, or in
the technical jargon reflexive relationships. See www.artfulsoftware.com for
detailed examples of how this is done, but here is the thumbnail sketch:
The table has to have a ParentID column (call it what you want) that
I know that this is the standard means of dealing with a many to many
relationship, I'm just not sure it fits here.
USER:
emailID (PK)
userName
Password
Address
Etc
FRIEND:
emailID (PK)
USER_FRIEND
user_emailID (PK)
Programmer / Analyst
_
From: Arthur Fuller [mailto:[EMAIL PROTECTED]
Sent: October 8, 2008 2:55 PM
To: Ben A.H.
Cc: mysql@lists.mysql.com
Subject: Re: Foreign Keys
So you are talking about parent-child relationships in a single table, or in
the technical jargon reflexive
:* Arthur Fuller [mailto:[EMAIL PROTECTED]
*Sent:* October 8, 2008 2:55 PM
*To:* Ben A.H.
*Cc:* mysql@lists.mysql.com
*Subject:* Re: Foreign Keys
So you are talking about parent-child relationships in a single table,
or in the technical jargon reflexive relationships. See
www.artfulsoftware.com http
On Wed, Oct 8, 2008 at 11:56 AM, Jim Lyons [EMAIL PROTECTED] wrote:
Indexes speed up joins. Foreign keys should be indexes themselves, so they
can also speed up joins. If the FK is not an index, it won't help. So,
index your FKs
If you add a FOREIGN KEY constraint in MySQL 5+ it adds an
Hi Steffan, all !
Steffan A. Cline wrote:
[[...]]
I am hoping that by using FK based relationships I can just do one massive
insert into the parent table and include all related columns and somehow
magically all field and relational keys fall into place.
AFAIK, this isn't possible.
Joerg- Your comments below are excellent and my comments are just building
off what you have so clearly stated.
I think Stefan's best bet would be a stored procedure. Pass all the data,
insert the parent record (or make sure the parent record exists ... perhaps
it already is present) and then do
I forgot to mention that the only benefit of a stored procedure would be
minimizing code in your application. you'd have a single call to the stored
procedure... though some people may prefer having the back-to-back insert
statements in their code.
On Mon, Aug 25, 2008 at 11:28 AM, Tom Nugent
Hi Yves,
I have a problem with my foreign keys. I have the following two tables:
CREATE TABLE keylist (
KeylistId INTEGER NOT NULL,
UserId INTEGER NOT NULL,
PRIMARY KEY (KeylistId, UserId));
CREATE TABLE user (
UserId INTEGER NOT NULL PRIMARY KEY,
AdditionalKeylist
On 04.11.2007 21:10 CE(S)T, Martijn Tonies wrote:
Now I have added this foreign key constraint:
ALTER TABLE user ADD FOREIGN KEY (AdditionalKeylist) REFERENCES
keylist (KeylistId) ON DELETE SET NULL;
This cannot work. The column in KEYLIST to which you are
pointing should have a unique
On 03.11.2007 22:52 CE(S)T, Yves Goergen wrote:
Is my design bad?
I should explain why I do it this way at all. There's some other tables
in my system that need to keep a list of keys (i.e. user IDs) for
several actions. A message (one of the tables) has one keylist for read
access, one for
I had that problem as well and a quick search revealed this:
A) Whole databases are not handled by InnoDB. The individual tables are.
Check the results of SHOW CREATE TABLE table_name_here for each table
you are linking from and linking to. You should see ENGINE = InnoDB after
the last ) but
Thanks!
Nanu
Ing. Edwin Cruz [EMAIL PROTECTED] 10/03/2006 22:06:27
Ive found this on internet:
If you re-create a table which was dropped, it has to have a
definition
which conforms to the foreign key constraints referencing it. It must
have
the right column names and types, and it must have
Nanu Kalmanovitz [EMAIL PROTECTED] wrote on 03/10/2006 02:35:08
PM:
Hi!
Server system SBS (Novell Small Business suite) 6.5 sp 1 with MySQL
ver. 4.0.15a, PHP 4.2.3, all of them on same machine.
I just finished create a new DB called TIULIM (InnoDB) with 3 tables
(Sites, Tracks Pathes).
I´ve found this on internet:
If you re-create a table which was dropped, it has to have a definition
which conforms to the foreign key constraints referencing it. It must have
the right column names and types, and it must have indexes on the referenced
keys, as stated above. If these are not
Nick Hird [EMAIL PROTECTED] wrote on 09/29/2005 05:03:53 PM:
Is there a way to have foreign keys and force referential integrity? I
have
a main table and a lookup table, i want to be able to require that the
main
table is using values from the lookup table. I am just not sure how in
MySQL.
Hello.
I don't know the date you're asking about. However, you can
implement the FKs' features using stored procedures in MySQL 5.0.
For a small example have a look at the nice article about stored
procedures:
http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html
I don't know the date you're asking about. However, you can
implement the FKs' features using stored procedures in MySQL 5.0.
For a small example have a look at the nice article about stored
procedures:
http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html
Hmmm... given
On Sep 23, 2005, at 12:27 PM, Jacek Becla wrote:
Hi,
The documentation says At a later stage, foreign key constraints
will be implemented for MyISAM tables as well. Does anybody know
what is the timescale?
I'm not sure there is a timescale.. I think it might be pretty open
ended. You
Hello Jake,
I would like to use separate databases to group certain related tables
to keep things clean, but I would also like to use foreign keys to
enforce referential integrity between tables in different databases. I
don't think this is possible. Am I right? And if so, am I reduced to
My understanding is that RESTRICT and NO ACTION share the same behavior.
http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html
*
|NO ACTION|: In |ANSI SQL-92| standard, |NO ACTION| means /no
action/ in the sense that an attempt to delete or update a primary
Hi,
I have a table that with a TEXT filed as a primary key.
I can't make a foreign key of this field on another table, why does this
happens?
Ex:
Product ---
| ref - text, PK
| name - text
|
ProductsList
| ID int, PK
| profref - foreign key of the table product
|
I'm
Tom Roos wrote:
hi
how does 1 know if a foreign key is defined? describe tablename and show index from
tablename dont sufice
tks
SHOW CREATE TABLE tablename;
or
SHOW TABLE STATUS LIKE 'tablename';
Michael
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To
Look for a substring beginning with 'FOREIGN KEY' in the result of 'SHOW
CREATE TABLE tblname'.
PB
- Original Message -
From: Tom Roos
To: [EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 10:05 AM
Subject: foreign keys..
hi
how does 1 know if a foreign key is
saiph [EMAIL PROTECTED] wrote:
alea mysql -V
mysql Ver 12.22 Distrib 4.0.17, for pc-linux-gnu (i386)
but
mysql SHOW VARIABLES LIKE have_innodb;
+---+---+
| Variable_name | Value |
+---+---+
| have_innodb | NO|
+---+---+
1 row
- snip -
Because your tables are not InnoDB.
Check if InnoDB is enabled:
SHOW VARIABLES LIKE have_innodb;
- snip -
no, InnoDB is not enabled. how can i enable it?
the referece manual show a my.cnf configuration for a machine with at least
2gb of ram and 60 of hard disk.
how can i
saiph [EMAIL PROTECTED] wrote:
- snip -
Because your tables are not InnoDB.
Check if InnoDB is enabled:
SHOW VARIABLES LIKE have_innodb;
- snip -
no, InnoDB is not enabled. how can i enable it?
What version of MySQL do you use? 3.23.xx or 4.0.x?
If you use 3.23 you should install
Hi,
I am new to mysql. I am trying to create tables with foreign key
constraints.
but the constraintsdoesnt seem to be showing any effect on the table. I am
able to add any info in the foreign key table witout the same info in the
main
table.
what is the problem??
1) are you running the
Can you please post your DDL?
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 4/16/04 10:22 AM
Subject: Foreign Keys
hi,
I am new to mysql. I am trying to create tables with foreign key
constraints.
but the constraintsdoesnt seem to be showing any effect on the
alea mysql -V
mysql Ver 12.22 Distrib 4.0.17, for pc-linux-gnu (i386)
but
mysql SHOW VARIABLES LIKE have_innodb;
+---+---+
| Variable_name | Value |
+---+---+
| have_innodb | NO|
+---+---+
1 row in set (0.09 sec)
why?
the gentoo
saiph [EMAIL PROTECTED] wrote:
i'm studing foreign keys but my sql code does not react as
would imagine when i insert inconsistent data.
i.e.
create database urls;
use urls;
create table caths
(
name varchar(7) primary key
) type = innodb;
create table urls
(
name
Don't foreign keys need to be explicitly indexed?
Respectfully,
Ligaya Turmelle
saiph [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hi list,
i'm studing foreign keys but my sql code does not react as
would imagine when i insert inconsistent data.
i.e.
create database urls;
Michael,
- Alkuperäinen viesti -
Lähettäjä: [EMAIL PROTECTED]
Vastaanottaja: Heikki Tuuri [EMAIL PROTECTED]
Kopio: [EMAIL PROTECTED]
Lähetetty: Monday, December 29, 2003 11:53 PM
Aihe: Re: Foreign Keys in CREATE TABLEs produced by mysqldump
Heikki Tuuri [EMAIL PROTECTED] wrote on 12
Heikki Tuuri [EMAIL PROTECTED] wrote on 12/24/2003 01:53:07 PM:
Michael,
this is the question where the valid answer is: upgrade!
In which version was this corrected? I'm hesitant to upgrade to the latest
and greatest without it being banged on by the masses first..
I have half a dozen or
Hi,
Hi there. I heave heared that mysql doesnot support
foreign keys?
It does, but only with the InnoDB table type.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL MS SQL
Server.
Upscene Productions
http://www.upscene.com
--
MySQL General
with myIsam? Does not check about integrity? Mysql
3.2?
What u will use for your application Innodb or MyISAM?
--- Martijn Tonies [EMAIL PROTECTED] wrote:
Hi,
Hi there. I heave heared that mysql doesnot
support
foreign keys?
It does, but only with the InnoDB table type.
With
* Alaios
with myIsam? Does not check about integrity?
That is correct, the myisam table handler does not support foreign key
constraints. It does of course support foreign keys, but not foreign key
constraints, consequently the foreign key itegrity is not checked for myisam
tables.
Mysql 3.2?
Michael,
- Original Message -
From: [EMAIL PROTECTED]
Newsgroups: mailing.database.myodbc
Sent: Wednesday, December 24, 2003 1:45 AM
Subject: Foreign Keys in CREATE TABLEs produced by mysqldump
--=_alternative 008277CD88256E05_=
Content-Type: text/plain; charset=US-ASCII
First let
Mofeed Shahin [EMAIL PROTECTED] wrote:
mysql CREATE TABLE foo (
- ID INT PRIMARY KEY,
- note VARCHAR(50),
- First_Name VARCHAR(50),
- Last_Name VARCHAR(50),
- FOO_ID INT,
- INDEX(FOO_ID),
-
backup tool for InnoDB which also backs up MyISAM
tables
Order MySQL technical support from https://order.mysql.com/
- Original Message -
From: Mofeed Shahin [EMAIL PROTECTED]
Newsgroups: mailing.database.myodbc
Sent: Wednesday, December 17, 2003 1:19 AM
Subject: Re: foreign keys
On Wed, 17 Dec 2003 07:55 pm, Victoria Reznichenko wrote:
Mofeed Shahin [EMAIL PROTECTED] wrote:
mysql CREATE TABLE foo (
- ID INT PRIMARY KEY,
- note VARCHAR(50),
- First_Name VARCHAR(50),
- Last_Name VARCHAR(50),
- FOO_ID
[EMAIL PROTECTED]
Newsgroups: mailing.database.myodbc
Sent: Wednesday, December 17, 2003 1:19 AM
Subject: Re: foreign keys.
mysql CREATE TABLE foo (
- ID INT PRIMARY KEY,
- note VARCHAR(50),
- First_Name VARCHAR(50),
- Last_Name
Mofeed,
- Original Message -
From: Mofeed Shahin [EMAIL PROTECTED]
To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 12:20 AM
Subject: Re: foreign keys.
Hmmm, Thanks for that.
But I'm not quite sure what it means.
Mof
On Thu, 18 Dec 2003 09:05 am, Heikki Tuuri wrote:
Mofeed,
- Original Message -
From: Mofeed Shahin [EMAIL PROTECTED]
To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 12:20 AM
Subject: Re: foreign keys.
Hmmm, Thanks for that.
But I'm
Mofeed,
- Original Message -
From: Mofeed Shahin [EMAIL PROTECTED]
To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 12:47 AM
Subject: Re: foreign keys.
On Thu, 18 Dec 2003 09:05 am, Heikki Tuuri wrote:
Mofeed,
- Original Message
, 2003 12:47 AM
Subject: Re: foreign keys.
On Thu, 18 Dec 2003 09:05 am, Heikki Tuuri wrote:
Mofeed,
- Original Message -
From: Mofeed Shahin [EMAIL PROTECTED]
To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 12:20 AM
Subject: Re
Mofeed Shahin [EMAIL PROTECTED] wrote:
Still doesn't work But thanks for trying.
Worked fine for me:
mysql CREATE TABLE Blah (
- ID INT PRIMARY KEY,
- Fname VARCHAR (50),
- Lname VARCHAR (50),
- UNIQUE (Fname, Lname)
- ) TYPE=INNODB;
Query
mysql CREATE TABLE foo (
- ID INT PRIMARY KEY,
- note VARCHAR(50),
- First_Name VARCHAR(50),
- Last_Name VARCHAR(50),
- FOO_ID INT,
- INDEX(FOO_ID),
- INDEX(First_Name, Last_Name),
-
Mofeed Shahin [EMAIL PROTECTED] wrote:
On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote:
At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
I'm trying to create a bunch of tables in MySQL. I'm having problems
creating the following table :
CREATE TABLE foo(
ID INT PRIMARY KEY,
note
PROTECTED]
Subject: Re: foreign keys.
On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote:
At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
I'm trying to create a bunch of tables in MySQL. I'm having problems
creating the following table :
CREATE TABLE foo(
ID INT PRIMARY KEY,
note VARCHAR
On Mon, 15 Dec 2003 09:22 pm, Victoria Reznichenko wrote:
Mofeed Shahin [EMAIL PROTECTED] wrote:
On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote:
At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
I'm trying to create a bunch of tables in MySQL. I'm having problems
creating the following
If you have foreign key then add a key for each,
so the
CREATE TABLE foo (
ID INT PRIMARY KEY,
note VARCHAR(50),
Fname VARCHAR(50),
Lname VARCHAR(50),
FOO_ID INT,
INDEX(FOO_ID),
KEY(Fname,Lname), #here this one--if it does not work,its not me
FOREIGN KEY (FOO_ID)
Hi,
Have you considered just normalising the schema a bit more? It looks
like you're attempting to duplicate data within the
table (which you don't strictly need) and duplicating Fname and Lname
between Blah and foo. Why not just have an
AUTO_INCREMENT column (or some other unique row
Still doesn't work But thanks for trying.
Mof.
On Tue, 16 Dec 2003 11:40 am, Aftab Jahan Subedar wrote:
If you have foreign key then add a key for each,
so the
CREATE TABLE foo (
ID INT PRIMARY KEY,
note VARCHAR(50),
Fname VARCHAR(50),
Lname VARCHAR(50),
Its not my data. I'm simply writting a program that reads in the meta data,
and does stuff with it client side. I just need to be able to handle all
sorts of stuff, and I wanted to test it on MySQL (amongst others).
Mof.
On Tue, 16 Dec 2003 11:49 am, Chris Nolan wrote:
Hi,
Have you
At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
I'm trying to create a bunch of tables in MySQL. I'm having problems creating
the following table :
CREATE TABLE foo(
ID INT PRIMARY KEY,
note VARCHAR(50),
FOO_ID INT,
FOREIGN KEY (FOO_ID) REFERENCES foo(ID)
)
On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote:
At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
I'm trying to create a bunch of tables in MySQL. I'm having problems
creating the following table :
CREATE TABLE foo(
ID INT PRIMARY KEY,
note VARCHAR(50),
FOO_ID INT,
Hi there,
here a simple sample (basicall taken from the documents) with 3 tables.
2 points to watch out for:
1) first declare the primary keys
here (p1.id and p2.id)
2) index the foreign key column
here (child.id1 and child.id2)
mysql CREATE TABLE p1(id INT PRIMARY
InnoDB is using a totally different concept than MyISAM. Where in MyISAM
all the data is in one file, InnoDB uses the principle of Tablespaces
(like ORACLE). This puts the whole tables (and metadata) into one HUGE
file (in theory. In practice this file can be split and extends can be
defined of
http://www.mysql.com/doc/en/SEC457.html states that there must be an
index where the foreign key and the referenced key are listed as the
FIRST columns. Will this restriction be lifted soon? It is incredibly
frustrating. I don't see why they have to be indexes, and more
importantly, I don't
On 5 Mar 2003, at 19:39, Daevid Vincent wrote:
Right, but sometimes it isn't, or you already used up that 'first'
spot for a different foreign key reference in another table.
I think you're misunderstanding something. In the subject line you
talk about the first index, and talking about
In the last episode (Mar 05), Daevid Vincent said:
http://www.mysql.com/doc/en/SEC457.html states that there must be an
index where the foreign key and the referenced key are listed as the
FIRST columns. Will this restriction be lifted soon? It is
incredibly frustrating. I don't see why they
In the last episode (Mar 05), Daevid Vincent said:
http://www.mysql.com/doc/en/SEC457.html states that there
must be an
index where the foreign key and the referenced key are listed as the
FIRST columns. Will this restriction be lifted soon? It is
incredibly frustrating. I don't see why
In the last episode (Mar 05), Daevid Vincent said:
I'm not sure that sentence means what you think it does. What
they're saying is you need to index both fields, and if you decide
to make that index a compound one with multiple keyparts, the
foreign/referenced field must be the first.
You can do this.
E.g.: FOREIGN KEY (parent_id) REFERENCES databasename.parent(id)
and I'm already using this kind of foreign key.
Try yourself !
- Original Message -
From: Tor R. Skoglund (NextG) [EMAIL PROTECTED]
To: mysql users [EMAIL PROTECTED]
Sent: Monday, February 24, 2003 4:59
Use table type =Innodb for foreing keys and transacionts...etc
and type =myisam for speed
Simon
-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2003 10:20
To: MySQL
Subject: Foreign keys
HI all,
I've read the following text in a book:
ANSI SQL
On Tue, Jan 14, 2003 at 12:20:06PM +0200, Octavian Rasnita wrote:
I've read the following text in a book:
ANSI SQL supports a special kind of key called a foreign key. Foreign keys
help protect database integrity by enabling the database to manage things
such as the deletion of rows with
Use table type =Innodb for foreing keys and transacionts...etc
and type =myisam for speed
Yes, but do the foreign keys in InnoDB honor the constraints? I
think that was the original question. What's the poing of using
foreign keys if it's not going to maintain the integrity of your data.
That
Does MySQL allow using foreign keys or not?
It does. Try it by yourself with version 4.0.8 +.
Adolfo
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the
Hello,
In Case 1, you need to change:
index i_Tb (customerId, carId) = index i_Tb (carId,
customerId) or add index i_carId (carId)
In Case 2, you need :
foreign key (customerId) references customerTb (customerId) =
foreign key (customerId) references customerTb (customerId) on
Bruce,
Friday, November 15, 2002, 5:35:21 AM, you wrote:
BL I have a problem about foreign key in using MySQL.com manual. According to
BL the example in MySQL.com manual, one foreign key is ok. However, I have 3
BL tables (ie. 2 for parent tables and 1 for child table). When I use 2 or more
BL
Christos,
Monday, October 21, 2002, 5:46:07 AM, you wrote:
CS Hello I am a brand new user of MySql, and have some questions about
CS using InnoDB tables.
CS I noticed in the manual that you can only specify
CS - ON DELETE SET NULL
CS Or
CS - ON DELETE CASCADE
CS What is the default
Ilyas,
Wednesday, September 04, 2002, 2:27:27 PM, you wrote:
IK Is it in Mysql 4 possible to use foreign keys?
Foreign key constarints are supported in InnoDB tables (3.23 and
4.0)
IK If yes, how can I create two tables with foreign keys and use them?
Take a look at:
-
De : Heikki Tuuri [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi, 8. août 2002 08:17
À : [EMAIL PROTECTED]
Objet : Re: Foreign keys vont delete on cascade
Alexandre,
ON DELETE CASCADE only works starting from 3.23.50 and 4.0.2. The version
numbers are misleading because for the InnoDB subsystem
. août 2002 19:53
À : Heikki Tuuri; [EMAIL PROTECTED]
Objet : RE: Foreign keys vont delete on cascade
OK thanks a lot for your help ! :)
I just downloaded the latest version ( 4.0.2) and installed it .
I hoped I could keep the settings of my ini file ( my.ini) but I got the
following error when
* Hanxue Lee
In the MySQL documentation, it is stated that
foreign keys in SQL are not used to join tables, but are used mostly for
checking referential integrity (foreign key constraints).
This could have been formulated in a better way, IMHO. I would even say the
statement is wrong. In
Kiss Dániel wrote:
I studied the MySQL and InnoDB manual, but I did not find anything
about the internal usage of foreign keys.
MySQL does not support foreign keys at the moment. This will be
implemented in version 4.1.
For more info see:
If you create in index on your FK then it will be used to optimize the
query.
=C=
*
* Cal Evans
* Techno-Mage
* http://www.calevans.com
*
- Original Message -
From: Kiss Dániel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 10, 2002 9:19 AM
Subject: Foreign keys in query
: [EMAIL PROTECTED]
Subject: Re: Foreign keys in query optimization
Kiss Dániel wrote:
I studied the MySQL and InnoDB manual, but I did not find anything
about the internal usage of foreign keys.
MySQL does not support foreign keys at the moment. This will be
implemented in version 4.1
Kiss,
Monday, June 10, 2002, 5:19:17 PM, you wrote:
KD I studied the MySQL and InnoDB manual, but I did not find anything about
KD the internal usage of foreign keys.
KD I mean that I would like to know if foreign keys are used for query
KD optimizations or functions like that.
KD Because I
Chris,
Thursday, May 30, 2002, 1:58:54 AM, you wrote:
CREATE TABLE parent(id INT NOT NULL,
PRIMARY KEY (id)) TYPE=INNODB;
CREATE TABLE child(id INT, parent_id INT,
INDEX par_ind (parent_id),
FOREIGN KEY (parent_id) REFERENCES parent(id)
CREATE TABLE parent(id INT NOT NULL,
PRIMARY KEY (id)) TYPE=INNODB;
CREATE TABLE child(id INT, parent_id INT,
INDEX par_ind (parent_id),
FOREIGN KEY (parent_id) REFERENCES parent(id)
ON DELETE CASCADE) TYPE=INNODB;
OI!!! I'm going to
snip tables
OI!!! I'm going to sound like a complete ass now (I know) But since
when does MySQL support FOREIGN keys?? *gasp* MAN this is going to
make my life S much easier *curses at phpMyAdmin for not having the
option*
Do remember that this is only valid for mysql
Hi
Nothing is wrong! The behaviour of your example is correct, because
MySQL does not support the concept of foreign keys. See section 1.4.4.5
of the MySQL manual. In other words data integrity between two tables is
not ensured by MySQL. Your application code must solve this.
Regards
Rene
This example is in InnoDB though, which should support foreign key
constraints.
Chris Book
In other words data integrity between two tables is not ensured by MySQL.
Your application code must solve this.
-
Before posting,
Hi!
use
mysqlSHOW TABLE STATUS FROM yourdatabasename LIKE 'yourtablename';
Best regards,
Heikki Tuuri
Innobase Oy
---
InnoDB - transactions, row level locking, and foreign key support for MySQL
See http://www.innodb.com, download MySQL-Max from http://www.mysql.com
- Original Message
Marius,
Thursday, April 18, 2002, 11:43:38 AM, you wrote:
MR I have a problem: How can I find the FOREIGN KEY definitions for a table?
MR I'm using MySQL 4.0.1 MAX, and I define the table as a InnoDB-table.
SHOW TABLE STATUS statement shows you foreign key constraints
for a table, look at:
root,
Monday, April 08, 2002, 12:24:42 PM, you wrote:
r i tried to use the foreign key feature in mysql 4.0.1 using innodb tables .
r then i have tried the delete cascade feature but it didn't work . I don't
r know why ? have you any suggestions ? .
InnoDB does not yet support ON DELETE
]
Newsgroups: mailing.database.mysql
Date: Tuesday, March 12, 2002 7:18 PM
Subject: Re: Foreign keys in mysqldump?
InnoDB Hot Backup-0.33 beta is now available for Windows NT/2000/XP and
Linux.
Any plans for Solaris by the May 2002 release date?
From: Heikki Tuuri [EMAIL PROTECTED]
The beta testing
Bob,
I have now improved foreign key support so that version 3.23.50 does
1. show the FOREIGN KEY definitions when you call SHOW CREATE TABLE; this
should also show them in mysqldumps;
2. preserve FOREIGN KEY definitions in ALTER TABLE and CREATE INDEX;
3. allow backquotes around column and
Hi!
The message I sent 5 minutes ago answers also this :).
I have now improved foreign key support so that version 3.23.50 does
1. show the FOREIGN KEY definitions when you call SHOW CREATE TABLE; this
should also show them in mysqldumps;
2. preserve FOREIGN KEY definitions in ALTER TABLE and
in production work?
Thanks much,
-Bob
-Original Message-
From: Heikki Tuuri [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 12, 2002 4:50 AM
To: Bob McLaughlin; MySQL Mailing List
Subject: Re: Foreign keys in mysqldump?
Bob,
I have now improved foreign key support so that version
: Tuesday, March 12, 2002 4:00 PM
Subject: RE: Foreign keys in mysqldump?
Heikki,
You are the man!
I am glad you are addressing these issues in 3.23.50. They will make
foreign key support in MySQL much more robust (in my opinion, anyway..)
Is the .50 release available yet? If not, do you have
On Tue, Mar 12, 2002 at 11:50:12AM +0200, Heikki Tuuri wrote:
: Bob,
:
: I have now improved foreign key support so that version 3.23.50 does
:
: 1. show the FOREIGN KEY definitions when you call SHOW CREATE TABLE; this
: should also show them in mysqldumps;
: 2. preserve FOREIGN KEY
Philip,
-Original Message-
From: Philip Molter [EMAIL PROTECTED]
To: Heikki Tuuri [EMAIL PROTECTED]
Cc: Bob McLaughlin [EMAIL PROTECTED]; MySQL Mailing List
[EMAIL PROTECTED]
Date: Tuesday, March 12, 2002 4:21 PM
Subject: Re: Foreign keys in mysqldump?
On Tue, Mar 12, 2002 at 11:50
1 - 100 of 116 matches
Mail list logo