Re: Foreign Key Renaming Problem

2004-05-12 Thread Victoria Reznichenko
Deepak Vishwanathan [EMAIL PROTECTED] wrote: I have a table named t1 with a column x1 which is the primary key for that table. There are some other tables that reference this table t1 on x1 with foreign key constraints. I wanted to rename the column x1 for some reason, so, I went ahead

Foreign Key Renaming Problem

2004-05-10 Thread Deepak Vishwanathan
Hi, I have a table named t1 with a column x1 which is the primary key for that table. There are some other tables that reference this table t1 on x1 with foreign key constraints. I wanted to rename the column x1 for some reason, so, I went ahead and renamed the column x1 to y1. I was able

MySQL 4.0.15 : Foreign Key - ERROR 1005 (errno: 150)

2004-05-06 Thread Andy Jefferson
one of the foreign keys between the 2 tables ALTER TABLE jpox.USERDETAILS ADD CONSTRAINT USERDETAILS_FK1 FOREIGN KEY (USER_USER_ID_OID) REFERENCES jpox.`USER` (USER_ID) MySQL (4.0.15) responds with ERROR 1005: Can't create table './jpox/#sql-5b3_5a.frm' (errno: 150) This works with 4.0.18, yet

Re: MySQL 4.0.15 : Foreign Key - ERROR 1005 (errno: 150)

2004-05-06 Thread Victoria Reznichenko
) This all works fine. I then try to create one of the foreign keys between the 2 tables ALTER TABLE jpox.USERDETAILS ADD CONSTRAINT USERDETAILS_FK1 FOREIGN KEY (USER_USER_ID_OID) REFERENCES jpox.`USER` (USER_ID) MySQL (4.0.15) responds with ERROR 1005: Can't create table './jpox

Re: InnoDB - Foreign Key - Error 150.

2004-05-05 Thread Victoria Reznichenko
Tucker, Gabriel [EMAIL PROTECTED] wrote: Victoria=20 That seemed to work well, thank you. However, I received another error that I am not sure how to troubleshoot = during the restore: ERROR 1114 at line 83 in file: = '/bb/bin/mysql/backups/archive_4320.sql': The table

InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Tucker, Gabriel
this might be a version issue, so I copied all the database files to another location, and started it using v4.0.18. I then dropped the foreign key constraint (no errors) and recreated it (no errors). I backed up the database. And when I went to restore it, I got the same error. The schema [after

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Marvin Wright
Hi, Are you creating them in the correct order ? object_type must exist before you can create cur_reject_tk_sum otherwise the foreign key will give errors. Marvin -Original Message- From: Tucker, Gabriel [mailto:[EMAIL PROTECTED] Sent: 04 May 2004 14:46 To: Mysql General (E-mail

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Tucker, Gabriel
Marvin I believe that is the problem with the restore. When I create the archive file using the mysqldump command and options previously listed, I get the create table in the order listed below and thus, the foreign key constraint is created on table cur_reject_tk_sum before the object_type

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Marvin Wright
Hi, I don't think mysqldump takes foreign key constraints into account when dumping them. You could specify the tables that you want when you dump so you get the correct order. e.g. mysqldump --allow-keywords --host=$HOST --flush-logs --disable-keys --opt --port=$1 --socket=/bb/bin/mysql

Re: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Josh Trutwin
On Tue, 4 May 2004 09:46:27 -0400 Tucker, Gabriel [EMAIL PROTECTED] wrote: Hello All: I am having a problem with both V4.0.16 and 4.0.18. Let me explain: I have a database with two InnoDB tables in v4.0.16. I backup up this database every night using the following command:

Re: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Ken Menzel
Hi Guy's, first: Your are correct it is contraints: bash-2.05a$ perror 150 Error code 150: Unknown error: 150 150 = Foreign key constraint is incorrectly formed Second you could also try: set foreign_key_check=0; at the beginning of the restore file. set foreign_key_check=1; at the end

Re: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Victoria Reznichenko
Tucker, Gabriel [EMAIL PROTECTED] wrote: Marvin I believe that is the problem with the restore. When I create the = archive file using the mysqldump command and options previously listed, = I get the create table in the order listed below and thus, the foreign = key constraint is created

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Tucker, Gabriel
, 2004 10:03 AM To: Tucker, Gabriel Subject: Re: InnoDB - Foreign Key - Error 150. Put in your script: set foreign_key_checks=0; in the first line. mysqldump dumps tables in alphabetical order. Tucker, Gabriel wrote: Hello All: I am having a problem with both V4.0.16 and 4.0.18. Let me

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Tucker, Gabriel
To: [EMAIL PROTECTED] Subject: Re: InnoDB - Foreign Key - Error 150. Tucker, Gabriel [EMAIL PROTECTED] wrote: Marvin I believe that is the problem with the restore. When I create the = archive file using the mysqldump command and options previously listed, = I get the create table in the order

Re: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Josh Trutwin
On Tue, 4 May 2004 11:01:59 -0400 Tucker, Gabriel [EMAIL PROTECTED] wrote: Luciano I am confused... As far as I can tell, the set foreign_key_checks=0; is used with the load data infile command. Actually, I think that it is used for all operations on the DBMS, not just load data infile,

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Tucker, Gabriel
- Gabe -Original Message- From: Victoria Reznichenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 04, 2004 10:35 AM To: [EMAIL PROTECTED] Subject: Re: InnoDB - Foreign Key - Error 150. Tucker, Gabriel [EMAIL PROTECTED] wrote: Marvin I believe that is the problem with the restore. When

RE: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Tucker, Gabriel
: InnoDB - Foreign Key - Error 150. Victoria That seemed to work well, thank you. However, I received another error that I am not sure how to troubleshoot during the restore: ERROR 1114 at line 83 in file: '/bb/bin/mysql/backups/archive_4320.sql': The table 'cur_reject_tk_sum' is full

Re: InnoDB - Foreign Key - Error 150.

2004-05-04 Thread Luciano Barcaro
command, believing this would correct the problem. Do you know why it does not? No, the foreign key error is generated because mysqldump dumps table in a different order (alphabetical) that it should. I know I asked a bunch of questions, thanks for whatever you can offer! Gabe -- MySQL General

Re: Foreign Key

2004-04-16 Thread lga2
I creates 2 tables create table test1(Ser int(5) primary key,age int(2)) type=InnoDB; create table test2(Serno int(5) references test1(Ser),name varchar(20)) type=InnoDB; I inserted a value in test2 and it accepted. Isnt that wrong? shouldnt it accept only if there is a vlue in the first

RE: Foreign Key

2004-04-16 Thread Victor Pendleton
Try creating your tables as such: CREATE TABLE test1(ser INT(5) NOT NULL, age INT(2), PRIMARY KEY (ser) ) TYPE=InnoDB; CREATE TABLE test1(serno INT(5) NOT NULL, name VARCHAR(20), KEY 'idx_serno' (serno), CONSTRAINT FOREIGN KEY(serno) REFERENCES `test1` (ser) ) TYPE=InnoDB; -Original

Re: ERROR ON FOREIGN KEY ON WINDOWS 2000 WITH MYSQL 4.0.18

2004-03-30 Thread Victoria Reznichenko
Massimo Petrini [EMAIL PROTECTED] wrote: Somebody can help me ? If you run the above code in a new db named prova, the last line create then error Can't create table '.\prova\#sql-654_2e.frm' (errno: 121) If you run the code on 4.0.17 all it is ok. Thank you for report! Entered to the

ERROR ON FOREIGN KEY ON WINDOWS 2000 WITH MYSQL 4.0.18

2004-03-26 Thread Massimo Petrini
CREATE INDEX ArtOper ON schedelavoro (Articolo, Operazione) CREATE INDEX IDUSL ON schedelavoro (IDUSL) CREATE UNIQUE INDEX UbicazioneSL ON TabUbicazioneSL (UbicazioneSL) CREATE INDEX SchedaLavoro ON RevisioniSL (SchedaLavoro) ALTER TABLE RevisioniSL ADD CONSTRAINT FOREIGN KEY (SchedaLavoro) REFERENCES

alter column with foreign key - 4.1.1-alpha

2004-03-17 Thread Gilad Buzi
Take the following InnoDB table in MySQL 4.1.1-alpha: create table tt1 ( r1 int(10), key (r1), constraint r1 foreign key (r1) references pfwuser(usrid) ) type=InnoDB; If I try to change the column type like this: alter table tt1 modify r1 varchar(255); I get an error: mysql alter table

MySQL Dump Command Does Not Consider Foreign Key Dependencies

2004-03-05 Thread Stephen Cuppett
Description: The current mysqldump utility does an alphabetical dump of the tables as well as a row by row dump of the data following each table declaration. This is adequate enough for most databases; however, if there are strict foreign key constraints

RE: MySQL Dump Command Does Not Consider Foreign Key Dependencies

2004-03-05 Thread Carlos Proal
}/${database_filename} 2 $logfile } I would suggest that this can be included as a mysqldump option (--nochecks or similar). Carlos Original Message Follows From: Stephen Cuppett [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: MySQL Dump Command Does Not Consider Foreign Key Dependencies Date: Fri

Re: MySQL Dump Command Does Not Consider Foreign Key Dependencies

2004-03-05 Thread Heikki Tuuri
Stephen, in = 4.0, you should put SET FOREIGN_KEY_CHECKS=0; at the start of the dump file. In 4.1, mysqldump knows to add to a dump file a line /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0*/ to disable foreign key checks in the dump file. Best regards

foreign key constraints are driving me crazy!

2004-03-04 Thread Cere Davis
So I have made a table called 'uid' where on uid is the only field in the table. Then I make another table called 'users' where there are two fields, 'uid1' and 'uid2' and both uid values have foreign key constraints referencing the 'uid' field in the uid table. No problem, tables are created

Re: foreign key constraints are driving me crazy!

2004-03-04 Thread daniel
called 'users' where there are two fields, 'uid1' and 'uid2' and both uid values have foreign key constraints referencing the 'uid' field in the uid table. No problem, tables are created and are all empty. Then I try inserting a uid varchar value of 'test' into the uid table... ok works

Re: foreign key constraints are driving me crazy!

2004-03-04 Thread Cere M. Davis
had issues when importing data from a dump so i've had to do a FORIEGN_KEY_CHECKS=0 So I have made a table called 'uid' where on uid is the only field in the table. Then I make another table called 'users' where there are two fields, 'uid1' and 'uid2' and both uid values have foreign key

Re: Foreign Key Problems

2004-02-20 Thread Victoria Reznichenko
= not quite understanding the syntax. I am creating two test tables to work out the logic. What I want to do = is delete a certain 'ID' from 'table 'ONE' and have it delete the same = foreign key id of the same value in table 'TWO'. Here is what I have entered into the mysql command. mysql create

Foreign Key Problems

2004-02-19 Thread Scott Purcell
creating two test tables to work out the logic. What I want to do is delete a certain 'ID' from 'table 'ONE' and have it delete the same foreign key id of the same value in table 'TWO'. Here is what I have entered into the mysql command. mysql create table one (id varchar(2) not null, name varchar(20

Re: Foreign Key Reference to a VARCHAR

2004-02-10 Thread Heikki Tuuri
. That will alleviate this problem. The current limit 255 bytes is rather short. I may also improve the foreign key check algorithm so that it can work also on column prefix indexes. http://www.mysql.com/doc/en/Charset-Unicode.html : The UTF8 character set (transform Unicode representation) is an alternative

RE: Foreign Key Reference to a VARCHAR

2004-02-10 Thread Sven Woltmann
-Original Message- From: Heikki Tuuri [mailto:[EMAIL PROTECTED] Sent: Dienstag, 10. Februar 2004 14:19 To: [EMAIL PROTECTED] Subject: Re: Foreign Key Reference to a VARCHAR Sven, are you using the UTF8 charset? Then a single character may use up to 3 bytes. Since MySQL cannot work

Re: Foreign Key Reference to a VARCHAR

2004-02-10 Thread Heikki Tuuri
languages on Earth. Thank you, Heikki - Alkuperäinen viesti - Lähettäjä: Sven Woltmann [EMAIL PROTECTED] Vastaanottaja: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED] Lähetetty: Tuesday, February 10, 2004 3:53 PM Aihe: RE: Foreign Key Reference to a VARCHAR Heikki, yes, actually I use

Re: Foreign Key Reference to a VARCHAR

2004-02-10 Thread Jochem van Dieten
Heikki Tuuri wrote: I guess that 4-byte UTF8 characters are not needed. You can code 16 million characters with 3 bytes. Yes. But is that also the case if you use the UTF-8 encoding scheme, or can that scheme code less characters with 3 bytes? http://ln.hixie.ch/?start=1064324988order=-1count=1

RE: Foreign Key Reference to a VARCHAR

2004-02-10 Thread Sven Woltmann
-Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Dienstag, 10. Februar 2004 15:29 To: Heikki Tuuri Cc: [EMAIL PROTECTED] Subject: Re: Foreign Key Reference to a VARCHAR Heikki Tuuri wrote: I guess that 4-byte UTF8 characters are not needed. You can code 16

Foreign Key Reference to a VARCHAR

2004-02-09 Thread Sven Woltmann
Hi, I hope this is not a well known problem since I just signed up to this list. But I checked the February archive and couldn't find anything on this. I was trying for a couple of hours now to create a foreign key reference on a varchar field: CREATE TABLE users ( login

Re: Why does MySQL generate internal foreign key id when constrain name

2004-02-02 Thread Heikki Tuuri
Philip, - Original Message - From: Philip Walden [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Monday, February 02, 2004 3:39 AM Subject: Why does MySQL generate internal foreign key id when constrain name I am using MySQL 4.1.1-1. When I add a named foreign key

Why does MySQL generate internal foreign key id when constrain name is given?

2004-02-01 Thread Philip Walden
I am using MySQL 4.1.1-1. When I add a named foreign key constraint alter table sb_query_nm_sub_tp add constraint f1sbquerynmsubtp foreign key (query_nm) references sb_query_class (query_nm); And then do a show create table: | sb_query_nm_sub_tp | CREATE TABLE `sb_query_nm_sub_tp

Re: Foreign key contraints, on delete cascade not working?

2004-01-16 Thread Andrew DeFaria
Victoria Reznichenko wrote: Andrew DeFaria [EMAIL PROTECTED] wrote: Victoria Reznichenko wrote: Andrew DeFaria [EMAIL PROTECTED] wrote: As you can see I when I delete from user (the parent table) the useropts (child table) entry remains. Shouldn't it be deleted? Heikki Tuuri asked me to look

Re: Foreign key contraints, on delete cascade not working?

2004-01-15 Thread Victoria Reznichenko
Andrew DeFaria [EMAIL PROTECTED] wrote: Victoria Reznichenko wrote: Andrew DeFaria [EMAIL PROTECTED] wrote: As you can see I when I delete from user (the parent table) the useropts (child table) entry remains. Shouldn't it be deleted? Heikki Tuuri asked me to look at my innodb variables

Re: Foreign key contraints, on delete cascade not working?

2004-01-13 Thread Victoria Reznichenko
in the child table whose foreign key values are equal to the referenced key value in the parent row. However: drop database if exists MYDB; create database MYDB; use MYDB; create table user ( userid varchar (8) not null, name tinytextnot null, primary key (userid) ) type=innodb

Re: Foreign key contraints, on delete cascade not working?

2004-01-13 Thread Andrew DeFaria
those rows in the child table whose foreign key values are equal to the referenced key value in the parent row. However: drop database if exists MYDB; create database MYDB; use MYDB; create table user ( userid varchar (8) not null, name tinytext not null, primary key (userid

Foreign key contraints, on delete cascade not working?

2004-01-12 Thread Andrew DeFaria
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If ON DELETE CASCADE is specified, and a row in the parent table is deleted, then InnoDB automatically deletes also all those rows in the child table whose foreign key values are equal

Re: foreign key contraints, on delete cascade not working?

2004-01-10 Thread Heikki Tuuri
, - valuevarchar (128), - key user_index (userid), - foreign key (userid) references user (userid) on delete cascade - ) type=innodb; -- useropts Query OK, 0 rows affected (0.01 sec) mysql insert into user values (userA, User A); Query OK, 1 row affected (0.00 sec

ERROR 1005 during add foreign key

2004-01-05 Thread Sid Lane
on mysql 4.0.14-standard (x86 Linux) when I try the following: alter table child_table add ( foreign key (column1, column2) references parent_table on delete cascade) ; on an existing innodb table I get: ERROR 1005: Can't create table './dbname/#sql-70f5_b92.frm' (errno: 150) I know

Re: ERROR 1005 during add foreign key

2004-01-05 Thread Steve Folly
On 5 Jan 2004, at 21:10, Sid Lane wrote: on mysql 4.0.14-standard (x86 Linux) when I try the following: alter table child_table add ( foreign key (column1, column2) references parent_table on delete cascade) ; on an existing innodb table I get: ERROR 1005: Can't create table './dbname/#sql

Dropping a foreign key in 4.1.x

2004-01-03 Thread Joshua Thomas
How does one drop a foreign key from a InnoDB table in mySQL 4.1.x? The manual says ALTER TABLE yourtablename DROP FOREIGN KEY internally_generated_foreign_key_id You have to use SHOW CREATE TABLE to determine the internally generated foreign key ID when you want to drop a foreign key

RE: Dropping a foreign key in 4.1.x

2004-01-03 Thread Joshua Thomas
Berra --- -Original Message- From: Joshua Thomas [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 12:33 AM To: '[EMAIL PROTECTED]' Subject: Dropping a foreign key in 4.1.x How does one drop a foreign key from a InnoDB table in mySQL 4.1.x? The manual says ALTER TABLE

foreign key errors

2003-12-10 Thread Mayuran Yogarajah
, - FrequencyCap MEDIUMINT UNSIGNED NOT NULL, - INDEX (UserID), - FOREIGN KEY (UserID) REFERENCES Userlist(UserID) ON UPDATE CASCADE ON DELETE CASCADE, - PRIMARY KEY (SiteID, UserID) - ) TYPE=InnoDB; Query OK, 0 rows affected (0.05 sec) mysql CREATE TABLE

Re: foreign key errors

2003-12-10 Thread Mayuran Yogarajah
UNSIGNED NOT NULL DEFAULT 70, - FrequencyCap MEDIUMINT UNSIGNED NOT NULL, - INDEX (UserID), - FOREIGN KEY (UserID) REFERENCES Userlist(UserID) ON UPDATE CASCADE ON DELETE CASCADE, - PRIMARY KEY (SiteID, UserID) - ) TYPE=InnoDB; Query OK, 0 rows affected (0.05

Re: foreign key errors

2003-12-10 Thread Mayuran Yogarajah
, - MonthlyUnique INT UNSIGNED NOT NULL DEFAULT 70, - FrequencyCap MEDIUMINT UNSIGNED NOT NULL, - INDEX (UserID), - FOREIGN KEY (UserID) REFERENCES Userlist(UserID) ON UPDATE CASCADE ON DELETE CASCADE, - PRIMARY KEY (SiteID, UserID) - ) TYPE=InnoDB; Query

Re: Drop foreign key replication problem

2003-12-03 Thread Heikki Tuuri
Batara, thank you for the bug report. I have to fix this bug when I overhaul the foreign key constraint naming conventions. Yes, to fix the problem you can drop the foreign key constraint manually in the slave. Best regards, Heikki Tuuri Innobase Oy http://www.innodb.com Foreign keys

Drop foreign key replication problem

2003-12-02 Thread Batara Kesuma
Hi, I am running a master and a slave. When I created a foreign key in master, it looked like this: CONSTRAINT `0_373` FOREIGN KEY (`prefecture_id`) REFERENCES `prefecture` (`id`) But on the slave it was like: CONSTRAINT `0_451` FOREIGN KEY (`prefecture_id`) REFERENCES `prefecture` (`id

Re: Foreign Key

2003-11-11 Thread Stephen Fromm
- Original Message - From: Shravan Durvasula [EMAIL PROTECTED] To: MySQL HELP [EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 12:48 PM Subject: Foreign Key Hi all: I have a table A(Id, Type). Primary Key is Id I have another table B(Id, State). Primary Key is Id I also have

Re: auto_increment with FOREIGN KEY UPDATE CASCADE courses Lost connection to MySQL server

2003-10-28 Thread Victoria Reznichenko
, PRIMARY KEY (softwareID) ) TYPE=INNODB; CREATE TABLE software_machineOSs ( softwareID CHAR(20) NOT NULL, id INT(2) unsigned zerofill NOT NULL auto_increment, osName CHAR(20), osRevision CHAR(20), INDEX (softwareID), FOREIGN KEY (softwareID

Re: auto_increment with FOREIGN KEY UPDATE CASCADE courses Lost connection to MySQL server

2003-10-28 Thread Heikki Tuuri
Vinita, it is most probably this bug fixed in 4.1.14: Fixed a bug: if in a FOREIGN KEY with an UPDATE CASCADE clause the parent column was of a different internal storage length than the child column, then a cascaded update would make the column length wrong in the child table and corrupt

auto_increment with FOREIGN KEY UPDATE CASCADE courses Lost connection to MySQL server

2003-10-27 Thread vinita vigine MURUGIAH
), FOREIGN KEY (softwareID) REFERENCES software (softwareID) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (softwareID, osName) ) TYPE=INNODB; insert into software (softwareID,softwareName,softwareVers,installedDate,softwareSource) values (vim-1.1, vim, 1.1, NOW(), www.test.com.au

Replication of foreign key constraint names (InnoDB) inconsistent

2003-10-22 Thread Chris Tucker
Description: It is possible to get into a situation where foreign key constraints on a replication slave have different labels to the same foreign key constraint on the master. This normally causes replication to fail when a drop of a foreign key on the master is attempted (although

foreign key constraints

2003-10-08 Thread Croniser Brian Contr AFRL/IFGB
Here is the script that creates the database. create table object_attrib (obj_record_id INTEGER(7) AUTO_INCREMENT NOT NULL, PRIMARY KEY (obj_record_id), INDEX (rel_obj_int_id), FOREIGN KEY (rel_obj_int_id) REFERENCES obj_id_internals (obj_int_id) ON DELETE RESTRICT

Re: foreign key constraints

2003-10-08 Thread Paul DuBois
At 18:22 + 10/8/03, Croniser Brian Contr AFRL/IFGB wrote: Here is the script that creates the database. create table object_attrib (obj_record_id INTEGER(7) AUTO_INCREMENT NOT NULL, PRIMARY KEY (obj_record_id), INDEX (rel_obj_int_id), FOREIGN KEY (rel_obj_int_id

Relationships - Foreign Key

2003-10-03 Thread Paulo
Hi, sorry for my english, but, how can I do relationships between tables? Is possible? Thanks, Paulo Daniel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Relationships - Foreign Key

2003-10-03 Thread Roger Baklund
* Paulo Hi, sorry for my english, but, how can I do relationships between tables? Is possible? This is done using different types of JOIN: URL: http://www.mysql.com/doc/en/JOIN.html -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: multiple foreign key references on one column

2003-10-02 Thread dobbo
`,`phenotype`), KEY `id` (`id`), CONSTRAINT `0_125` FOREIGN KEY (`id`) REFERENCES `monogenic` (`phenotype_ID`) ON DELETE CASCADE, CONSTRAINT `0_127` FOREIGN KEY (`id`) REFERENCES `knockout` (`phenotype_ID`) ON DELETE CASCADE ) TYPE=InnoDB The problem is that I can't insert

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-29 Thread Ed Smith
4.6.1 of the 4.1 manual. I appreciate any and all help. For now, I am having to disable foreign key integrity constraint checking. Ed --- Victoria Reznichenko [EMAIL PROTECTED] wrote: Ed Smith [EMAIL PROTECTED] wrote: Greetings. When I execute the SQL script below in mySQL 4.1, I get

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-29 Thread Paul DuBois
At 15:59 +0300 9/28/03, Victoria Reznichenko wrote: Ed Smith [EMAIL PROTECTED] wrote: Greetings. When I execute the SQL script below in mySQL 4.1, I get ERROR 1216: Cannot add or update a child row: a foreign key constraint fails It is, of course, choking on the enroll row insert. Why

Multiple charsets do not work in InnoDB-4.1.0; Re: FOREIGN KEY Weirdness in mySQL 4.1..

2003-09-29 Thread Heikki Tuuri
, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for MySQL - Original Message - From: Paul DuBois [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Tuesday, September 30, 2003 1:31 AM Subject: Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR At 15:59

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-28 Thread Victoria Reznichenko
Ed Smith [EMAIL PROTECTED] wrote: Greetings. When I execute the SQL script below in mySQL 4.1, I get ERROR 1216: Cannot add or update a child row: a foreign key constraint fails It is, of course, choking on the enroll row insert. Why is this happening? Here are some things that make

FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-26 Thread Ed Smith
Greetings. When I execute the SQL script below in mySQL 4.1, I get ERROR 1216: Cannot add or update a child row: a foreign key constraint fails It is, of course, choking on the enroll row insert. Why is this happening? Here are some things that make the problem go away: 1. Take out the name

Re: multiple foreign key references on one column

2003-09-26 Thread Roman Neuhauser
` FOREIGN KEY (`id`) REFERENCES `monogenic` (`phenotype_ID`) ON DELETE CASCADE, CONSTRAINT `0_127` FOREIGN KEY (`id`) REFERENCES `knockout` (`phenotype_ID`) ON DELETE CASCADE ) TYPE=InnoDB The problem is that I can't insert a record into this table unless the value of 'id' is present in both

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-26 Thread Ed Smith
it work. Other suggestions? Thanks. --- Harald Fuchs [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Ed Smith [EMAIL PROTECTED] writes: Greetings. When I execute the SQL script below in mySQL 4.1, I get ERROR 1216: Cannot add or update a child row: a foreign key constraint fails

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-26 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2003-09-26 15:12:03 -0700: --- Harald Fuchs [EMAIL PROTECTED] wrote: Ed Smith [EMAIL PROTECTED] writes: Greetings. When I execute the SQL script below in mySQL 4.1, I get ERROR 1216: Cannot add or update a child row: a foreign key constraint fails

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-26 Thread Matt W
Hi, - Original Message - From: Roman Neuhauser Sent: Friday, September 26, 2003 6:05 PM Subject: Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR # [EMAIL PROTECTED] / 2003-09-26 15:12:03 -0700: --- Harald Fuchs [EMAIL PROTECTED] wrote: Ed Smith [EMAIL PROTECTED] writes

multiple foreign key references on one column

2003-09-25 Thread dobbo
Hi, I have three tables. One of the tables has a column that is a foreign key that references columns from the other two tables. This table is shown below. CREATE TABLE `pheno` ( `id` smallint(5) unsigned NOT NULL auto_increment, `relevant` enum('y','n') default NULL, `phenotype

innodb foreign key

2003-09-24 Thread R.Dobson
', `pop` varchar(200) default NULL, `mut_type` varchar(50) default NULL, `mut_loc` varchar(50) default NULL, `gene_ID` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`id`,`gene_ID`), KEY `phenotype_ID` (`phenotype_ID`), KEY `gene_ID` (`gene_ID`), CONSTRAINT `0_147` FOREIGN KEY (`id

RE: innodb foreign key

2003-09-24 Thread Victor Pendleton
One thing that stands out is the data types are different sizes. http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html -Original Message- From: R.Dobson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 8:42 AM To: [EMAIL PROTECTED] Subject: innodb foreign key Hi

Re: innodb foreign key

2003-09-24 Thread R.Dobson
AM To: [EMAIL PROTECTED] Subject: innodb foreign key Hi, I have two innodb tables produced as show below CREATE TABLE `monogenic` ( `id` smallint(5) unsigned NOT NULL default '0', `exp_design` varchar(50) default NULL, `disease` varchar(50) default NULL, `omim` varchar(20) default NULL

AW: AW: FOREIGN KEY() REFERENCES ON UPDATE CASCADE ON DELETE RESTRICT

2003-09-22 Thread Morten Gulbrandsen
is all Foreign Keys and hence will be actualised through the references indirectly, when they are changed, the new values will be propagated, no insert statement is possible into a foreign key or anything which is auto Increment, Please correct me, foreign key

Re: InnoDB Foreign Key Constraint Issue

2003-09-19 Thread Heikki Tuuri
David, - Original Message - From: David Griffiths [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Friday, September 19, 2003 4:07 AM Subject: InnoDB Foreign Key Constraint Issue The following constraint is failing: ALTER TABLE address_list ADD CONSTRAINT FOREIGN KEY

Re: InnoDB Foreign Key Constraint Issue

2003-09-19 Thread David Griffiths
: InnoDB Foreign Key Constraint Issue David, - Original Message - From: David Griffiths [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Friday, September 19, 2003 4:07 AM Subject: InnoDB Foreign Key Constraint Issue The following constraint is failing: ALTER

InnoDB Foreign Key Constraint Issue

2003-09-18 Thread David Griffiths
The following constraint is failing: ALTER TABLE address_list ADD CONSTRAINT FOREIGN KEY (address_type_id) REFERENCES address_type (address_type_id); The address_list table looks like: mysql desc address_list; +--+--+--+-+-+---+ | Field

AW: FOREIGN KEY() REFERENCES ON UPDATE CASCADE ON DELETE RESTRICT

2003-09-16 Thread Morten Gulbrandsen
-Ursprüngliche Nachricht- Von: Toro Hill [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. September 2003 03:36 An: Morten Gulbrandsen Cc: [EMAIL PROTECTED] Betreff: Re: FOREIGN KEY() REFERENCES ON UPDATE CASCADE ON DELETE RESTRICT I believe that your ON UPDATE CASCADE clause should

Re: AW: FOREIGN KEY() REFERENCES ON UPDATE CASCADE ON DELETE RESTRICT

2003-09-16 Thread Toro Hill
The first foreign key contraints in the following table definition mean this: Any record that is inserted into the product_order table must have values for product_category and product_id that exist in the category and id fields of a record in the product table. The second foreign key contraints

FOREIGN KEY() REFERENCES ON UPDATE CASCADE ON DELETE RESTRICT

2003-09-15 Thread Morten Gulbrandsen
(product_category, product_id), FOREIGN KEY (product_category, product_id) REFERENCES product(category, id) ON UPDATE CASCADE ON DELETE RESTRICT, INDEX (customer_id), FOREIGN KEY (customer_id) REFERENCES customer(id) )TYPE=INNODB; INSERT INTOPRODUCT(category, id, price

Re: FOREIGN KEY() REFERENCES ON UPDATE CASCADE ON DELETE RESTRICT

2003-09-15 Thread Toro Hill
tables that reference this table (via a foreign key) will be updated also. So if there are no rows in PRODUCT_ORDER then ON UPDATE CASCADE will not insert new rows when you add rows to the other tables. What will happen instead is that any row (that already exists) in your PRODUCT_ORDER table

Re: Foreign key update and Error :: 1217 with v4.0.15

2003-09-12 Thread Heikki Tuuri
Daevid, CONSTRAINT `0_359` FOREIGN KEY (`rep_company_code`) REFERENCES `company_table` (`company_code`) you do not have ON UPDATE CASCADE in your constraint. MySQL versions 4.0.8 ignored it. Best regards, Heikki Tuuri Innobase Oy http://www.innodb.com Foreign keys, transactions, and row level

RE: Foreign key update and Error :: 1217 with v4.0.15 [SOLVED]

2003-09-12 Thread Daevid Vincent
Ah! So what I had to do was then... show create table rep_table; alter table rep_table drop foreign key 0_359; ALTER TABLE rep_table ADD FOREIGN KEY (`rep_company_code`) REFERENCES `company_table` (`company_code`) ON UPDATE CASCADE; It all works now. Man, talk about good timing 'eh? A few

Re: Foreign key update?

2003-09-11 Thread Victoria Reznichenko
Daevid Vincent [EMAIL PROTECTED] wrote: Thanks Victoria for the pointer. I should have looked there first. Duh! Now for the help... I tried: ALTER TABLE rep_table ADD FOREIGN KEY (`rep_company_code`) REFERENCES `company_table` (`company_code`) ON UPDATE CASCADE; But get ERROR 1216

RE: Foreign key update and Error :: 1217

2003-09-11 Thread Daevid Vincent
I really appreciate your help with this. Hmmm... So, while SET FOREIGN_KEY_CHECKS allowed me to ALTER the table, now I can't UPDATE the company that has a rep with the same company_code because: Error :: 1217 :: Cannot delete a parent row: a foreign key constraint fails UPDATE company_table SET

Re: Foreign key update and Error :: 1217

2003-09-11 Thread Heikki Tuuri
Daevid, there is really one update you need to do first: upgrade to MySQL-4.0.14. http://www.innodb.com/ibman.html#InnoDB_foreign_keys Starting from version 3.23.50, you can also associate the ON DELETE CASCADE or ON DELETE SET NULL clause with the foreign key constraint. Corresponding

RE: Foreign key update and Error :: 1217 with v4.0.15

2003-09-11 Thread Daevid Vincent
key constraint fails I looked at some InnoDB status log that phpMyAdmin has, and it shows some debug info that doesn't make sense to me. It complains that there is a record, but of course there is a record. That's the record I want to update?! LATEST FOREIGN KEY ERROR

Re: [SQL] foreign key from a table to the *same* table

2003-09-10 Thread Heikki Tuuri
didactic_units_id_didactic_unit_lender (ID_DIDACTIC_UNIT_LENDER), - - FOREIGN KEY(ID_DIDACTIC_UNIT_LENDER ) REFERENCES DIDACTIC_UNITS (ID) ON - DELETE SET NULL - - ) TYPE = InnoDB; Query OK, 0 rows affected (0.02 sec) mysql insert into DIDACTIC_UNITS(ID, ID_DIDACTIC_UNIT_LENDER) values (15

Foreign key update?

2003-09-10 Thread Daevid Vincent
I see there is a way to DELETE or NULL a cascade, but is there a way to UPDATE? Here's what I mean. Given these rough table schemas. I'd like to be able to UPDATE the company_code in the company_table, and have it update the same rep_company_code in the rep_table. Ie. So a company has a certain

RE: Foreign key update?

2003-09-10 Thread Dan Greene
: Wednesday, September 10, 2003 3:29 PM To: [EMAIL PROTECTED] Subject: Foreign key update? I see there is a way to DELETE or NULL a cascade, but is there a way to UPDATE? Here's what I mean. Given these rough table schemas. I'd like to be able to UPDATE the company_code in the company_table

Re: Foreign key update?

2003-09-10 Thread Victoria Reznichenko
Daevid Vincent [EMAIL PROTECTED] wrote: I see there is a way to DELETE or NULL a cascade, but is there a way to UPDATE? ON UPDATE CASCADE, ON UPDATE SET NULL. Look at: http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html Here's what I mean. Given these rough table

RE: Foreign key update?

2003-09-10 Thread Daevid Vincent
Thanks Victoria for the pointer. I should have looked there first. Duh! Now for the help... I tried: ALTER TABLE rep_table ADD FOREIGN KEY (`rep_company_code`) REFERENCES `company_table` (`company_code`) ON UPDATE CASCADE; But get ERROR 1216: Cannot add a child row: a foreign key constraint

RE: Foreign key update?

2003-09-10 Thread Daevid Vincent
Well, okay I just answered part of my own solution... SET FOREIGN_KEY_CHECKS=0; ALTER TABLE rep_table ADD FOREIGN KEY (`rep_company_code`) REFERENCES `company_table` (`company_code`) ON UPDATE CASCADE; SET FOREIGN_KEY_CHECKS=1; Allowed that to happen. I'm afraid to try the self referencing

Fw: [SQL] foreign key from a table to the *same* table

2003-09-09 Thread Alberto
' is the didactic unit lender for the didactic unit 'Information technology' of the course 'Medicine'. So, i need a sort of 'foreign key' from the table DIDACTIC_UNITS to the same table DIDACTIC_UNITSwith a field called DIDACTIC_UNIT_LENDER that point to the record of the didactic unit lender

Re: no foreign key and view?

2003-08-14 Thread Heikki Tuuri
Susan, - Original Message - From: Susan Lam [EMAIL PROTECTED] Newsgroups: mailing.database.mysql Sent: Monday, August 11, 2003 8:37 AM Subject: no foreign key and view? I was told that mysql doesn't has foreign key and views. Is it ture? Or is it different across different version

Foreign Key Constraints

2003-08-14 Thread John Towell
We are trying to load a set of data using Hibernate (O/R mapping tool). Hibernate creates foreign key constraints when it is creating our DB (mysql 4.0.14). The process for loading data requires us to break these constraints at certain points, however they will all be satisfied at the end

<    1   2   3   4   5   6   7   >