Bug #3395 Garbage at the end of statement allowed, while it should not
Submitted: 5 Apr 2004 15:56 Modified: 6 Apr 2004 2:25
Reporter: Peter Zaitsev (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0 OS:Any (all)
Assigned to: Sergei Golubchik CPU Architecture:Any

[5 Apr 2004 15:56] Peter Zaitsev
Description:
We allow any garbage at the end of line, which is not very nice.

To most typical "typos" which makes uses this bugs are

select * from table limit10;

select count(*)  mytable;

How to repeat:
mysql> select version() somegarbagehere;
+-----------------+
| somegarbagehere |
+-----------------+
| 4.0.18-log      |
+-----------------+
1 row in set (0.00 sec)
[6 Apr 2004 1:06] Marko Mäkelä
Did you miss that the AS keyword is optional: "select version() somegarbagehere" is equivalent to "select version() AS somegarbagehere".  At least that case seems valid behaviour.
[6 Apr 2004 2:25] Sergei Golubchik
Nothing we can do here. AS is optional in SQL:2003