Bug #78760 Using tabs for whitespace results in "you have an error in your SQL syntax..."
Submitted: 8 Oct 2015 15:02 Modified: 9 Oct 2015 5:41
Reporter: Mathieu van Loon Email Updates:
Status: Verified Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version:6.9.6, 6.9.7 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[8 Oct 2015 15:02] Mathieu van Loon
Queries that are formatted using newlines (CRLF) and tabs yield "you have an error in your SQL syntax...". Downgrading to version 6.9.5 of the MySQL connector.NET resolves the issue.

The issue appeared in a large codebase that has been in production for many years and in simple queries of the form SELECT x FROM table WHERE y=z AND j=k. In these queries all whitespace are tabs and newlines.

Bug marked as serious because we cannot use the latest version of the connector.

How to repeat:
Construct a query in the form SELECT\t*\r\n\t\tFROM\tSomeTable\r\n\tWHERE\tetcetera.

It appears to be important that all whitespace is newlines or tabs (no spaces). Unfortunately I have not been able to construct a good generic example of the bug, hopefully someone else can provide one. It also seems that the bug does not appear in all queries that follow the above pattern :(
[9 Oct 2015 5:41] Chiranjeevi Battula
Hello  Mathieu van Loon,

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

[9 Oct 2015 5:42] Chiranjeevi Battula

Attachment: 78760.PNG (image/png, text), 98.90 KiB.

[13 Oct 2015 23:43] Abraham Guyt
What doesn't help is that reverting back to the still working 6.9.5 version cannot be done using the MySql Installer for Windows (failed download), and requires a manual download from the archives.

This bug seems to occur when using a parametrised query.
[5 May 2016 12:15] Chiranjeevi Battula
http://bugs.mysql.com/bug.php?id=81323 marked as duplicate of this one.