Bug #5416 MySQL 4.0.20 accepts wrong query syntax
Submitted: 5 Sep 2004 4:18 Modified: 5 Sep 2004 5:46
Reporter: Jorge del Conde Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.20 OS:Any (All)
Assigned to: CPU Architecture:Any

[5 Sep 2004 4:18] Jorge del Conde
Description:
MySQL 4.0.20 accepts an incorrect query syntax.

How to repeat:
Execute the following queries in MySQL 4.0.20:

DELETE links FROM links l, answers a WHERE l.to_node = a.a_id AND a.status_type = 5 AND l.from_node NOT LIKE 'http%';

and

DELETE links FROM links l, links_status_fix f WHERE l.from_node=f.from_node;

The correct syntax should be:

DELETE l FROM links, l ... since the links table is aliased.

These 2 queries correctly return an error in 4.1 & 5.0, but when executing the correct syntax in 4.0.20, the following error is dumped:

ERROR 1066: Not unique table/alias: 'l'
[5 Sep 2004 5:46] Jorge del Conde
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

This was a bogus bug-report.  This behaviour is explained in:  http://dev.mysql.com/doc/mysql/en/DELETE.html