Bug #66548 Driver use the char ';' as separator in attributes string instead of the '\0'
Submitted: 27 Aug 2012 9:01 Modified: 15 Jul 2013 23:31
Reporter: Anton Serbulov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.11,5.2.2 OS:Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any

[27 Aug 2012 9:01] Anton Serbulov
Description:
See http://bugs.mysql.com/bug.php?id=41867 (comment from "wu fenpeng")
---
[1 Aug 3:11] wu fenpeng

MySQL ODBC 5.1 Driver use the char ';' in attributes string instead of the '\0'
---

See: http://msdn.microsoft.com/en-us/library/windows/desktop/ms709275%28v=vs.85%29.aspx
---
Each pair should be terminated with a null byte, and the entire list is terminated with a null byte
---

How to repeat:
Create DNS by call:
SQLConfigDataSourceW(NULL, ODBC_ADD_SYS_DSN, 
    L"MySQL ODBC 5.1 Driver", 
    L"DSN=DSN_Name\0" 
    L"Server=127.0.0.1\0" 
    L"Database=Database_Name\0");

Check created DSN: Attributes "Server" and Database are lost.
[27 Aug 2012 9:04] Anton Serbulov
Sorry, correct call is:

SQLConfigDataSourceW(NULL, ODBC_ADD_SYS_DSN, 
    L"MySQL ODBC 5.1 Driver", 
    L"DSN=DSN_Name\0" 
    L"Server=127.0.0.1\0" 
    L"Database=Database_Name\0\0");
[29 Nov 2012 10:26] Bogdan Degtyariov
Verified with 5.1 and 5.2
[3 Dec 2012 10:09] Bogdan Degtyariov
Patch and test case

Attachment: bug66548.diff (application/octet-stream, text), 6.98 KiB.

[3 May 2013 10:26] Lawrenty Novitsky
The patch has been pushed as rev#1137 to the 5.2 branch, and as rev#1096 to the 5.1 branch
[15 Jul 2013 23:31] Daniel So
Added the following entry into Connector/ODBC 5.2.6 and 5.1.13 changelogs:

Connector/ODBC used the “;” character instead of a null byte (“\0”) to terminate keyword-value pairs in attribute strings.