Bug #6925 Comment/*COMMENT*/is not a separator
Submitted: 1 Dec 2004 20:07 Modified: 7 May 2005 23:14
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Antony Curtis CPU Architecture:Any

[1 Dec 2004 20:07] Peter Gulutzan
Description:
From the SQL:2003 standard document: 
"SQL text containing one or more instances of <comment> is equivalent to 
the same SQL text with the <comment> replaced with <newline>." 
Further, comments are described as "separators". 
 
But MySQL treats /**/ as if it's not there at all, that is, it is not a separator. 
So abc/**/def looks like abcdef instead of abc<newline>def. 
Therefore comments don't separate tokens (bug), 
and -- comments aren't ended by /**/ comments (bug). 
 

How to repeat:
mysql> select * from t where s1/**/is/**/null; 
ERROR 1054 (42S22): Unknown column 's1isnull' in 'where clause' 
 
mysql> create table t (s1 int -- /**/ ) 
    -> ; 
ERROR 1064 (42000): You have an error in your SQL syntax; ...
[1 Dec 2004 20:35] MySQL Verification Team
Thank you for the bug report.
[7 May 2005 23:14] Antony Curtis
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html