=== modified file 'CMakeLists.txt' --- CMakeLists.txt 2010-01-31 00:29:06 +0000 +++ CMakeLists.txt 2010-03-01 22:13:43 +0000 @@ -1,4 +1,5 @@ -# Copyright 2007 MySQL AB, 2008 Sun Microsystems, Inc. + +# Copyright (©) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # # The MySQL Connector/ODBC is licensed under the terms of the # GPL, like most MySQL Connectors. There are special exceptions @@ -143,6 +144,8 @@ #MESSAGE("New CMAKE_${TYPE}_FLAGS${CFG}: ${CMAKE_${TYPE}_FLAGS${CFG}}") ENDFOREACH(CFG) ENDFOREACH(TYPE) +ELSE(WIN32) + ADD_DEFINITIONS(-D_UNIX_) ENDIF(WIN32) #----------------------------------------------------- === modified file 'ChangeLog' --- ChangeLog 2010-01-08 20:03:20 +0000 +++ ChangeLog 2010-03-01 22:17:02 +0000 @@ -2,6 +2,8 @@ Functionality added or changed: * Options in the Windows GUI are grouped on named tabs. + * Added connection option INTERACTIVE that tells driver that client is + ineractive and interactive_timeout has to be used. (Bug #48603) Bugs fixed: * If NO_BACKSLASH_ESCAPES mode is used on a server, escaping binary data === modified file 'driver/connect.c' --- driver/connect.c 2010-01-31 00:29:06 +0000 +++ driver/connect.c 2010-03-01 22:11:07 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. + Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -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; } @@ -725,6 +727,8 @@ oldds->pszOPTION= _global_alloc(20); sprintf(oldds->pszOPTION, "%ul", ds_get_options(ds)); } + oldds->bINTERACTIVE= (ds->clientinteractive != 0); + if (ds->sslkey) oldds->pszSSLKEY= _global_strdup(ds_get_utf8attr(ds->sslkey, &ds->sslkey8)); if (ds->sslcert) @@ -741,7 +745,7 @@ oldds->pszPORT= _global_strdup(" "); sprintf(oldds->pszPORT, "%d", ds->port); - oldds->pszSSL= _global_strdup(" "); + oldds->pszSSLVERIFY= _global_strdup(" "); sprintf(oldds->pszSSLVERIFY,"%d", ds->sslverify); /* Prompt. Function returns false if user cancels. */ @@ -766,7 +770,13 @@ if (oldds->pszSTMT) ds_setattr_from_utf8(&ds->initstmt, oldds->pszSTMT); if (oldds->pszOPTION) +#ifdef _WIN32 + ds_set_options(ds, strtoul(oldds->pszOPTION, NULL, 10)); +#else ds_set_options(ds, strtoul(oldds->pszOPTION)); +#endif + ds->clientinteractive= oldds->bINTERACTIVE; + if (oldds->pszSSLKEY) ds_setattr_from_utf8(&ds->sslkey, oldds->pszSSLKEY); if (oldds->pszSSLCERT) === modified file 'setup/MYODBCSetupCheckBox.h' --- setup/MYODBCSetupCheckBox.h 2010-01-31 00:29:06 +0000 +++ setup/MYODBCSetupCheckBox.h 2010-03-01 22:19:06 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2007 MySQL AB +/* Copyright (©) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -29,6 +29,16 @@ #include #include + +#ifndef MYODBC_ADD_TOOLTIP + +#if QT_VERSION >= 0x040000 +# define MYODBC_ADD_TOOLTIP(control, tooltipStr) control->setToolTip(tooltipStr); +#else +# define MYODBC_ADD_TOOLTIP(control, tooltipStr) QToolTip::add(control, tooltipStr); +#endif + +#endif class MYODBCSetupCheckBox : public QCheckBox { Q_OBJECT === modified file 'setup/MYODBCSetupDataSourceDialog.cpp' --- setup/MYODBCSetupDataSourceDialog.cpp 2010-01-31 00:29:06 +0000 +++ setup/MYODBCSetupDataSourceDialog.cpp 2010-03-01 22:22:40 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (©) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -280,6 +280,8 @@ pDataSource->pszOPTION = (char*)_global_alloc(50); sprintf( pDataSource->pszOPTION, "%d", nFlags ); } + + pDataSource->bINTERACTIVE= ptab3->getInteractiveFlag(); } // exit @@ -439,6 +441,8 @@ ptab3->ptab3a->pcheckboxDisableBinaryResult->setChecked( nOptions & (1 << 28) ? TRUE : FALSE ); } + ptab3->ptab3a->pcheckboxInteractive->setChecked(pDataSource->bINTERACTIVE); + connect( ppushbuttonTest, SIGNAL(clicked()), SLOT(slotTest()) ); connect( ppushbuttonDiagnostics, SIGNAL(toggled(bool)), SLOT(slotToggleGuru(bool)) ); connect( ppushbuttonHelp, SIGNAL(clicked()), SLOT(slotHelp()) ); @@ -474,6 +478,7 @@ connect( ptab3->ptab3a->pcheckboxEnableReconnect, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); connect( ptab3->ptab3a->pcheckboxAutoIncrementIsNull, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); connect( ptab3->ptab3a->pcheckboxDisableBinaryResult, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); + connect( ptab3->ptab3a->pcheckboxInteractive, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); connect( ptab3->ptab3b->pcheckboxDontPromptOnConnect, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); connect( ptab3->ptab3b->pcheckboxEnableDynamicCursor, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); connect( ptab3->ptab3b->pcheckboxIgnorePoundInTable, SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) ); === modified file 'setup/MYODBCSetupDataSourceTab3.cpp' --- setup/MYODBCSetupDataSourceTab3.cpp 2010-01-31 00:29:06 +0000 +++ setup/MYODBCSetupDataSourceTab3.cpp 2010-03-01 22:22:28 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB +/* Copyright (©) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -109,3 +109,8 @@ return nFlags; } + +bool MYODBCSetupDataSourceTab3::getInteractiveFlag() +{ + return ptab3a->pcheckboxInteractive->isChecked(); +} === modified file 'setup/MYODBCSetupDataSourceTab3.h' --- setup/MYODBCSetupDataSourceTab3.h 2010-01-31 00:29:06 +0000 +++ setup/MYODBCSetupDataSourceTab3.h 2010-03-01 22:23:43 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2007 MySQL AB +/* Copyright (©) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -51,7 +51,8 @@ MYODBCSetupDataSourceTab3c * ptab3c; MYODBCSetupDataSourceTab3d * ptab3d; - unsigned int getFlags(); + unsigned int getFlags(); + bool getInteractiveFlag(); }; #endif === modified file 'setup/MYODBCSetupDataSourceTab3a.cpp' --- setup/MYODBCSetupDataSourceTab3a.cpp 2010-01-31 00:29:06 +0000 +++ setup/MYODBCSetupDataSourceTab3a.cpp 2010-03-01 22:32:27 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB +/* Copyright (©) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -36,6 +36,7 @@ QString stringEnableReconnect( tr("Enables automatic reconnect. Attention: it is strongly not recommended to set this flag for transactional operations!") ); QString stringAutoIncrementIsNull( tr("Turns on/off the handling of searching for the last inserted row with WHERE auto_increment_column IS NULL") ); QString stringDisableBinaryResult( tr("Always handle binary function results as character data") ); + QString stringInteractive( tr("Tells server to use longer wait timeout for the connection(interactive timeout)") ); #if QT_VERSION >= 0x040000 QVBoxLayout * playoutFields = new QVBoxLayout; setLayout( playoutFields ); @@ -118,6 +119,11 @@ QToolTip::add( pcheckboxDisableBinaryResult, stringDisableBinaryResult ); #endif + pcheckboxInteractive = new MYODBCSetupCheckBox( tr("Interactive client"), this ); + pcheckboxInteractive->setAssistText( stringInteractive ); + playoutFields->addWidget( pcheckboxInteractive ); + MYODBC_ADD_TOOLTIP(pcheckboxInteractive, stringInteractive); + playoutFields->addStretch( 10 ); } === modified file 'setup/MYODBCSetupDataSourceTab3a.h' --- setup/MYODBCSetupDataSourceTab3a.h 2010-01-31 00:29:06 +0000 +++ setup/MYODBCSetupDataSourceTab3a.h 2010-03-01 22:32:18 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -55,6 +55,7 @@ MYODBCSetupCheckBox *pcheckboxEnableReconnect; MYODBCSetupCheckBox *pcheckboxAutoIncrementIsNull; MYODBCSetupCheckBox *pcheckboxDisableBinaryResult; + MYODBCSetupCheckBox *pcheckboxInteractive; }; #endif === modified file 'setupgui/windows/odbcdialogparams.cpp' --- setupgui/windows/odbcdialogparams.cpp 2010-01-31 00:29:06 +0000 +++ setupgui/windows/odbcdialogparams.cpp 2010-03-01 22:31:56 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2007-2008 MySQL AB, 2009 Sun Microsystems, Inc. + Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -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 2010-01-31 00:29:06 +0000 +++ setupgui/windows/odbcdialogparams.rc 2010-03-01 22:31:09 +0000 @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Copyright 2007-2008 MySQL AB, 2009 Sun Microsystems Inc. +// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. // // The MySQL Connector/ODBC is licensed under the terms of the // GPL, like most MySQL Connectors. There are special exceptions @@ -104,6 +104,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 2010-01-31 00:29:06 +0000 +++ setupgui/windows/resource.h 2010-03-01 22:33:34 +0000 @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Copyright 2006-2008 MySQL AB, 2009 Sun Microsystems Inc. +// Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. // // The MySQL Connector/ODBC is licensed under the terms of the // GPL, like most MySQL Connectors. There are special exceptions @@ -113,6 +113,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-31 00:29:06 +0000 +++ test/my_basics.c 2010-03-01 22:34:22 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2003-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. + Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -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/MYODBCUtil.h' --- util/MYODBCUtil.h 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtil.h 2010-03-01 22:36:05 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -196,6 +196,7 @@ char *pszSOCKET; /* Unix socket file or Windows named pipe to connect to. */ char *pszSTMT; /* Statement that will be exec when connecting to MySQL. */ char *pszOPTION; /* Options that specify how MyODBC should work. */ + BOOL bINTERACTIVE; /* ODBC option for client_interactive connection option */ char *pszSSLKEY; /* pathname to SSL key file */ char *pszSSLCERT; /* pathname to SSL certificate file */ === modified file 'util/MYODBCUtilClearDataSource.c' --- util/MYODBCUtilClearDataSource.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilClearDataSource.c 2010-03-01 22:35:39 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -135,4 +135,5 @@ pDataSource->pszCHARSET= NULL; } + pDataSource->bINTERACTIVE= FALSE; } === modified file 'util/MYODBCUtilDefaultDataSource.c' --- util/MYODBCUtilDefaultDataSource.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilDefaultDataSource.c 2010-03-01 22:36:43 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2005-2008 MySQL AB +/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -106,6 +106,8 @@ pDataSource->pszCHARSET= NULL; } + pDataSource->bINTERACTIVE= FALSE; + #ifndef _UNIX_ /* Here we actually unset socket for non-UNIX as it does not apply. */ if ( pDataSource->pszSOCKET && !pDataSource->pszSOCKET[0] ) === modified file 'util/MYODBCUtilReadConnectStr.c' --- util/MYODBCUtilReadConnectStr.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilReadConnectStr.c 2010-03-01 22:35:05 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -137,6 +137,13 @@ if ( !pDataSource->pszOPTION ) pDataSource->pszOPTION = (char *)_global_strndup( pAnchorChar, pScanChar - pAnchorChar ); } + else if( strcasecmp( pszName, "INTERACTIVE" ) == 0 ) + { + char tmp= *pScanChar; + *pScanChar= '\0'; + pDataSource->bINTERACTIVE= (atol(pAnchorChar) != 0); + *pScanChar= tmp; + } /* MYODBC RULE === modified file 'util/MYODBCUtilReadDataSource.c' --- util/MYODBCUtilReadDataSource.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilReadDataSource.c 2010-03-01 22:38:48 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -167,6 +167,10 @@ if ( !pDataSource->pszOPTION ) pDataSource->pszOPTION = _global_strdup( szValue ); } + else if ( strcasecmp( pszEntryName, "INTERACTIVE" ) == 0 ) + { + pDataSource->bINTERACTIVE= (atol(szValue) != 0); + } else if ( strcasecmp( pszEntryName, "PWD" ) == 0 || strcasecmp( pszEntryName, "PASSWORD" ) == 0 ) { if ( !pDataSource->pszPASSWORD ) === modified file 'util/MYODBCUtilReadDataSourceStr.c' --- util/MYODBCUtilReadDataSourceStr.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilReadDataSourceStr.c 2010-03-01 22:39:42 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -222,6 +222,13 @@ if ( !pDataSource->pszOPTION ) pDataSource->pszOPTION = (char *)_global_strndup( pAnchorChar, pScanChar - pAnchorChar ); } + else if ( strcasecmp( pszName, "INTERACTIVE" ) == 0 ) + { + char tmp= *pScanChar; + *pScanChar= '\0'; + pDataSource->bINTERACTIVE= (atol(pAnchorChar) != 0); + *pScanChar= tmp; + } /* MYODBC RULE === modified file 'util/MYODBCUtilWriteConnectStr.c' --- util/MYODBCUtilWriteConnectStr.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilWriteConnectStr.c 2010-03-01 22:40:12 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -86,6 +86,14 @@ return FALSE; } + if ( pDataSource->bINTERACTIVE ) + { + if ( !MYODBCUtilInsertStr( pszStr, "INTERACTIVE=1", nMaxLen, &nIndex ) ) + return FALSE; + if ( nIndex && !MYODBCUtilInsertStr( pszStr, ";", nMaxLen, &nIndex ) ) + return FALSE; + } + if ( pDataSource->pszPASSWORD ) { if ( !MYODBCUtilInsertStr( pszStr, "PWD=", nMaxLen, &nIndex ) ) === modified file 'util/MYODBCUtilWriteDataSource.c' --- util/MYODBCUtilWriteDataSource.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilWriteDataSource.c 2010-03-01 22:40:34 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -79,6 +79,9 @@ WRITE_VALUE(SSLKEY, "SSLKEY"); WRITE_VALUE(SSLVERIFY, "SSLVERIFY"); WRITE_VALUE(CHARSET, "CHARSET"); + if (pDataSource->bINTERACTIVE + && !SQLWritePrivateProfileString(pDataSource->pszDSN, "INTERACTIVE", "1", "odbc.ini")) + return FALSE; return TRUE; } === modified file 'util/MYODBCUtilWriteDataSourceStr.c' --- util/MYODBCUtilWriteDataSourceStr.c 2010-01-31 00:29:06 +0000 +++ util/MYODBCUtilWriteDataSourceStr.c 2010-03-01 22:40:52 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -107,6 +107,14 @@ return FALSE; } + if ( pDataSource->bINTERACTIVE ) + { + MYODBCUTILWRITEDATASOURCESTR_DELIM; + + if ( !MYODBCUtilInsertStr( pszStr, "INTERACTIVE=1", nMaxLen, &nIndex ) ) + return FALSE; + } + if ( pDataSource->pszPASSWORD ) { MYODBCUTILWRITEDATASOURCESTR_DELIM; === modified file 'util/installer.c' --- util/installer.c 2010-01-31 00:29:06 +0000 +++ util/installer.c 2010-03-01 22:41:49 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2007-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. + Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -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-31 00:29:06 +0000 +++ util/installer.h 2010-03-01 22:42:21 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2007-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. + Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/ODBC is licensed under the terms of the GPL, like most MySQL Connectors. There are special exceptions @@ -90,6 +90,7 @@ unsigned int port; unsigned int readtimeout; unsigned int writetimeout; + unsigned int clientinteractive; SQLCHAR *name8; SQLCHAR *driver8;