Bug #43350 mysql-connector-odbc-5.1.5r1144/setupgui/configdsn.c configdsnW ODBC_ADD_DSN
Submitted: 4 Mar 2009 7:07 Modified: 4 Mar 2009 7:14
Reporter: li yijun Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.5r1144 OS:Windows (xp)
Assigned to: CPU Architecture:Any
Tags: configdsnW, ds_set_strattr, hWnd, ODBC_ADD_DSN

[4 Mar 2009 7:07] li yijun
Description:
code: 
   ds_set_strattr(&ds->driver, driver->lib);
  case ODBC_CONFIG_DSN:
#ifdef _WIN32
    /*
      for windows, if hWnd is NULL, we try to add the dsn
      with what information was given
    */
    if (!hWnd || ShowOdbcParamsDialog(ds, hWnd, FALSE) == 1)

problem:
if hWnd is NULL,ShowOdbcParamsDialog can not run,so ds->driver should be driver->name,but now ds->driver is not driver->name,is driver->lib.so it is a bug.

How to repeat:
can not create a dsn through calling SQLConfigDatasource(..,ODBC_ADD_DSN,...)

Suggested fix:
		
add 

if(!hWnd)
{
    ds_set_strattr(&ds->driver,driver->name);
} 

into 

if (!hWnd || ShowOdbcParamsDialog(ds, hWnd, FALSE) == 1)
{
...
}
[4 Mar 2009 7:14] Tonci Grgin
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Explanation:

Hi Le and thanks for your report.
This is a duplicate of Bug#41796 which is fixed and will be released in next version. Please see details and patch there.