Bug #697 foreign key doesn't work any table is named user.

Submitted: 22 Jun 2003 18:51 Modified: 23 Jun 2003 1:33
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version: OS:Windows (windows)
Assigned to: CPU Architecture:Any

[22 Jun 2003 18:51] [ name withheld ]
Description:
I know that Mysql 4.x with InnoDB supports foreign key.
But the foreign key doesn't work when it references other table is named
[user], if the table name is [users], it will be good job.

ex) foreign key references user(u_id) on delete set null;

*------------------------------------*
Gwang-Tae Kim  <acacia@mizi.com>
Mizi Research.
Linux Platform Company.
*------------------------------------*

How to repeat:
change the name of table  to any other thins.
[23 Jun 2003 1:33] Indrek Siitan
You need to add a space between "user" and the starting parentheses, otherwise MySQL will parse 
it as a call to the user() function, which exists. So the correct syntax would be:

 foreign key references user (u_id) on delete set null;

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
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.