MySQL Forums
Forum List  »  Docs

Re: InnoDB foreign key doc/code error
Posted by: greg
Date: September 13, 2006 12:08PM

I'm finding the same issue - the "faculty_id integer not null references faculty
> (id),"-type syntax sporadically just fails to create the foreign key, but using the "foreign key (`system_script_id`) references `system_script` (`id`)" syntax at the end seems to always succeed.

(I'm using v5.0.22).

Any help would be appreciated,
Greg


Ron Savage Wrote:
-------------------------------------------------------
> V 5.0.15 section 15.6.4 and V 5.0.18 section
> 14.2.6.4 of the manual says:
> "You can display the foreign key constraints for a
> table like this:
> SHOW TABLE STATUS FROM db_name LIKE 'tbl_name';
> The foreign key constraints are listed in the
> Comment column of the output."
>
> Wrong. The constraints aren't listed. What I see
> in that column is:
> "InnoDB free: 12288 kB".
>
> The command 'show create table department'
> returns:
> "CREATE TABLE `department` ( `id` int(11) NOT NULL
> auto_increment, `faculty_id` int(11) NOT NULL,
> `name` varchar(255) NOT NULL, `name_key`
> varchar(255) NOT NULL, PRIMARY KEY (`id`) )
> ENGINE=InnoDB DEFAULT CHARSET=latin1"
>
> My create sql for the department table contains
> this:
> "faculty_id integer not null references faculty
> (id),"
>
> So, is MySQL really discarding the references
> clause, or is it stored somewhere I can access
> (via a 'show something') command?

Options: ReplyQuote


Subject
Views
Written By
Posted
3836
April 20, 2006 07:11PM
Re: InnoDB foreign key doc/code error
2740
September 13, 2006 12:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.