Merge anthm's ODBC sanity check fix (bug #3529)