Bug #31495 Attempt to create System DSN results in User DSN on Mac OS X
Submitted: 10 Oct 2007 1:07 Modified: 22 May 2008 23:05
Reporter: Danny Kohn
Status: Verified
Category:Connector/ODBC Severity:S2 (Serious)
Version:3.51.20, 3.51.25, 5.1.4 OS:Mac OS X (10.4.10)
Assigned to: Jim Winstead Target Version:3.51+
Triage: D3 (Medium)

[10 Oct 2007 1:07] Danny Kohn
Description:
When attempting to create a System DNS data source with the MySQL Connector ODBC, the
result ends up as a User DNS. This happens with both 3.51.20 and 5.1.0 alpha.

Jim Winstead replied to my forum post regarding this issue stating "it looks like a bug
in Mac OS X's iODBC driver manager that we'll need to work around."
http://forums.mysql.com/read.php?37,176224,176234#msg-176234

How to repeat:
When using OS X ODBC Administrator and clicking "Add" under the System DNS tab, the
resulting DNS show up under the User DNS tab.

When using the command line myodbc3i with the -ss flag, it shows under the -su list and
not the -ss list.
[29 Oct 2007 22:39] Jim Winstead
This is still broken with Leopard.
[4 Mar 2008 4:14] Jim Winstead
Work around iODBC config mode bug, and set correct perms in postflight

Attachment: bug31495.diff (text/plain), 17.64 KiB.

[4 Mar 2008 4:15] Jim Winstead
This is because of bugs in the iODBC driver manager install API, which incorrectly resets
the configuration mode as functions are called.

Even when this problem in iODBC is worked around, it is possible that the ODBC
Administrator application cannot register a system DSN because of incorrect permissions
on /Library/ODBC/odbc.ini. This file must be made writable by the 'admin' group. The
patch fixes the installer to do this.
[12 Mar 2008 16:20] Darrell Rohl
Still a problem (and a quite critical one) for me. Is there any estimate on how long the
patch will be pending? Is it possible to get an already-patched installer?
[12 Mar 2008 17:36] Lawrin Novitsky
it's ok w/ one important remark.
MYODBCUtilReadDataSource.c doesn't compile on Win
move "SAVE_MODE();" after nMode definition in #if defined(WIN32) block, add #else, and
copy it there too.

and couple small things:
 "... we we start" in postflight in comment;
and probably it's better to undef WRITE_VALUE in MYODBCUtilWriteDataSource.c after use.
[12 Mar 2008 17:41] Jim Winstead
The fix for this has been committed, and will be included in the upcoming 3.51.24 release.
[14 Mar 2008 19:42] MC Brown
A note has been added to the 3.51.24 changelog: 

When creating a System DSN using the ODBC Administrator on Mac OS X, a User DSN would be
created instead. The root cause is a problem with the iODBC driver manager used on Mac OS
X. The fix works around this issue.

Note

ODBC Administrator may still be unable to register a System DSN unless the
/Library/ODBC/odbc.ini file has the correct permissions. You should ensure that the file
is writable by the admin group.

(Same note added to main C/ODBC documentation)
[22 May 2008 23:05] Sveta Smirnova
Reopen as bug is repeatable for me with version 3.51.25 even with permissions 777 for
/Library/ODBC/odbc.ini (I tried 664 at first)

See also bug #36820
[22 May 2008 23:20] Sveta Smirnova
Version 5 affected as well.

Tested on Tiger 10.4.11
[22 May 2008 23:30] Sveta Smirnova
Currently bug is repeatable only with Tiger.

The workaround is to use the command-line myodbc3i or myodbc-installer utility for
creating system dsns or upgrade to Leopard.