=== modified file 'driver/options.c' --- driver/options.c 2011-09-29 21:22:18 +0000 +++ driver/options.c 2012-04-19 11:10:44 +0000 @@ -434,10 +434,16 @@ return set_handle_error(SQL_HANDLE_DBC, hdbc, MYERR_S1000, "Unable to get current catalog", 0); } - else + else if (is_connected(dbc)) { *char_attr= (SQLCHAR *)(dbc->database ? dbc->database : "null"); } + else + { + return set_handle_error(SQL_HANDLE_DBC, hdbc, MYERR_S1C00, + "Getting catalog name is not supported "\ + "before connection is established", 0); + } break; case SQL_ATTR_LOGIN_TIMEOUT: