Bug #80320 MySQL Unicode Driver Fails when 1st character of query a Tab or C/R
Submitted: 9 Feb 2016 15:15 Modified: 10 Feb 2016 11:50
Reporter: Joseph Leathlean Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.03.04 OS:Microsoft Windows (64 bit Server)
Assigned to: CPU Architecture:Any

[9 Feb 2016 15:15] Joseph Leathlean
Description:
Configuration:

SQL Server 2014 Enterprise
MySQL ODBC 64 bit 5.03.04 
ODBC Unicode Connector pointing to MySQL Database
Linked Server pointing to ODBC Connector

How to repeat:
Execute the query:  SELECT * FROM OPENQUERY(<LinkedServer>,'<tab>SELECT * FROM accounts')
or SELECT * FROM OPENQUERY(<LinkedServer>,'<C/R>SELECT * FROM accounts')

Msg 7357, Level 16, State 2, Line 1
Cannot process the object "	select * from accounts". The OLE DB provider "MSDASQL" for linked server "<LinkedServer" indicates that either the object has no columns or the current user does not have permissions on that object.

Execute the same queries using the ANSI driver are successful.  This only occurs when using the Unicode Driver

Execute the query:  SELECT * FROM OPENQUERY(<LinkedServer>,'SELECT * FROM accounts')
 
Success
[10 Feb 2016 11:50] Chiranjeevi Battula
Hello Joseph Leathlean,

Thank you for the bug report.
Verified this behavior on MySQL Connector/ODBC 5.3.4 Unicode Driver. 

Thanks,
Chiranjeevi.
[10 Feb 2016 11:51] Chiranjeevi Battula
Unicode screenshot.

Attachment: 80320_Unicode.PNG (image/png, text), 168.15 KiB.

[10 Feb 2016 11:52] Chiranjeevi Battula
ANSI screenshot.

Attachment: 80320_ANSI.PNG (image/png, text), 168.83 KiB.

[27 Aug 2019 7:14] Thejaka Maldeniya
This issue is still not fixed in mysql-connector-odbc-8.0.17-winx64. Took me a long time to figure out what was causing the error. It was a leading C/R that was used to format the code.