Index: ChangeLog =================================================================== --- ChangeLog (revision 737) +++ ChangeLog (working copy) @@ -3,6 +3,8 @@ Functionality added or changed: Bugs fixed: + * The FLAG_NO_PROMPT option was not handled by SQLDriverConnect(). + (Bug #30840) * The specified length of the username and authentication parameters to SQLConnect() were not being honored. (Bug #30774) * SQLGetData() will now always return SQL_NO_DATA_FOUND on second call Index: driver/connect.c =================================================================== --- driver/connect.c (revision 737) +++ driver/connect.c (working copy) @@ -382,6 +382,7 @@ MYODBCUTIL_DRIVER *pDriver= MYODBCUtilAllocDriver(); BOOL bPrompt= FALSE; HMODULE hModule= NULL; + unsigned long options; /* Parse the incoming string */ if (!MYODBCUtilReadConnectStr(ds, (LPCSTR)szConnStrIn)) @@ -403,6 +404,14 @@ (void)MYODBCUtilReadDataSource(ds, ds->pszDSN); #endif + /* If FLAG_NO_PROMPT is no set, force prompting off. */ + if (ds->pszOPTION) + { + options= strtoul(ds->pszOPTION, NULL, 10); + if (options & FLAG_NO_PROMPT) + fDriverCompletion= SQL_DRIVER_NOPROMPT; + } + /* We only prompt if we need to. Index: test/my_basics.c =================================================================== --- test/my_basics.c (revision 737) +++ test/my_basics.c (working copy) @@ -451,6 +451,37 @@ } +/** + Bug #30840: FLAG_NO_PROMPT doesn't do anything +*/ +DECLARE_TEST(t_bug30840) +{ + HDBC hdbc1; + SQLCHAR conn[256], conn_out[256]; + SQLSMALLINT conn_out_len; + + sprintf((char *)conn, "DSN=%s;UID=%s;PASSWORD=%s;OPTION=16", + mydsn, myuid, mypwd); + if (mysock != NULL) + { + strcat((char *)conn, ";SOCKET="); + strcat((char *)conn, (char *)mysock); + } + + ok_env(henv, SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc1)); + + ok_con(hdbc1, SQLDriverConnect(hdbc1, NULL, conn, sizeof(conn), conn_out, + sizeof(conn_out), &conn_out_len, + SQL_DRIVER_PROMPT)); + + ok_con(hdbc1, SQLDisconnect(hdbc1)); + + ok_con(hdbc1, SQLFreeHandle(SQL_HANDLE_DBC, hdbc1)); + + return OK; +} + + BEGIN_TESTS ADD_TEST(my_basics) ADD_TEST(t_max_select) @@ -464,6 +495,7 @@ ADD_TEST(charset_gbk) ADD_TEST(t_bug7445) ADD_TEST(t_bug30774) + ADD_TEST(t_bug30840) END_TESTS