Foreign keys / Transactions in MySQL.. WTF?

Toby Corkindale tjc at wintrmute.net
Tue Jul 31 09:22:05 BST 2007


Aaron Crane wrote:
>> OK, and what about the foreign key support?
>>
>> mysql> create table foo (id serial primary key, bar integer not null
>> references somekeys(id)) Engine=InnoDB;
>> Query OK, 0 rows affected (0.03 sec)
> 
> MySQL supports only a small part of the standard syntax for foreign
> keys.  You have to specify them as table constraints (not column
> constraints), and you need to name the columns referred to:

But why oh why does MySQL happily accept the other syntax, and then
ignore it? </rhetorical>
At least if it generated errors one would realise one needed to find the
"special" MySQL syntax earlier..
*sigh*

How did MySQL get so popular when it still seems to be missing key
features? Ah, I shouldn't ask that, it's just gonna be trolling :)

tjc


More information about the london.pm mailing list