Added:
trunk/MYODBCTst/MYODBCTstLib/MYODBCTstBindParameter.c
Modified:
trunk/MYODBCDriver/MYODBCDriverLib/MYODBCDriverMain.cpp
trunk/MYODBCDriver/MYODBCDriverLib/SQLGetFunctions.cpp
trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.c
trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.h
trunk/MYODBCDriver/MYODBCDriverTest/TSTExecute.c
trunk/MYODBCDriver/MYODBCDriverTest/TSTGetData.c
trunk/MYODBCDriver/MYODBCDriverTest/TSTInitStm.c
trunk/MYODBCDriver/MYODBCDriverTest/TSTPrepare.c
trunk/MYODBCDriver/MYODBCDriverTest/TSTUpdate.c
trunk/MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp
trunk/MYODBCTst/MYODBCTstLib/MYODBCTstConnect.c
trunk/MYODBCTst/MYODBCTstLib/MYODBCTstExecDirect.c
trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.pro
trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.vpj
trunk/MYODBCTst/MYODBCTstLib/MYODBCTstPrintDiagnostics.c
trunk/MYODBCTst/include/MYODBCTst.h
trunk/MYSQLPlus/MYSQLPlusLib/MConnection.cpp
trunk/MYSQLPlus/MYSQLPlusLib/MStatement.cpp
trunk/MYSQLPlus/include/MStatement.h
trunk/doc/Design/UML.vsd
Log:
A wide variety of last minute changes to improve stability, error reporting and post-build
testing.
Modified: trunk/MYODBCDriver/MYODBCDriverLib/MYODBCDriverMain.cpp
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverLib/MYODBCDriverMain.cpp 2006-06-16 15:17:04 UTC (rev
345)
+++ trunk/MYODBCDriver/MYODBCDriverLib/MYODBCDriverMain.cpp 2006-06-16 21:06:51 UTC (rev
346)
@@ -35,11 +35,18 @@
#define tgetenv getenv
#endif
+// #include <QCoreApplication>
+
+// int gnArgc = 1;
+// char *gnArgv[] = { MYODBC_DRIVER_NAME };
+// QCoreApplication *gpCoreApplication = NULL;
+
int gnMYODBCDrvProcesses = 0;
int gnMYODBCDrvThreads = 0;
HANDLE ghMYODBCDrvModule = NULL;
QFile gMYODBCTraceFile;
+
BOOL WINAPI DllMain( HANDLE hInst,
DWORD nReason,
LPVOID pReserved )
@@ -50,6 +57,7 @@
if ( !gnMYODBCDrvProcesses++ )
{
ghMYODBCDrvModule = hInst;
+// gpCoreApplication = new QCoreApplication( (int &)gnArgc, gnArgv );
/*!
\internal
@@ -91,7 +99,7 @@
uses some global settings for trace and uses TRACE & TRACE_FILE
connection
attributes.
*/
- SQLTCHAR *psMYODBC_LOG = tgetenv( TEXT("MYODBC_LOG") );
+ SQLWCHAR *psMYODBC_LOG = _wgetenv( TEXT("MYODBC_LOG") );
if ( psMYODBC_LOG )
{
if ( !(*psMYODBC_LOG) || wcscmp( psMYODBC_LOG, TEXT("off") ) == 0 )
@@ -106,11 +114,7 @@
}
else
{
-#ifdef UNICODE
gMYODBCTraceFile.setFileName( QString::fromUtf16( psMYODBC_LOG )
);
-#else
- gMYODBCTraceFile.setFileName( psMYODBC_LOG );
-#endif
if ( gMYODBCTraceFile.open( QFile::WriteOnly ) )
{
MYODBCDbgInit( &gMYODBCTraceFile );
@@ -132,6 +136,7 @@
MYODBCDbgFini();
if ( !gMYODBCTraceFile.fileName().isEmpty() )
gMYODBCTraceFile.close();
+// delete gpCoreApplication;
}
break;
case DLL_THREAD_DETACH:
@@ -141,6 +146,7 @@
}
break;
default:
+ printf( "[WARNING][%s][%d] Unknown reason thread/process attach/detach
nReason=%d\n", __FILE__, __LINE__, nReason );
break;
}
Modified: trunk/MYODBCDriver/MYODBCDriverLib/SQLGetFunctions.cpp
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverLib/SQLGetFunctions.cpp 2006-06-16 15:17:04 UTC (rev
345)
+++ trunk/MYODBCDriver/MYODBCDriverLib/SQLGetFunctions.cpp 2006-06-16 21:06:51 UTC (rev
346)
@@ -19,7 +19,7 @@
/* SQL_API_SQLALLOCENV, */
SQL_API_SQLALLOCHANDLE,
/* SQL_API_SQLALLOCSTMT, */
-/* SQL_API_SQLBINDCOL, */
+ SQL_API_SQLBINDCOL,
/* SQL_API_SQLBINDPARAM, */
/* SQL_API_SQLCANCEL, */
SQL_API_SQLCLOSECURSOR,
Modified: trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.c
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.c 2006-06-16 15:17:04 UTC (rev
345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.c 2006-06-16 21:06:51 UTC (rev
346)
@@ -63,11 +63,11 @@
{"SQLPrimaryKeys", TSTPrimaryKeys},
{"SQLForeignKeys", TSTForeignKeys},
{"SQLStatistics", TSTStatistics},
+*/
{"INSERT", TSTInsert},
{"SELECT", TSTSelect},
{"UPDATE", TSTUpdate},
{"DELETE", TSTDelete},
-*/
{"DROP TABLE", TSTDropTable},
{"Fini", TSTFiniStm},
{NULL, NULL}
Modified: trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.h
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.h 2006-06-16 15:17:04 UTC (rev
345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/MYODBCDriverTest.h 2006-06-16 21:06:51 UTC (rev
346)
@@ -81,11 +81,10 @@
#define MYODBC_DRV_TST_CATALOG TEXT("myodbctest")
#define MYODBC_DRV_TST_MAX_LEN 1024
#define MYODBC_DRV_TST_CREATE_TABLE TEXT("CREATE TABLE IF NOT EXISTS tbMyODBCDriverTest (
nID INT NOT NULL AUTO_INCREMENT, vcLastName VARCHAR(50), PRIMARY KEY (nID) )")
-#define MYODBC_DRV_TST_INSERT1 TEXT("INSERT INTO tbMyODBCDriverTest VALUES( 'Wolfe' )")
-#define MYODBC_DRV_TST_INSERT2 TEXT("INSERT INTO tbMyODBCDriverTest VALUES( 'Montcalm'
)")
+#define MYODBC_DRV_TST_INSERT1 TEXT("INSERT INTO tbMyODBCDriverTest ( vcLastName )
VALUES( 'Wolfe' )")
+#define MYODBC_DRV_TST_INSERT2 TEXT("INSERT INTO tbMyODBCDriverTest ( vcLastName )
VALUES( 'Montcalm' )")
#define MYODBC_DRV_TST_SELECT TEXT("SELECT * FROM tbMyODBCDriverTest")
-#define MYODBC_DRV_TST_UPDATE1 TEXT("UPDATE tbMyODBCDriverTest SET vcLastName = 'Brock'
WHERE vcLastName = 'Wolfe'")
-#define MYODBC_DRV_TST_UPDATE2 TEXT("UPDATE tbMyODBCDriverTest SET vcLastName =
'Tecumseh' WHERE vcLastName = 'Montcalm'")
+#define MYODBC_DRV_TST_UPDATE TEXT("UPDATE tbMyODBCDriverTest SET vcLastName = ? WHERE
vcLastName = ?")
#define MYODBC_DRV_TST_DELETE TEXT("DELETE tbMyODBCDriverTest WHERE vcLastName =
'Brock'")
#define MYODBC_DRV_TST_DROP_TABLE TEXT("DROP TABLE IF EXISTS tbMyODBCDriverTest")
#define MYODBC_DRV_TST_TABLE TEXT("tbMyODBCDriverTest")
Modified: trunk/MYODBCDriver/MYODBCDriverTest/TSTExecute.c
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/TSTExecute.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/TSTExecute.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -45,7 +45,7 @@
return FALSE;
if ( !TSTAllocHandleDbc() )
return FALSE;
- if ( !TSTDriverConnect() )
+ if ( !TSTConnect() )
return FALSE;
if ( !TSTAllocHandleStm() )
return FALSE;
Modified: trunk/MYODBCDriver/MYODBCDriverTest/TSTGetData.c
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/TSTGetData.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/TSTGetData.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -30,7 +30,7 @@
BOOLEAN TSTGetData()
{
- SQLINTEGER nRowsExpected = 49;
+ SQLINTEGER nRowsExpected = 51;
SQLSMALLINT nCol = 0;
SQLINTEGER nRows = 0;
SQLINTEGER nIndicator = 0;
Modified: trunk/MYODBCDriver/MYODBCDriverTest/TSTInitStm.c
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/TSTInitStm.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/TSTInitStm.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -36,7 +36,7 @@
return FALSE;
if ( !TSTAllocHandleDbc() )
return FALSE;
- if ( !TSTDriverConnect() )
+ if ( !TSTConnect() )
return FALSE;
if ( !TSTAllocHandleStm() )
return FALSE;
Modified: trunk/MYODBCDriver/MYODBCDriverTest/TSTPrepare.c
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/TSTPrepare.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/TSTPrepare.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -39,7 +39,7 @@
return FALSE;
if ( !TSTAllocHandleDbc() )
return FALSE;
- if ( !TSTDriverConnect() )
+ if ( !TSTConnect() )
return FALSE;
if ( !TSTAllocHandleStm() )
return FALSE;
Modified: trunk/MYODBCDriver/MYODBCDriverTest/TSTUpdate.c
===================================================================
--- trunk/MYODBCDriver/MYODBCDriverTest/TSTUpdate.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCDriver/MYODBCDriverTest/TSTUpdate.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -29,13 +29,42 @@
BOOLEAN TSTUpdate()
{
- if ( !SQL_SUCCEEDED( MYODBCTstExecDirect( hStm, MYODBC_DRV_TST_UPDATE1, SQL_NTS ) ) )
+ SQLCHAR szOld[100];
+ SQLCHAR szNew[100];
+ SQLINTEGER nStrLenOrIndOld = 0;
+ SQLINTEGER nStrLenOrIndNew = 0;
+
+ if ( !SQL_SUCCEEDED( MYODBCTstBindParameter( hStm, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_CHAR, 100, 0, szNew, 0, &nStrLenOrIndNew ) ) )
{
+ MYODBCTstFilePrint( stderr, _T("[%s][%d] Failed bind parameter.\n"),
_T(__FILE__), __LINE__ );
+ return FALSE;
+ }
+
+ if ( !SQL_SUCCEEDED( MYODBCTstBindParameter( hStm, 2, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_CHAR, 100, 0, szOld, 0, &nStrLenOrIndOld ) ) )
+ {
+ MYODBCTstFilePrint( stderr, _T("[%s][%d] Failed bind parameter.\n"),
_T(__FILE__), __LINE__ );
+ return FALSE;
+ }
+
+ strcpy( (char*)szOld, "Wolfe" );
+ strcpy( (char*)szNew, "Brock" );
+
+ if ( !SQL_SUCCEEDED( MYODBCTstPrepare( hStm, MYODBC_DRV_TST_UPDATE, SQL_NTS ) ) )
+ {
+ MYODBCTstFilePrint( stderr, _T("[%s][%d] Failed prepare.\n"), _T(__FILE__),
__LINE__ );
+ return FALSE;
+ }
+
+ if ( !SQL_SUCCEEDED( MYODBCTstExecute( hStm ) ) )
+ {
MYODBCTstFilePrint( stderr, _T("[%s][%d] Failed execute.\n"), _T(__FILE__),
__LINE__ );
return FALSE;
}
- if ( !SQL_SUCCEEDED( MYODBCTstExecDirect( hStm, MYODBC_DRV_TST_UPDATE2, SQL_NTS ) ) )
+ strcpy( (char*)szOld, "Montcalm" );
+ strcpy( (char*)szNew, "Tecumseh" );
+
+ if ( !SQL_SUCCEEDED( MYODBCTstExecute( hStm ) ) )
{
MYODBCTstFilePrint( stderr, _T("[%s][%d] Failed execute.\n"), _T(__FILE__),
__LINE__ );
return FALSE;
Modified: trunk/MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp
===================================================================
--- trunk/MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp 2006-06-16 21:06:51 UTC (rev 346)
@@ -365,7 +365,7 @@
string.
*/
if ( hashAttributes.contains( stringEntryNameUpper ) )
- hashAttributes[stringEntryNameUpper] = stringValue;
+ hashAttributes[stringEntryNameUpper] = stringValue.trimmed();
else
MYODBCDbgError( "Unknown attribute (%s).", psEntryName );
}
Added: trunk/MYODBCTst/MYODBCTstLib/MYODBCTstBindParameter.c
===================================================================
--- trunk/MYODBCTst/MYODBCTstLib/MYODBCTstBindParameter.c 2006-06-16 15:17:04 UTC (rev
345)
+++ trunk/MYODBCTst/MYODBCTstLib/MYODBCTstBindParameter.c 2006-06-16 21:06:51 UTC (rev
346)
@@ -0,0 +1,65 @@
+/*!
+ \file MYODBCTstBindParameter.c
+ \author Peter Harvey <pharvey@stripped>
+ Copyright (C) MySQL AB 2004-2006, Released under GPL.
+ \version Connector/ODBC v5
+ \date 2006
+ \brief Code to support driver testing.
+
+ \license Copyright (C) 2000-2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ There are special exceptions to the terms and conditions of the GPL as it
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS in the directory of this software distribution.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+#include "MYODBCTstInternal.h"
+
+SQLRETURN MYODBCTstBindParameter( SQLHSTMT hStm, SQLUSMALLINT nParameterNumber,
SQLSMALLINT nInputOutputType, SQLSMALLINT nValueType, SQLSMALLINT nParameterType,
SQLUINTEGER nColumnSize, SQLSMALLINT nDecimalDigits, SQLPOINTER pParameterValue,
SQLINTEGER nBufferLength, SQLINTEGER *pnStrLenOrInd )
+{
+ SQLRETURN nReturn = SQLBindParameter( hStm,
+ nParameterNumber,
+ nInputOutputType,
+ nValueType,
+ nParameterType,
+ nColumnSize,
+ nDecimalDigits,
+ pParameterValue,
+ nBufferLength,
+ pnStrLenOrInd );
+
+ switch ( nReturn )
+ {
+ case SQL_SUCCESS:
+ break;
+
+ case SQL_SUCCESS_WITH_INFO:
+ case SQL_ERROR:
+ MYODBCTstPrintDiagnostics( SQL_HANDLE_STMT, hStm );
+ break;
+
+ case SQL_INVALID_HANDLE:
+ MYODBCTstFilePrint( stderr, _T("[%s][%d] SQL_INVALID_HANDLE\n"),
_T(__FILE__), __LINE__ );
+ break;
+
+ default:
+ MYODBCTstFilePrint( stderr, _T("[%s][%d] Invalid return value %d\n"),
_T(__FILE__), __LINE__, nReturn );
+ }
+
+ return nReturn;
+}
+
+
Modified: trunk/MYODBCTst/MYODBCTstLib/MYODBCTstConnect.c
===================================================================
--- trunk/MYODBCTst/MYODBCTstLib/MYODBCTstConnect.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCTst/MYODBCTstLib/MYODBCTstConnect.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -51,14 +51,17 @@
case SQL_SUCCESS_WITH_INFO:
case SQL_ERROR:
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
MYODBCTstPrintDiagnostics( SQL_HANDLE_DBC, hDbc );
break;
case SQL_INVALID_HANDLE:
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
MYODBCTstFilePrint( stderr, _T("[%s][%d] SQL_INVALID_HANDLE\n"),
_T(__FILE__), __LINE__ );
break;
default:
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
MYODBCTstFilePrint( stderr, _T("[%s][%d] Invalid return value %d\n"),
_T(__FILE__), __LINE__, nReturn );
}
Modified: trunk/MYODBCTst/MYODBCTstLib/MYODBCTstExecDirect.c
===================================================================
--- trunk/MYODBCTst/MYODBCTstLib/MYODBCTstExecDirect.c 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCTst/MYODBCTstLib/MYODBCTstExecDirect.c 2006-06-16 21:06:51 UTC (rev 346)
@@ -40,23 +40,16 @@
switch ( nReturn )
{
case SQL_SUCCESS:
- break;
-
- case SQL_SUCCESS_WITH_INFO:
- MYODBCTstPrintDiagnostics( SQL_HANDLE_STMT, hStm );
- break;
-
case SQL_NEED_DATA:
case SQL_STILL_EXECUTING:
+ case SQL_NO_DATA:
break;
+ case SQL_SUCCESS_WITH_INFO:
case SQL_ERROR:
MYODBCTstPrintDiagnostics( SQL_HANDLE_STMT, hStm );
break;
- case SQL_NO_DATA:
- break;
-
case SQL_INVALID_HANDLE:
MYODBCTstFilePrint( stderr, _T("[%s][%d] SQL_INVALID_HANDLE\n"),
_T(__FILE__), __LINE__ );
break;
Modified: trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.pro
===================================================================
--- trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.pro 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.pro 2006-06-16 21:06:51 UTC (rev 346)
@@ -31,6 +31,7 @@
MYODBCTstInternal.h
SOURCES = \
MYODBCTstAllocHandle.c \
+ MYODBCTstBindParameter.c \
MYODBCTstCloseCursor.c \
MYODBCTstColumns.c \
MYODBCTstConnect.c \
Modified: trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.vpj
===================================================================
--- trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.vpj 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCTst/MYODBCTstLib/MYODBCTstLib.vpj 2006-06-16 21:06:51 UTC (rev 346)
@@ -54,6 +54,7 @@
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl">
<F N="MYODBCTstAllocHandle.c"/>
+ <F N="MYODBCTstBindParameter.c"/>
<F N="MYODBCTstCloseCursor.c"/>
<F N="MYODBCTstColumns.c"/>
<F N="MYODBCTstConnect.c"/>
Modified: trunk/MYODBCTst/MYODBCTstLib/MYODBCTstPrintDiagnostics.c
===================================================================
--- trunk/MYODBCTst/MYODBCTstLib/MYODBCTstPrintDiagnostics.c 2006-06-16 15:17:04 UTC (rev
345)
+++ trunk/MYODBCTst/MYODBCTstLib/MYODBCTstPrintDiagnostics.c 2006-06-16 21:06:51 UTC (rev
346)
@@ -39,7 +39,6 @@
SQLSMALLINT nTextLength;
SQLRETURN nReturn;
-printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
while ( SQL_SUCCEEDED( ( nReturn = SQLGetDiagRec( nHandleType,
hHandle,
nRecNumber,
@@ -49,7 +48,6 @@
nBufferLength,
&nTextLength ) ) ) )
{
-printf( "[PAH][%s][%d] (%d) (%s)\n", __FILE__, __LINE__, nReturn, szMessageText );
szSqlState[5] = '\0';
MYODBCTstFilePrint( stderr, _T("[%s] (%d) %s\n"), szSqlState, nNativeError,
szMessageText );
nRecNumber++;
Modified: trunk/MYODBCTst/include/MYODBCTst.h
===================================================================
--- trunk/MYODBCTst/include/MYODBCTst.h 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYODBCTst/include/MYODBCTst.h 2006-06-16 21:06:51 UTC (rev 346)
@@ -86,6 +86,17 @@
SQLHANDLE hInputHandle,
SQLHANDLE * phOutputHandlePtr );
+SQLRETURN MYODBCTstBindParameter( SQLHSTMT hStm,
+ SQLUSMALLINT nParameterNumber,
+ SQLSMALLINT nInputOutputType,
+ SQLSMALLINT nValueType,
+ SQLSMALLINT nParameterType,
+ SQLUINTEGER nColumnSize,
+ SQLSMALLINT nDecimalDigits,
+ SQLPOINTER pParameterValue,
+ SQLINTEGER nBufferLength,
+ SQLINTEGER *pnStrLenOrInd );
+
SQLRETURN MYODBCTstCloseCursor( SQLHSTMT hStm );
SQLRETURN MYODBCTstColumns( SQLHSTMT hStm,
Modified: trunk/MYSQLPlus/MYSQLPlusLib/MConnection.cpp
===================================================================
--- trunk/MYSQLPlus/MYSQLPlusLib/MConnection.cpp 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYSQLPlus/MYSQLPlusLib/MConnection.cpp 2006-06-16 21:06:51 UTC (rev 346)
@@ -1784,7 +1784,7 @@
/* translate our flags into client while appling pre-connect flags */
ulong nFlags = getClientFlag( datasource.getOPTION().toULong(), datasource.getSTMT()
);
-
+
/* ask mysql for a connection */
if ( !mysql_real_connect( (MYSQL*)pMySQL,
datasource.getSERVER().toUtf8().data(),
@@ -1800,7 +1800,15 @@
pMySQL = NULL;
MYODBCDbgReturn( SQL_ERROR );
}
-
+
+ /*!
+ \internal
+ \todo
+
+ getDiagnostic()->setServerName();
+ */
+ getDiagnostic()->setConnectionName( datasource.getName() );
+
setCurrentCatalog( datasource.getDATABASE() );
setDataSourceName( datasource.getName() );
setUserIdentifier( datasource.getUID() );
@@ -1855,6 +1863,14 @@
MYODBCDbgReturn( SQL_ERROR );
}
+ /*!
+ \internal
+ \todo
+
+ getDiagnostic()->setConnectionName();
+ getDiagnostic()->setServerName();
+ */
+
setCurrentCatalog( pDataSource->getDATABASE() );
setUserIdentifier( pDataSource->getUID() );
setState( STATE_C4 );
@@ -1955,6 +1971,9 @@
mysql_close( (MYSQL*)pMySQL );
pMySQL = NULL;
+ getDiagnostic()->setConnectionName( "" );
+ getDiagnostic()->setServerName( "" );
+
setDataSourceName( QString::null );
setUserIdentifier( QString::null );
setState( STATE_C2 );
Modified: trunk/MYSQLPlus/MYSQLPlusLib/MStatement.cpp
===================================================================
--- trunk/MYSQLPlus/MYSQLPlusLib/MStatement.cpp 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYSQLPlus/MYSQLPlusLib/MStatement.cpp 2006-06-16 21:06:51 UTC (rev 346)
@@ -1936,6 +1936,17 @@
MYODBCDbgReturn( pDiagnostic->doAppend( MDiagnostic::DIA_HY010 ) );
/*!
+ \internal MYODBC RULE
+
+ We want to prevent the following scenarios;
+
+ 1. app calls SQLExecDirect() and then SQLExecute() (without a SQLPrepare() in
the middle)
+ 2. app calls a catalog function like SQLTables() and then SQLExecute()
(without a SQLPrepare() in the middle)
+ */
+ if ( getImplicitPrepare() )
+ MYODBCDbgReturn( pDiagnostic->doAppend( MDiagnostic::DIA_HY010 ) );
+
+ /*!
\internal ODBC RULE
The prepared statement associated with the statement handle can be reexecuted by
@@ -1944,21 +1955,8 @@
call to SQLPrepare, SQLExecDirect, or one of the catalog functions (SQLColumns,
SQLTables, and so on).
*/
- /*!
- \internal MYODBC RULE
-
- We not want prevent the following scenarios;
-
- 1. app calls SQLExecDirect() and then SQLExecute() (without a SQLPrepare() in
the middle)
- 2. app calls a catalog function like SQLTables() and then SQLExecute()
(without a SQLPrepare() in the middle)
- */
if ( getState() > STATE_S3 )
- {
- Q_ASSERT( !pResult );
- delete pResult;
- pResult = NULL;
- setState( STATE_S1 );
- }
+ doStateRollBack( STATE_S3 );
Q_ASSERT( !pResult );
SQLRETURN nReturn = pResult->doExecute();
Modified: trunk/MYSQLPlus/include/MStatement.h
===================================================================
--- trunk/MYSQLPlus/include/MStatement.h 2006-06-16 15:17:04 UTC (rev 345)
+++ trunk/MYSQLPlus/include/MStatement.h 2006-06-16 21:06:51 UTC (rev 346)
@@ -172,7 +172,7 @@
MDescriptor * pAppParamDescOrig; /*!< Original app param desc.
*/
MDescriptor * pAppRowDescOrig; /*!< Original app row desc.
*/
MResult * pResult; /*!< our result (null if N/A)
*/
- BOOLEAN bImplicitPrepare; /*!< true if prepare done implicitly ie
doExecDirect or doTables */
+ BOOLEAN bImplicitPrepare; /*!< true if prepare done implicitly ie
doExecDirect or doTables etc*/
MDescriptor * pAppParamDesc; /*!< SQL_ATTR_APP_PARAM_DESC
*/
MDescriptor * pAppRowDesc; /*!< SQL_ATTR_APP_ROW_DESC
*/
SQLUINTEGER nAsyncEnable; /*!< SQL_ATTR_ASYNC_ENABLE
*/
@@ -194,9 +194,6 @@
/* SQLUINTEGER nRowNumber; */ /*!< SQL_ATTR_ROW_NUMBER
*/
SQLUINTEGER nSimulateCursor; /*!< SQL_ATTR_SIMULATE_CURSOR
*/
SQLUINTEGER nUseBookmarks; /*!< SQL_ATTR_USE_BOOKMARKS
*/
-
-
- BOOLEAN
};
#endif
Modified: trunk/doc/Design/UML.vsd
===================================================================
(Binary files differ)
| Thread |
|---|
| • Connector/ODBC 5 commit: r346 - in trunk: MYODBCDriver/MYODBCDriverLib MYODBCDriver/MYODBCDriverTest MYODBCIns/MYODBCInsLib MYODBCTst/MYODBCTstLib MYO... | pharvey | 16 Jun |