Quotes in Foreign Key Constraint

Quotes in Foreign Key Constraint

am 17.06.2003 16:18:24 von Jan Langhans

Hallo,

I'm trying to port our Oracle-App to MySQL 4.0.13-nt on Windows 2000 FP 3 (Connection thru MyODBC 3.51).
I've set the default-table-type to InnoDB and the ansi-Option is enabled to allow the quoting of column names.
When I try to quote the names of the referenced column and/or the referencing column in a foreign key constraint the create statement will fail as demonstrated by the
following example:

CREATE TABLE ta ("ca" INTEGER NOT NULL, INDEX ("ca"))
OK

CREATE TABLE tb ("rca" INTEGER, "cb" INTEGER, INDEX ("rca"), FOREIGN KEY ("rca") REFERENCES ta("ca") ON DELETE CASCADE)

Fails with
[MySQL][ODBC 3.51 Driver][mysqld-4.0.13-nt]Can't create table '.\typotext\tb.frm' (errno: 150)

If I remove the quotes in the constraint like in
CREATE TABLE tb ("rca" INTEGER, "cb" INTEGER, INDEX ("rca"), FOREIGN KEY (rca) REFERENCES ta(ca) ON DELETE CASCADE)
the table is created without error.

This looks like a bug to me, witch I haven't found documented anywhere.

Bye,
Jan





--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org