=== modified file 'driver/connect.c' --- driver/connect.c 2010-01-20 01:51:42 +0000 +++ driver/connect.c 2010-01-23 11:24:33 +0000 @@ -68,6 +68,8 @@ flags|= CLIENT_IGNORE_SPACE; if (ds->allow_multiple_statements) flags|= CLIENT_MULTI_STATEMENTS; + if (ds->clientinteractive) + flags|= CLIENT_INTERACTIVE; return flags; } === modified file 'setupgui/windows/odbcdialogparams.cpp' --- setupgui/windows/odbcdialogparams.cpp 2010-01-20 01:51:42 +0000 +++ setupgui/windows/odbcdialogparams.cpp 2010-01-23 17:41:57 +0000 @@ -240,6 +240,7 @@ GET_BOOL(CONNECTION_TAB, auto_reconnect); GET_BOOL(CONNECTION_TAB, force_use_of_named_pipes); GET_BOOL(CONNECTION_TAB, allow_multiple_statements); + GET_BOOL(CONNECTION_TAB, clientinteractive); getStrFieldData(¶ms.charset , CONNECTION_TAB, IDC_EDIT_charset); getStrFieldData(¶ms.initstmt, CONNECTION_TAB, IDC_EDIT_initstmt); @@ -289,6 +290,7 @@ SET_BOOL(CONNECTION_TAB, auto_reconnect); SET_BOOL(CONNECTION_TAB, force_use_of_named_pipes); SET_BOOL(CONNECTION_TAB, allow_multiple_statements); + SET_BOOL(CONNECTION_TAB, clientinteractive); if ( TabCtrl_1.hTabPages[CONNECTION_TAB-1]) { === modified file 'setupgui/windows/odbcdialogparams.rc' --- setupgui/windows/odbcdialogparams.rc 2009-12-08 17:52:49 +0000 +++ setupgui/windows/odbcdialogparams.rc 2010-01-23 17:41:29 +0000 @@ -77,6 +77,11 @@ COMBOBOX IDC_EDIT_charset,90,102,97,8,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP RTEXT "Initial Statement:",IDC_STATIC,12,117,67,8 EDITTEXT IDC_EDIT_initstmt,90,117,97,12,ES_AUTOHSCROLL + +// Second Column + CONTROL "Interactive Client",IDC_CHECK_clientinteractive, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,12,79,10 + END IDD_TAB2 DIALOGEX 0, 0, 209, 151 === modified file 'setupgui/windows/resource.h' --- setupgui/windows/resource.h 2009-10-07 19:06:20 +0000 +++ setupgui/windows/resource.h 2010-01-23 17:42:58 +0000 @@ -86,6 +86,7 @@ #define IDC_EDIT_sslcipher 10035 #define IDC_CHECK_handle_binary_as_char 10036 #define IDC_CHECK_save_queries 10037 +#define IDC_CHECK_clientinteractive 10040 #define IDC_BUTTON_TEST 11014 #define IDC_BUTTON_HELP 11015 #define IDC_STATIC -1 === modified file 'test/my_basics.c' --- test/my_basics.c 2010-01-20 01:51:42 +0000 +++ test/my_basics.c 2010-01-25 12:56:23 +0000 @@ -994,6 +994,83 @@ } +DECLARE_TEST(t_bug48603) +{ + SQLINTEGER timeout, interactive, diff= 1000; + SQLSMALLINT conn_out_len; + HDBC hdbc1; + HSTMT hstmt1; + SQLCHAR conn[256], conn_out[256], query[53]; + int result= OK; + + ok_sql(hstmt, "select @@wait_timeout, @@interactive_timeout"); + ok_stmt(hstmt,SQLFetch(hstmt)); + timeout= my_fetch_int(hstmt, 1); + interactive= my_fetch_int(hstmt, 2); + ok_stmt(hstmt, SQLFreeStmt(hstmt, SQL_CLOSE)); + + if (timeout == interactive) + { + /* Changing globally interactive timeout to be able to test + if INTERACTIVE option works */ + SQLRETURN rc; + sprintf((char *)query, "set GLOBAL interactive_timeout=%d", timeout + diff); + rc= SQLExecDirect(hstmt, query, SQL_NTS); + + if (!SQL_SUCCEEDED(rc)) + { + printMessage("Don't have rights to change interactive timeout globally - so can't really test if option INTERACTIVE works"); + //return FAIL; + } + + ok_stmt(hstmt, SQLFreeStmt(hstmt, SQL_CLOSE)); + } + else + diff= interactive - timeout; + + /* INITSTMT={set @@wait_timeout=%d} */ + sprintf((char *)conn, "DSN=%s;UID=%s;PWD=%s;CHARSET=utf8;INITSTMT={set @@interactive_timeout=%d};INTERACTIVE=1", + mydsn, myuid, mypwd, timeout+diff); + + if (mysock != NULL) + { + strcat((char *)conn, ";SOCKET="); + strcat((char *)conn, (char *)mysock); + } + if (myport) + { + char pbuff[20]; + sprintf(pbuff, ";PORT=%d", myport); + strcat((char *)conn, pbuff); + } + + 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_NOPROMPT)); + ok_con(hdbc1, SQLAllocStmt(hdbc1, &hstmt1)); + ok_sql(hstmt1, "select @@wait_timeout"); + ok_stmt(hstmt1,SQLFetch(hstmt1)); + + if ((timeout+diff) != my_fetch_int(hstmt1, 1)) + result= FAIL; + + ok_stmt(hstmt1, SQLFreeStmt(hstmt1, SQL_DROP)); + ok_con(hdbc1, SQLDisconnect(hdbc1)); + ok_con(hdbc1, SQLFreeHandle(SQL_HANDLE_DBC, hdbc1)); + + if (timeout == interactive) + { + /* setting global interactive timeout back if we changed it */ + sprintf((char *)query, "set GLOBAL interactive_timeout=%d", timeout); + ok_stmt(hstmt, SQLExecDirect(hstmt, query, SQL_NTS)); + } + + return result; +} + + BEGIN_TESTS ADD_TEST(my_basics) ADD_TEST(t_max_select) @@ -1020,6 +1097,7 @@ ADD_TEST(t_bug31959) ADD_TEST(t_bug41256) ADD_TEST(t_bug44971) + ADD_TEST(t_bug48603) END_TESTS === modified file 'util/installer.c' --- util/installer.c 2010-01-20 01:51:42 +0000 +++ util/installer.c 2010-01-23 15:30:50 +0000 @@ -162,6 +162,9 @@ {'N','O','_','B','I','N','A','R','Y','_','R','E','S','U','L','T',0}; static SQLWCHAR W_DFLT_BIGINT_BIND_STR[]= {'D','F','L','T','_','B','I','G','I','N','T','_','B','I','N','D','_','S','T','R',0}; +static SQLWCHAR W_CLIENT_INTERACTIVE[]= + {'I','N','T','E','R','A','C','T','I','V','E',0}; + /* DS_PARAM */ /* externally used strings */ const SQLWCHAR W_DRIVER_PARAM[]= {';', 'D', 'R', 'I', 'V', 'E', 'R', '=', 0}; @@ -188,7 +191,8 @@ W_FORWARD_CURSOR, W_AUTO_RECONNECT, W_AUTO_IS_NULL, W_ZERO_DATE_TO_MIN, W_MIN_DATE_TO_ZERO, W_MULTI_STATEMENTS, W_COLUMN_SIZE_S32, - W_NO_BINARY_RESULT, W_DFLT_BIGINT_BIND_STR}; + W_NO_BINARY_RESULT, W_DFLT_BIGINT_BIND_STR, + W_CLIENT_INTERACTIVE}; static const int dsnparamcnt= sizeof(dsnparams) / sizeof(SQLWCHAR *); /* DS_PARAM */ @@ -738,6 +742,8 @@ *intdest= &ds->readtimeout; else if (!sqlwcharcasecmp(W_WRITETIMEOUT, param)) *intdest= &ds->writetimeout; + else if (!sqlwcharcasecmp(W_CLIENT_INTERACTIVE, param)) + *intdest= &ds->clientinteractive; else if (!sqlwcharcasecmp(W_FOUND_ROWS, param)) *booldest= &ds->return_matching_rows; @@ -1200,6 +1206,7 @@ if (ds_add_intprop(ds->name, W_PORT , ds->port )) goto error; if (ds_add_intprop(ds->name, W_READTIMEOUT, ds->readtimeout)) goto error; if (ds_add_intprop(ds->name, W_WRITETIMEOUT, ds->writetimeout)) goto error; + if (ds_add_intprop(ds->name, W_CLIENT_INTERACTIVE, ds->clientinteractive)) goto error; if (ds_add_intprop(ds->name, W_FOUND_ROWS, ds->return_matching_rows)) goto error; if (ds_add_intprop(ds->name, W_BIG_PACKETS, ds->allow_big_results)) goto error; === modified file 'util/installer.h' --- util/installer.h 2010-01-20 01:51:42 +0000 +++ util/installer.h 2010-01-22 19:15:30 +0000 @@ -90,6 +90,7 @@ unsigned int port; unsigned int readtimeout; unsigned int writetimeout; + unsigned int clientinteractive; SQLCHAR *name8; SQLCHAR *driver8;