Morten,
http://www.innodb.com/ibman.php#InnoDB_foreign_keys
A deviation from SQL standards: if ON UPDATE CASCADE or ON UPDATE SET NULL
recurses to update a table for which there already is an update operation in
the stack of cascaded operations, it acts like RESTRICT. In plain English
this means
Hello,
If I change the value of a reference a ,
for instance by means of updating or inserting values,
I'd expect both updated values and inserted values to
cascade, hence to change b,
where
FOREIGN KEY (b) REFERENCES A(a)
ON UPDATE CASCADE
In this example foreign key and reference
) REFERENCES software (softwareID) ON
DELETE CASCADE ON UPDATE CASCADE,
KEY(id),
PRIMARY KEY (softwareID, id)
) TYPE=INNODB;
insert into software
(softwareID,softwareName,softwareVers,installedDate,softwareSource)
values (vim-1.1, vim, 1.1, NOW(), www.test.com.au);
insert
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
),
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
values );
is not possible, for any variable or value.
Is this true for PRODUCT_ORDER ?
Pleas tell me, what is the purpose of
ON UPDATE CASCADE ON DELETE RESTRICT ?
Is that necessary ?
Why ?
Example please ?
Yours Sincerely
Morten Gulbrandsen
-Ursprüngliche Nachricht-
Von: Toro Hill
-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
INT NOT NULL,
customer_id INT NOT NULL,
PRIMARY KEY(no),
INDEX (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
PRODUCT_ORDER
which is some kind of relationship between the two entity types
CUSTOMER and PRODUCT.
What do I please have to insert in order to achieve some
evidence for the existence of referential integrity ?
please ?
ON UPDATE CASCADE I feel means something like that
the actual data is propagated due
I believe that your ON UPDATE CASCADE clause should be in the definition for the
PRODUCT and
CUSTOMER table rather than the PRODUCT_ORDER table.
However, I don't think that it will work how you expect.
ON UPDATE CASCADE means that everytime you update a row in this table then all rows in
other
Fraser,
- Original Message -
From: Fraser Hanson [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Wednesday, August 06, 2003 5:46 AM
Subject: ON UPDATE CASCADE fails
Hello,
I have a table which has a foreign key relationship with itself. I
want and expect my updates
CASCADE ON UPDATE CASCADE,
PRIMARY KEY (name)
) TYPE=INNODB;
# Insert some example data
INSERT INTO person (name,parent) VALUES ('Grandpa', 'Grandpa');
INSERT INTO person (name,parent) VALUES ('John', 'Grandpa');
INSERT INTO person (name,parent) VALUES ('Baby Bob', 'John');
mysql select * from
I forgot to mention that I am using mysql 4.0.14-nt on Windows 2000.
--Fraser
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
HI I'm not sure whether it's a bug or my configuration problem??
I have upgraded mysql from 3.23.53 to 4.0.12 so that the on update
cascade will work! then the I got mysql crash when I did the update.
Any idea??
mysql CREATE TABLE software (
- softwareID CHAR(20) NOT NULL
Vinita,
thank you for the bug report. The BLOB silently changes the CHAR(20) field
to a VARCHAR(20) field in te parent table. But the field in the child stays
CHAR(20).
There is a bug in ON UPDATE CASCADE which forgets to pad the field in the
child table with spaces. The child table becomes
NOT NULL default '0',
`Lft` smallint(5) unsigned NOT NULL default '0',
`Rgt` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`ShopId`),
KEY `Node` (`Node`),
CONSTRAINT `0_2042` FOREIGN KEY (`Node`) REFERENCES `Shops` (`ShopId`)
ON DELETE CASCADE ON UPDATE CASCADE
) TYPE=InnoDB
On Monday 06 January 2003 14:51, Daniel Kiss wrote:
Does anyone know why 'on update cascade' option does not work in InnoDB
foreign keys?
Is it supported anyway?
It's supported since 4.0.8:
http://www.mysql.com/doc/en/News-4.0.8.html
--
For technical support contracts, goto https
Hi all,
Does anyone know why 'on update cascade' option does not work in InnoDB
foreign keys?
Is it supported anyway?
Thanks,
Daniel
mysql
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual
on update
cascade,
- logDate DATE NOT NULL,
- totalLic integer(5) NOT NULL,
- requestLic integer(5) NOT NULL,
- issuedLic integer(5) NOT NULL,
- queuedLic integer(5) NOT NULL,
- deniedLic integer(5) NOT NULL) TYPE=INNODB;
Query OK, 0 rows affected (0.00 sec)
mysql insert
licenseID is
the primary key in license_info, and foreign key in license_data.
But I tested it didn't work the way as like in Oracle delete cascade or
update cascade.
Did I do something incorrect?
mysql create table samDB.license_info (
- licenseID integer(5) auto_increment primary key
it didn't work the way as like in Oracle delete cascade or
update cascade.
Did I do something incorrect?
mysql create table samDB.license_info (
- licenseID integer(5) auto_increment primary key,
- vendorName VARCHAR(30) NOT NULL,
- featureName VARCHAR(30) NOT NULL
(licenseID) match full
on delete cascade on update cascade,
- logDate DATE NOT NULL,
- totalLic integer(5) NOT NULL,
- requestLic integer(5) NOT NULL,
- issuedLic integer(5) NOT NULL,
- queuedLic integer(5) NOT NULL,
- deniedLic integer(5) NOT NULL) TYPE=INNODB;
Query OK, 0 rows
At 15:12 -0800 12/11/02, Jing Dai wrote:
After install mysql-max 3.23.52 and enable innodb setting in /etc/my.cnf
file, recreate table, this time
show create table indicated it's innodb type, but tried update on cascade
still not working.
ON DELETE CASCADE is implemented, but ON UPDATE CASCADE
I am just working on mySQL and create two tables, defined licenseID is
the primary key in license_info, and foreign key in license_data.
But I tested it didn't work the way as like in Oracle delete cascade or
update cascade.
Did I do something incorrect?
mysql create table samDB.license_info
Hello.
On Tue 2002-12-10 at 16:05:05 -0800, [EMAIL PROTECTED] wrote:
I am just working on mySQL and create two tables, defined licenseID is
the primary key in license_info, and foreign key in license_data.
But I tested it didn't work the way as like in Oracle delete cascade or
update cascade
NOT NULL AUTO_INCREMENT,
AID INTEGER,
name VARCHAR(20),
PRIMARY KEY (id),
INDEX(AID) ,
FOREIGN KEY (AID) REFERENCES A (id)
ON UPDATE CASCADE
);
mysql insert into A values
(null, 'one'), (null, 'two');
mysql select * from A;
++--+
| id | name
(id)
);
CREATE TABLE B (
id INTEGER NOT NULL AUTO_INCREMENT,
AID INTEGER,
name VARCHAR(20),
PRIMARY KEY (id),
INDEX(AID) ,
FOREIGN KEY (AID) REFERENCES A (id)
ON UPDATE CASCADE
);
I believe that ON UPDATE CASCADE doesn't work yet
NOT NULL AUTO_INCREMENT,
AID INTEGER,
name VARCHAR(20),
PRIMARY KEY (id),
INDEX(AID) ,
FOREIGN KEY (AID) REFERENCES A (id)
ON UPDATE CASCADE
);
mysql insert into A values
(null, 'one'), (null, 'two');
mysql select * from A;
++--+
| id | name
Hello,
I create innoDB tables database in mysql3.23.49.
i create foreign key constraints(On UPdate cascade) in
one table. but it seems doesn't work. the system just
refused to update.
I am wondering the innodb in mysql doesn't support the
feature like on update cascade or on delete cascade
Hi!
The brand-new source prerelease 3.23.50b-pre which you can download from
http://www.innodb.com supports ON DELETE CASCADE and ON DELETE SET NULL. But
does not support ON UPDATE CASCADE. Typically a foreign key refers to the
primary key of another table, and it is not that common a primary
30 matches
Mail list logo