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

[9 Feb 2016 15:15] Joseph Leathlean

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')
[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. 

[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.
[9 Feb 2023 8:12] Bogdan Degtyariov
Posted by developer:
This issue is no longer repeatable with Connector/ODBC 8.0 Unicode Driver.
Closing the bug with "Could not reproduce" status.
[9 Feb 2023 8:18] Bogdan Degtyariov
Posted by developer:
Tested using ODBC driver version 8.0.32.
The query with tab and <CR> run without problems:

select * from OPENQUERY(MYSQL, '	SELECT * FROM test.data_test')