In Jannie's problem,

CREATE TABLE pub_access_type(
 access_type_id INT UNSIGNED NOT NULL,
 access_type_name VARCHAR(25),
 PRIMARY KEY(access_type_id)
) TYPE=INNODB;

CREATE TABLE pub_user(
 user_id INT UNSIGNED,
 parent_id INT,
 user_fname VARCHAR (25),
 user_lname VARCHAR (25),
 user_password VARCHAR (25),
 INDEX par_ind(parent_id),
 FOREIGN KEY parent_id REFERENCES pub_access_type(access_type_id)
 ON DELETE SET NULL
) TYPE=INNODB;

MySQL correctly refuses to create pub_user because it has been asked to
reference an unsigned key, pub_access_type(access_type_id), with the signed
key parent_id.

Jannie found that MySQL accepts the incorrect key reference if the
referencing key is aliased ...

...
FOREIGN KEY pub_user(parent_id) ...
...

But consider what will happen when parent_id wraps around. Looks like a bug.

PB




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to