with 'mac os x' tag

my mac essentials

whenever i see somebody’s list of essential mac applications, i am always a little surprised at how little overlap it has for me. now that i’ve mostly switched over the new macbook pro, here’s the list of applications that i have installed:

of the bundled software, i regularly use address book, ical, iphoto, itunes, mail (for my sun/mysql email), preview, safari, and terminal. and i use time machine, but i hope i don’t have to regularly use it.

building c/odbc 5.1 on mac os x

to build connector/odbc 5.1 on mac os x leopard, the first thing you will need is xcode. then you will want to install a recent version of mysql (5.0 or 5.1, or even 6.0 if you are feeling adventurous).

to be able to build the gui setup library, you will need to install qt, but i have found it easiest to work with qt3, not the latest qt4. you can download the last release of that from trolltech’s ftp server — the file is called qt-mac-free-3.3.8.tar.gz. you will need to apply this patch to allow it to compile on leopard. i configure it with some options to eliminate stuff i don’t care about, and to build statically:

./configure -no-tablet -no-accessibility -no-cups -thread -static

with those prerequisites met, you can download the source for connector/odbc (using the release packages or svn for now, and we will migrate to bzr soon). i build with the gui enabled and with debugging symbols and no optimization:

./configure --with-qt-dir=/path/to/qt-mac-free-3.3.8 \
--with-extra-xlibs="-framework Carbon -framework QuickTime -lz" \
--enable-dmlink --with-debug CFLAGS="-O0 -g"

that should be enough to get the driver compiled. the test suite should mostly pass — there is one test in the my_basics suite that fails because of bugs in the iODBC implementation of SQLCancel, which i reported to them last november.

there is also one other test that fails right now, but we are working on that. it is a test for a workaround for a server bug, and it’s not clear whether the test case needs to be updated for the unicode-aware connector/odbc 5.1, or if the fix we applied in connector/odbc 3.51 didn’t get merged correctly into the 5.1 tree.

iodbc and mac os x problems

working with the iodbc driver manager on mac os x has been a frustration on two fronts.

first, the installer api functions provided by iodbc constantly set the configuration mode to ODBC_BOTH_DSN, which means you have to keep resetting it to the correct value after nearly every installer api call. this problem is platform-agnostic — the iodbc code is just plain wrong.

second, when called from the odbc administrator application on mac os x, any failures that the driver reports or passes through from the installer api in registering the driver are ignored, and the application instead uses a generic prompt for dsn configuration.

so even with the first problem fixed, the second problem has led to a lot of tail-chasing until i discovered that the odbc administrator application only obtains enough privileges to write to /Library/ODBC as a member of the admin group, not as the root user. because the connector/odbc installer was trying to be helpful in only creating the /Library/ODBC/*.ini files with root-writable permissions, it was running straight into the second problem.

this is all related to bug #31495 filed against mysql connector/odbc.

mac os x programming help needed

one of the features we had planned for mysql connector/odbc 5.1 is native setup libraries for the major platforms. we have the microsoft windows version going, and some code to get us going on linux/unix (using gtk instead of qt), but our gui team is too busy to get us started on a native mac os x version.

anyone want to pitch in by showing us how to get a basic dialog window to pop up based on a c library call? i think we will be able to customize it from there, but i am just unfamiliar enough with mac os x gui programming that i have a feeling it would take a long time for me to get that going.