Bug #33822 MyODBC 5.1 GUI fails test connection with non-standard port
Submitted: 11 Jan 2008 16:42 Modified: 14 Feb 2008 16:37
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.1 OS:Microsoft Windows
Assigned to: Jess Balint
Tags: GUI, port, test
Triage: D3 (Medium)

[11 Jan 2008 16:42] Bogdan Degtyariov
Description:
MyODBC 5.1 GUI cannot connect to mysql server using ports other than 3306. If set up a new DSN and provide all parameters needed for connecting and click the "Test" button it displays the error message:

Connection Failed: [HY000][MySQL][ODBC 5.1 Driver] Can't connect to MySQL server on 'localhost' (10061)

This happens for localhost and for remote addresses.

NOTE: the driver itself and ODBC client applications work normally with such DSN.

How to repeat:
1. Run MySQL server using the port other than 3306 (say 8108)
2. Run Windows ODBC Data Source Administrator.
3. In System DSN tab click the "Add..." button
4. Provide the data source name, server, user, password
5. Put the port number 8108 into the Port input.
6. Click the Test button.
7. See the error message.

Suggested fix:
Seems to be a simple solution: read the port value at the test connection stage and use it for connecting on the needed port.
[11 Jan 2008 20:14] Jess Balint
fix number parsing (port was passed with ';' at the end)

Attachment: bug33822.diff (application/octet-stream, text), 694 bytes.

[12 Jan 2008 0:26] Jess Balint
updated patch

Attachment: bug33822.diff (application/octet-stream, text), 3.32 KiB.

[12 Jan 2008 0:48] Jess Balint
updated patch

Attachment: bug33822.diff (application/octet-stream, text), 3.60 KiB.

[12 Jan 2008 0:50] Jess Balint
updated patch

Attachment: bug33822.diff (application/octet-stream, text), 3.31 KiB.

[17 Jan 2008 16:45] Jess Balint
This fix has been committed to the source repository as revision 1004. It will be included in release 5.1.2.
[14 Feb 2008 16:37] MC Brown
A note has been added to the 5.1.2 changelog: 

Within the GUI interface, when connecting to a MySQL server on a non-standard port, the connection test within the GUI would fail. The issue was related to incorrect parsing of numeric values within the DSN when the option was not configured as the last parameter within the DSN