Bug #8182 InnoDB, FOREIGN KEY ... ON DELETE SET DEFAULT
Submitted: 28 Jan 2005 17:14 Modified: 31 Jan 2005 14:06
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: Marko Mäkelä CPU Architecture:Any

[28 Jan 2005 17:14] Matthias Leich
Description:
The current InnoDB behaviour differs from the manual. It looks like "ON DELETE SET DEFAULT"
is rejected by the server. Maybe it was accepted in history.
SET SESSION STORAGE_ENGINE=INNODB;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
ID BIGINT NOT NULL,
PRIMARY KEY(ID));
CREATE TABLE t2 (
ID BIGINT DEFAULT 0,
FOREIGN KEY (ID) REFERENCES t1 (ID) ON DELETE SET DEFAULT
);
ERROR HY000: Can't create table './test/t2.frm' (errno: 150)
The manual says in      15.7.4. FOREIGN KEY Constraints
that ON DELETE SET DEFAULT will be parsed but ignored.

My environment:
   - Intel PC with Linux(SuSE 9.1)
   - MySQL compiled from source
        Version 5.0 ChangeSet@1.1616.1.533, 2005-01-28

How to repeat:
Please use the statements above.

Suggested fix:
Please change only the manual.
The server should NOT accept but ignore statement parts claiming important functionality.
I like the current honest InnoDB behaviour very much.
[31 Jan 2005 14:06] Marko Mäkelä
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Thank you for your bug report. InnoDB has its own foreign key parser, which I guess has always rejected SET DEFAULT. (I tested with most recent 5.0 and 4.0 trees.) The MySQL parser parses but ignores all foreign key definitions. I have updated the documentation.