Bug #72221 Inline comment followed by semicolon produces parse error 1064
Submitted: 3 Apr 2014 14:18 Modified: 12 Dec 2014 12:12
Reporter: Matthias Maier Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:MySQL Connector/Net 6.6.5, MySQL 5.5.21 OS:Microsoft Windows (7 SP1)
Assigned to: CPU Architecture:Any
Tags: 1064, inline comment, parse error, semicolon

[3 Apr 2014 14:18] Matthias Maier
Description:
The MySQL Connector/Net 6.6.5 in combination with MySQL Server 5.5.21 produces a parse error when used with an inline comment followed direclty by a semicolon like:

/* comment */; SELECT CONNECTION_ID()

How to repeat:
Open attached Visual Studio project or start the already compiled SemicolonBug.exe with a connection string and the above mentioned statement (or run.bat batch file with example parameters):

semicolonBug "server=HOSTNAME;database=DATABASE;User Id=USER;password=XXXXXXX;Connect Timeout=172800;Default Command Timeout=172800;pooling=False;Allow User Variables=True;Allow Zero Datetime=True" "/* comment */; select CONNECTION_ID()"
Query: /* comment */; select CONNECTION_ID()
Exception number: 1064 Exception text: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select CONNECTION_ID()' at line 1

In MySQL Workbench 6.x with MySQL 5.5.21 the problem does not occur.

Suggested fix:
It should be possible to send statements containing a comment directly followed by a semicolon without generating a parse error.

Also usuefull for version dependent comments like:
/*!42302 SET sort_buffer_size=10000*/;
[3 Apr 2014 14:19] Matthias Maier
SemicolonBug.zip

Attachment: SemicolonBug.zip (application/x-zip-compressed, text), 526.20 KiB.

[12 Dec 2014 12:12] Chiranjeevi Battula
Hello  Matthias Maier,

Thank you for the bug report and test case.
Verified this behavior on Visual Studio 2013 (C#.Net) with  MySQL Connector/Net 6.9.5.

Thanks,
Chiranjeevi.