Added:
MYODBCC/MYODBCCLib/MYODBCC.cpp
Removed:
MYODBCC/MYODBCCLib/MYODBCCStrCaseCmp.c
MYODBCC/MYODBCCLib/MYODBCCStrCmpLiteral.c
MYODBCC/MYODBCCLib/MYODBCCStrCmpWild.c
MYODBCC/MYODBCCLib/MYODBCCStrCopyIn.c
MYODBCC/MYODBCCLib/MYODBCCStrCopyOut.c
MYODBCC/MYODBCCLib/MYODBCCStrCopyOut1.c
MYODBCC/MYODBCCLib/MYODBCCStrCopyOut2.c
MYODBCC/MYODBCCLib/MYODBCCStrDup.c
MYODBCC/MYODBCCLib/MYODBCCStrNCaseCmp.c
Modified:
MYODBCAtt/MYODBCAtt.vpj
MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp
MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro
MYODBCC/MYODBCC.pro
MYODBCC/MYODBCCLib/MYODBCCLib.pro
MYODBCC/MYODBCCLib/MYODBCCLib.vpj
MYODBCC/include/MYODBCC.h
MYODBCDbg/MYODBCDbgLib/MYODBCDbg.cpp
MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.cpp
MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.pro
MYODBCDbg/include/MYODBCDbg.h
MYODBCDes/MYODBCDesLib/MYODBCDes.cpp
MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp
MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp
MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro
MYODBCDes/include/MYODBCDes.h
MYODBCDes/include/MYODBCDesRec.h
MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp
MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp
MYODBCDia/MYODBCDiaTest/MYODBCDiaTest.pro
MYODBCDia/include/MYODBCDia.h
MYODBCIns/MYODBCInsLib/MYODBCIns.cpp
MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp
MYODBCIns/MYODBCInsLib/MYODBCInsDriver.cpp
MYODBCIns/MYODBCInsLib/MYODBCInsDriverConnect.cpp
MYODBCIns/MYODBCInsTest/MYODBCInsTest.cpp
MYODBCIns/MYODBCInsTest/MYODBCInsTest.pro
MYODBCIns/include/MYODBCIns.h
MYODBCRes/MYODBCResLib/MYODBCRes.cpp
MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp
MYODBCRes/MYODBCResLib/MYODBCResLib.pro
MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
MYODBCRes/MYODBCResTest/MYODBCResTest.cpp
MYODBCRes/MYODBCResTest/MYODBCResTest.pro
MYODBCRes/MYODBCResTest/MYODBCResTest.vpj
MYODBCRes/include/MYODBCRes.h
MYODBCRes/include/MYODBCResDriver.h
MYODBCRes/include/MYODBCResServer.h
PostBuildTest.bat
defines.pri
root.pro
Log:
UNICODE:
- wide variety of changes and, in general, work to get Alpha 2 done
Modified: MYODBCAtt/MYODBCAtt.vpj
===================================================================
--- MYODBCAtt/MYODBCAtt.vpj 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCAtt/MYODBCAtt.vpj 2006-02-13 17:22:45 UTC (rev 56)
@@ -22,7 +22,7 @@
CaptureOutputWith="ProcessBuffer"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
- <Exec/>
+ <Exec CmdLine="make"/>
</Target>
<Target
Name="Rebuild"
Modified: MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp
===================================================================
--- MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -9,8 +9,8 @@
this->hStm = hStm;
this->pdia = pdia;
- pAppParamDesc = pAppParamDescOrig = new MYODBCDesAPD( hStm );
- pAppRowDesc = pAppRowDescOrig = new MYODBCDesARD( hStm );
+ pAppParamDesc = pAppParamDescOrig = new MYODBCDesAPD( hStm, SQL_DESC_ALLOC_AUTO
);
+ pAppRowDesc = pAppRowDescOrig = new MYODBCDesARD( hStm, SQL_DESC_ALLOC_AUTO
);
nAsyncEnable = SQL_ASYNC_ENABLE_OFF;
nConcurrency = SQL_CONCUR_READ_ONLY;
nCursorScrollable = SQL_NONSCROLLABLE;
Modified: MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro
===================================================================
--- MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -19,6 +19,7 @@
LIBS += -lMYODBCDes
LIBS += -lMYODBCDia
LIBS += -lMYODBCDbg
+LIBS += -lMYODBCC
include( ../../mysql.pri )
Modified: MYODBCC/MYODBCC.pro
===================================================================
--- MYODBCC/MYODBCC.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCC.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
SUBDIRS = \
- Lib \
- MYODBCCTest
+ MYODBCCLib
+# MYODBCCTest
Added: MYODBCC/MYODBCCLib/MYODBCC.cpp
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCC.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCC.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -0,0 +1,2117 @@
+/*!
+ \file MYODBCC.cpp
+ \author Peter Harvey <pharvey@stripped>
+ Copyright (C) MySQL AB 2004-2005, Released under GPL.
+ \version Connector/ODBC v5
+ \date 2005
+ \brief Code to provide some enhancements to C/C++.
+
+ \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 "../include/MYODBCC.h"
+
+void *MYODBCC::getMem( size_t nBytes )
+{
+ return malloc( nBytes );
+}
+
+size_t MYODBCC::getStrLen( const SQLWCHAR *psz, size_t nMaxChars )
+{
+ return wcsnlen( psz, nMaxChars );
+}
+
+/*!
+ \brief Returns a string version of a connection attribute.
+
+ Returns a string version of a connection attribute. This is great for
+ returning more readable debug output.
+
+ \param nAttribute An connection attribute.
+
+ \return A string constant describing nAttribute.
+
+ \sa
+*/
+QString MYODBCC::getConnectAttrString( SQLINTEGER nAttribute )
+{
+ switch ( nAttribute )
+ {
+ case SQL_ATTR_ACCESS_MODE:
+ return "SQL_ATTR_ACCESS_MODE";
+ case SQL_ATTR_ASYNC_ENABLE:
+ return "SQL_ATTR_ASYNC_ENABLE";
+ case SQL_ATTR_AUTO_IPD:
+ return "SQL_ATTR_AUTO_IPD";
+ case SQL_ATTR_AUTOCOMMIT:
+ return "SQL_ATTR_AUTOCOMMIT";
+ case SQL_ATTR_CONNECTION_DEAD:
+ return "SQL_ATTR_CONNECTION_DEAD";
+ case SQL_ATTR_CONNECTION_TIMEOUT:
+ return "SQL_ATTR_CONNECTION_TIMEOUT";
+ case SQL_ATTR_CURRENT_CATALOG:
+ return "SQL_ATTR_CURRENT_CATALOG";
+ case SQL_ATTR_LOGIN_TIMEOUT:
+ return "SQL_ATTR_LOGIN_TIMEOUT";
+ case SQL_ATTR_METADATA_ID:
+ return "SQL_ATTR_METADATA_ID";
+ case SQL_ATTR_ODBC_CURSORS:
+ return "SQL_ATTR_ODBC_CURSORS";
+ case SQL_ATTR_PACKET_SIZE:
+ return "SQL_ATTR_PACKET_SIZE";
+ case SQL_ATTR_QUIET_MODE:
+ return "SQL_ATTR_QUIET_MODE";
+ case SQL_ATTR_TRACE:
+ return "SQL_ATTR_TRACE";
+ case SQL_ATTR_TRACEFILE:
+ return "SQL_ATTR_TRACEFILE";
+ case SQL_ATTR_TRANSLATE_LIB:
+ return "SQL_ATTR_TRANSLATE_LIB";
+ case SQL_ATTR_TRANSLATE_OPTION:
+ return "SQL_ATTR_TRANSLATE_OPTION";
+ case SQL_ATTR_TXN_ISOLATION:
+ return "SQL_ATTR_TXN_ISOLATION";
+ }
+
+ return "unknown";
+}
+
+
+/*!
+ \brief Returns a string version of a connection option.
+
+ Returns a string version of a connection option (or statement attribute).
+ This is great for returning more readable debug output.
+
+ \param nOption A connection option.
+
+ \return A string constant describing nOption.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getConnectOptionString( SQLUSMALLINT nOption )
+{
+ switch ( nOption )
+ {
+ case SQL_ACCESS_MODE:
+ return "SQL_ACCESS_MODE";
+ case SQL_AUTOCOMMIT:
+ return "SQL_AUTOCOMMIT";
+ case SQL_CURRENT_QUALIFIER:
+ return "SQL_CURRENT_QUALIFIER";
+ case SQL_LOGIN_TIMEOUT:
+ return "SQL_LOGIN_TIMEOUT";
+ case SQL_ODBC_CURSORS:
+ return "SQL_ODBC_CURSORS";
+ case SQL_OPT_TRACE:
+ return "SQL_OPT_TRACE";
+ case SQL_OPT_TRACEFILE:
+ return "SQL_OPT_TRACEFILE";
+ case SQL_PACKET_SIZE:
+ return "SQL_PACKET_SIZE";
+ case SQL_QUIET_MODE:
+ return "SQL_QUIET_MODE";
+ case SQL_TRANSLATE_DLL:
+ return "SQL_TRANSLATE_DLL";
+ case SQL_TRANSLATE_OPTION:
+ return "SQL_TRANSLATE_OPTION";
+ case SQL_TXN_ISOLATION:
+ return "SQL_TXN_ISOLATION";
+ default:
+ /* in 2.x stm attr can be set (as default) in dbc */
+ return getStmtAttrString( (SQLINTEGER)nOption );
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a diag field identifier.
+
+ Returns a string version of a diag field identifier. This is great for
+ returning more readable debug output.
+
+ \param nDiagField A diag field identifier.
+
+ \return A string constant describing nDiagField.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getDiagFieldString( SQLSMALLINT nDiagField )
+{
+ switch ( nDiagField )
+ {
+ case SQL_DIAG_CURSOR_ROW_COUNT:
+ return "SQL_DIAG_CURSOR_ROW_COUNT";
+ case SQL_DIAG_DYNAMIC_FUNCTION:
+ return "SQL_DIAG_DYNAMIC_FUNCTION";
+ case SQL_DIAG_DYNAMIC_FUNCTION_CODE:
+ return "SQL_DIAG_DYNAMIC_FUNCTION_CODE";
+ case SQL_DIAG_NUMBER:
+ return "SQL_DIAG_NUMBER";
+ case SQL_DIAG_RETURNCODE:
+ return "SQL_DIAG_RETURNCODE";
+ case SQL_DIAG_ROW_COUNT:
+ return "SQL_DIAG_ROW_COUNT";
+ case SQL_DIAG_CLASS_ORIGIN:
+ return "SQL_DIAG_CLASS_ORIGIN";
+ case SQL_DIAG_COLUMN_NUMBER:
+ return "SQL_DIAG_COLUMN_NUMBER";
+ case SQL_DIAG_CONNECTION_NAME:
+ return "SQL_DIAG_CONNECTION_NAME";
+ case SQL_DIAG_MESSAGE_TEXT:
+ return "SQL_DIAG_MESSAGE_TEXT";
+ case SQL_DIAG_NATIVE:
+ return "SQL_DIAG_NATIVE";
+ case SQL_DIAG_ROW_NUMBER:
+ return "SQL_DIAG_ROW_NUMBER";
+ case SQL_DIAG_SERVER_NAME:
+ return "SQL_DIAG_SERVER_NAME";
+ case SQL_DIAG_SQLSTATE:
+ return "SQL_DIAG_SQLSTATE";
+ case SQL_DIAG_SUBCLASS_ORIGIN:
+ return "SQL_DIAG_SUBCLASS_ORIGIN";
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a environment attribute.
+
+ Returns a string version of a environment attribute. This is great for
+ returning more readable debug output.
+
+ \param nAttribute An environment attribute.
+
+ \return A string constant describing nAttribute.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getEnvAttrString( SQLINTEGER nAttribute )
+{
+ switch ( nAttribute )
+ {
+ case SQL_ATTR_CONNECTION_POOLING:
+ return "SQL_ATTR_CONNECTION_POOLING";
+ case SQL_ATTR_CP_MATCH:
+ return "SQL_ATTR_CP_MATCH";
+ case SQL_ATTR_ODBC_VERSION:
+ return "SQL_ATTR_ODBC_VERSION";
+ case SQL_ATTR_OUTPUT_NTS:
+ return "SQL_ATTR_OUTPUT_NTS";
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a function id.
+
+ Returns a string version of a function id. This is great for
+ returning more readable debug output.
+
+ \param nFunction A function ID or SQL_API_ALL_FUNCTIONS, or
+ SQL_API_ODBC3_ALL_FUNCTIONS.
+
+ \return A string of the function ID.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getFunctionsString( SQLUSMALLINT nFunction )
+{
+ switch ( nFunction )
+ {
+ case SQL_API_ALL_FUNCTIONS:
+ return "SQL_API_ALL_FUNCTIONS";
+ case SQL_API_SQLALLOCCONNECT:
+ return "SQL_API_SQLALLOCCONNECT";
+ case SQL_API_SQLALLOCENV:
+ return "SQL_API_SQLALLOCENV";
+ case SQL_API_SQLALLOCHANDLE:
+ return "SQL_API_SQLALLOCHANDLE";
+ case SQL_API_SQLALLOCSTMT:
+ return "SQL_API_SQLALLOCSTMT";
+ case SQL_API_SQLBINDCOL:
+ return "SQL_API_SQLBINDCOL";
+ case SQL_API_SQLCANCEL:
+ return "SQL_API_SQLCANCEL";
+ case SQL_API_SQLCLOSECURSOR:
+ return "SQL_API_SQLCLOSECURSOR";
+/* Same value as SQL_API_SQLCOLATTRIBUTES...
+ case SQL_API_SQLCOLATTRIBUTE:
+ return "SQL_API_SQLCOLATTRIBUTE";
+*/
+ case SQL_API_SQLCOLUMNS:
+ return "SQL_API_SQLCOLUMNS";
+ case SQL_API_SQLCONNECT:
+ return "SQL_API_SQLCONNECT";
+ case SQL_API_SQLCOPYDESC:
+ return "SQL_API_SQLCOPYDESC";
+ case SQL_API_SQLDATASOURCES:
+ return "SQL_API_SQLDATASOURCES";
+ case SQL_API_SQLDESCRIBECOL:
+ return "SQL_API_SQLDESCRIBECOL";
+ case SQL_API_SQLDISCONNECT:
+ return "SQL_API_SQLDISCONNECT";
+ case SQL_API_SQLENDTRAN:
+ return "SQL_API_SQLENDTRAN";
+ case SQL_API_SQLERROR:
+ return "SQL_API_SQLERROR";
+ case SQL_API_SQLEXECDIRECT:
+ return "SQL_API_SQLEXECDIRECT";
+ case SQL_API_SQLEXECUTE:
+ return "SQL_API_SQLEXECUTE";
+ case SQL_API_SQLFETCH:
+ return "SQL_API_SQLFETCH";
+ case SQL_API_SQLFETCHSCROLL:
+ return "SQL_API_SQLFETCHSCROLL";
+ case SQL_API_SQLFREECONNECT:
+ return "SQL_API_SQLFREECONNECT";
+ case SQL_API_SQLFREEENV:
+ return "SQL_API_SQLFREEENV";
+ case SQL_API_SQLFREEHANDLE:
+ return "SQL_API_SQLFREEHANDLE";
+ case SQL_API_SQLFREESTMT:
+ return "SQL_API_SQLFREESTMT";
+ case SQL_API_SQLGETCONNECTATTR:
+ return "SQL_API_SQLGETCONNECTATTR";
+ case SQL_API_SQLGETCONNECTOPTION:
+ return "SQL_API_SQLGETCONNECTOPTION";
+ case SQL_API_SQLGETCURSORNAME:
+ return "SQL_API_SQLGETCURSORNAME";
+ case SQL_API_SQLGETDATA:
+ return "SQL_API_SQLGETDATA";
+ case SQL_API_SQLGETDESCFIELD:
+ return "SQL_API_SQLGETDESCFIELD";
+ case SQL_API_SQLGETDESCREC:
+ return "SQL_API_SQLGETDESCREC";
+ case SQL_API_SQLGETDIAGFIELD:
+ return "SQL_API_SQLGETDIAGFIELD";
+ case SQL_API_SQLGETDIAGREC:
+ return "SQL_API_SQLGETDIAGREC";
+ case SQL_API_SQLGETENVATTR:
+ return "SQL_API_SQLGETENVATTR";
+ case SQL_API_SQLGETFUNCTIONS:
+ return "SQL_API_SQLGETFUNCTIONS";
+ case SQL_API_SQLGETINFO:
+ return "SQL_API_SQLGETINFO";
+ case SQL_API_SQLGETSTMTATTR:
+ return "SQL_API_SQLGETSTMTATTR";
+ case SQL_API_SQLGETSTMTOPTION:
+ return "SQL_API_SQLGETSTMTOPTION";
+ case SQL_API_SQLGETTYPEINFO:
+ return "SQL_API_SQLGETTYPEINFO";
+ case SQL_API_SQLNUMRESULTCOLS:
+ return "SQL_API_SQLNUMRESULTCOLS";
+ case SQL_API_SQLPARAMDATA:
+ return "SQL_API_SQLPARAMDATA";
+ case SQL_API_SQLPREPARE:
+ return "SQL_API_SQLPREPARE";
+ case SQL_API_SQLPUTDATA:
+ return "SQL_API_SQLPUTDATA";
+ case SQL_API_SQLROWCOUNT:
+ return "SQL_API_SQLROWCOUNT";
+ case SQL_API_SQLSETCONNECTATTR:
+ return "SQL_API_SQLSETCONNECTATTR";
+ case SQL_API_SQLSETCONNECTOPTION:
+ return "SQL_API_SQLSETCONNECTOPTION";
+ case SQL_API_SQLSETCURSORNAME:
+ return "SQL_API_SQLSETCURSORNAME";
+ case SQL_API_SQLSETDESCFIELD:
+ return "SQL_API_SQLSETDESCFIELD";
+ case SQL_API_SQLSETDESCREC:
+ return "SQL_API_SQLSETDESCREC";
+ case SQL_API_SQLSETENVATTR:
+ return "SQL_API_SQLSETENVATTR";
+ case SQL_API_SQLSETSTMTATTR:
+ return "SQL_API_SQLSETSTMTATTR";
+ case SQL_API_SQLSETSTMTOPTION:
+ return "SQL_API_SQLSETSTMTOPTION";
+ case SQL_API_SQLSPECIALCOLUMNS:
+ return "SQL_API_SQLSPECIALCOLUMNS";
+ case SQL_API_SQLSTATISTICS:
+ return "SQL_API_SQLSTATISTICS";
+ case SQL_API_SQLTABLES:
+ return "SQL_API_SQLTABLES";
+ case SQL_API_SQLTRANSACT:
+ return "SQL_API_SQLTRANSACT";
+ case SQL_API_SQLBULKOPERATIONS:
+ return "SQL_API_SQLBULKOPERATIONS";
+ case SQL_API_SQLBINDPARAMETER:
+ return "SQL_API_SQLBINDPARAMETER";
+ case SQL_API_SQLBROWSECONNECT:
+ return "SQL_API_SQLBROWSECONNECT";
+ case SQL_API_SQLCOLATTRIBUTES:
+ return "SQL_API_SQLCOLATTRIBUTES";
+ case SQL_API_SQLCOLUMNPRIVILEGES :
+ return "SQL_API_SQLCOLUMNPRIVILEGES";
+ case SQL_API_SQLDESCRIBEPARAM:
+ return "SQL_API_SQLDESCRIBEPARAM";
+ case SQL_API_SQLDRIVERCONNECT:
+ return "SQL_API_SQLDRIVERCONNECT";
+ case SQL_API_SQLDRIVERS:
+ return "SQL_API_SQLDRIVERS";
+ case SQL_API_SQLEXTENDEDFETCH:
+ return "SQL_API_SQLEXTENDEDFETCH";
+ case SQL_API_SQLFOREIGNKEYS:
+ return "SQL_API_SQLFOREIGNKEYS";
+ case SQL_API_SQLMORERESULTS:
+ return "SQL_API_SQLMORERESULTS";
+ case SQL_API_SQLNATIVESQL:
+ return "SQL_API_SQLNATIVESQL";
+ case SQL_API_SQLNUMPARAMS:
+ return "SQL_API_SQLNUMPARAMS";
+ case SQL_API_SQLPARAMOPTIONS:
+ return "SQL_API_SQLPARAMOPTIONS";
+ case SQL_API_SQLPRIMARYKEYS:
+ return "SQL_API_SQLPRIMARYKEYS";
+ case SQL_API_SQLPROCEDURECOLUMNS:
+ return "SQL_API_SQLPROCEDURECOLUMNS";
+ case SQL_API_SQLPROCEDURES:
+ return "SQL_API_SQLPROCEDURES";
+ case SQL_API_SQLSETPOS:
+ return "SQL_API_SQLSETPOS";
+ case SQL_API_SQLSETSCROLLOPTIONS:
+ return "SQL_API_SQLSETSCROLLOPTIONS";
+ case SQL_API_SQLTABLEPRIVILEGES:
+ return "SQL_API_SQLTABLEPRIVILEGES";
+ case SQL_API_ODBC3_ALL_FUNCTIONS:
+ return "SQL_API_ODBC3_ALL_FUNCTIONS";
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a handle type identifier.
+
+ Returns a string version of a handle type identifier. This is great for
+ returning more readable debug output.
+
+ \param nHandleType A handle type identifier.
+
+ \return A string constant describing nHandleType.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getHandleTypeString( SQLSMALLINT nHandleType )
+{
+ switch ( nHandleType )
+ {
+ case SQL_HANDLE_ENV:
+ return "SQL_HANDLE_ENV";
+ case SQL_HANDLE_DBC:
+ return "SQL_HANDLE_DBC";
+ case SQL_HANDLE_STMT:
+ return "SQL_HANDLE_STMT";
+ case SQL_HANDLE_DESC:
+ return "SQL_HANDLE_DESC";
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a info type identifier.
+
+ Returns a string version of a info type identifier. This is great for
+ returning more readable debug output.
+
+ \param nInfoType A info type identifier.
+
+ \return A string constant describing nInfoType.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getInfoTypeString( SQLUSMALLINT nInfoType )
+{
+ switch ( nInfoType )
+ {
+ case SQL_ACCESSIBLE_PROCEDURES:
+ return "SQL_ACCESSIBLE_PROCEDURES";
+ case SQL_ACCESSIBLE_TABLES:
+ return "SQL_ACCESSIBLE_TABLES";
+ case SQL_ACTIVE_ENVIRONMENTS:
+ return "SQL_ACTIVE_ENVIRONMENTS";
+ case SQL_AGGREGATE_FUNCTIONS:
+ return "SQL_AGGREGATE_FUNCTIONS";
+ case SQL_ALTER_DOMAIN:
+ return "SQL_ALTER_DOMAIN";
+ case SQL_ALTER_TABLE:
+ return "SQL_ALTER_TABLE";
+ case SQL_ASYNC_MODE:
+ return "SQL_ASYNC_MODE";
+ case SQL_BATCH_ROW_COUNT:
+ return "SQL_BATCH_ROW_COUNT";
+ case SQL_BATCH_SUPPORT:
+ return "SQL_BATCH_SUPPORT";
+ case SQL_BOOKMARK_PERSISTENCE:
+ return "SQL_BOOKMARK_PERSISTENCE";
+ case SQL_CATALOG_LOCATION:
+ return "SQL_CATALOG_LOCATION";
+ case SQL_CATALOG_NAME:
+ return "SQL_CATALOG_NAME";
+ case SQL_CATALOG_NAME_SEPARATOR:
+ return "SQL_CATALOG_NAME_SEPARATOR";
+ case SQL_CATALOG_TERM:
+ return "SQL_CATALOG_TERM";
+ case SQL_CATALOG_USAGE:
+ return "SQL_CATALOG_USAGE";
+ case SQL_COLLATION_SEQ:
+ return "SQL_COLLATION_SEQ";
+ case SQL_COLUMN_ALIAS:
+ return "SQL_COLUMN_ALIAS";
+ case SQL_CONCAT_NULL_BEHAVIOR:
+ return "SQL_CONCAT_NULL_BEHAVIOR";
+ case SQL_CONVERT_BIGINT:
+ return "SQL_CONVERT_BIGINT";
+ case SQL_CONVERT_BINARY:
+ return "SQL_CONVERT_BINARY";
+ case SQL_CONVERT_BIT:
+ return "SQL_CONVERT_BIT";
+ case SQL_CONVERT_CHAR:
+ return "SQL_CONVERT_CHAR";
+#ifdef SQL_CONVERT_GUID
+ case SQL_CONVERT_GUID:
+ return "SQL_CONVERT_GUID";
+#endif
+ case SQL_CONVERT_DATE:
+ return "SQL_CONVERT_DATE";
+ case SQL_CONVERT_DECIMAL:
+ return "SQL_CONVERT_DECIMAL";
+ case SQL_CONVERT_DOUBLE:
+ return "SQL_CONVERT_DOUBLE";
+ case SQL_CONVERT_FLOAT:
+ return "SQL_CONVERT_FLOAT";
+ case SQL_CONVERT_INTEGER:
+ return "SQL_CONVERT_INTEGER";
+ case SQL_CONVERT_INTERVAL_YEAR_MONTH:
+ return "SQL_CONVERT_INTERVAL_YEAR_MONTH";
+ case SQL_CONVERT_INTERVAL_DAY_TIME:
+ return "SQL_CONVERT_INTERVAL_DAY_TIME";
+ case SQL_CONVERT_LONGVARBINARY:
+ return "SQL_CONVERT_LONGVARBINARY";
+ case SQL_CONVERT_LONGVARCHAR:
+ return "SQL_CONVERT_LONGVARCHAR";
+ case SQL_CONVERT_NUMERIC:
+ return "SQL_CONVERT_NUMERIC";
+ case SQL_CONVERT_REAL:
+ return "SQL_CONVERT_REAL";
+ case SQL_CONVERT_SMALLINT:
+ return "SQL_CONVERT_SMALLINT";
+ case SQL_CONVERT_TIME:
+ return "SQL_CONVERT_TIME";
+ case SQL_CONVERT_TIMESTAMP:
+ return "SQL_CONVERT_TIMESTAMP";
+ case SQL_CONVERT_TINYINT:
+ return "SQL_CONVERT_TINYINT";
+ case SQL_CONVERT_VARBINARY:
+ return "SQL_CONVERT_VARBINARY";
+ case SQL_CONVERT_VARCHAR:
+ return "SQL_CONVERT_VARCHAR";
+ case SQL_CONVERT_FUNCTIONS:
+ return "SQL_CONVERT_FUNCTIONS";
+ case SQL_CORRELATION_NAME:
+ return "SQL_CORRELATION_NAME";
+ case SQL_CREATE_ASSERTION:
+ return "SQL_CREATE_ASSERTION";
+ case SQL_CREATE_CHARACTER_SET:
+ return "SQL_CREATE_CHARACTER_SET";
+ case SQL_CREATE_COLLATION:
+ return "SQL_CREATE_COLLATION";
+ case SQL_CREATE_DOMAIN:
+ return "SQL_CREATE_DOMAIN";
+ case SQL_CREATE_SCHEMA:
+ return "SQL_CREATE_SCHEMA";
+ case SQL_CREATE_TABLE:
+ return "SQL_CREATE_TABLE";
+ case SQL_CREATE_TRANSLATION:
+ return "SQL_CREATE_TRANSLATION";
+ case SQL_CREATE_VIEW:
+ return "SQL_CREATE_VIEW";
+ case SQL_CURSOR_COMMIT_BEHAVIOR:
+ return "SQL_CURSOR_COMMIT_BEHAVIOR";
+ case SQL_CURSOR_ROLLBACK_BEHAVIOR:
+ return "SQL_CURSOR_ROLLBACK_BEHAVIOR";
+ case SQL_CURSOR_SENSITIVITY:
+ return "SQL_CURSOR_SENSITIVITY";
+ case SQL_DATA_SOURCE_NAME:
+ return "SQL_DATA_SOURCE_NAME";
+ case SQL_DATA_SOURCE_READ_ONLY:
+ return "SQL_DATA_SOURCE_READ_ONLY";
+ case SQL_DATABASE_NAME:
+ return "SQL_DATABASE_NAME";
+ case SQL_DATETIME_LITERALS:
+ return "SQL_DATETIME_LITERALS";
+ case SQL_DBMS_NAME:
+ return "SQL_DBMS_NAME";
+ case SQL_DBMS_VER:
+ return "SQL_DBMS_VER";
+ case SQL_DDL_INDEX:
+ return "SQL_DDL_INDEX";
+ case SQL_DEFAULT_TXN_ISOLATION:
+ return "SQL_DEFAULT_TXN_ISOLATION";
+ case SQL_DESCRIBE_PARAMETER:
+ return "SQL_DESCRIBE_PARAMETER";
+ case SQL_DM_VER:
+ return "SQL_DM_VER";
+ case SQL_DRIVER_HDBC:
+ return "SQL_DRIVER_HDBC";
+ case SQL_DRIVER_HENV:
+ return "SQL_DRIVER_HENV";
+ case SQL_DRIVER_HDESC:
+ return "SQL_DRIVER_HDESC";
+ case SQL_DRIVER_HLIB:
+ return "SQL_DRIVER_HLIB";
+ case SQL_DRIVER_HSTMT:
+ return "SQL_DRIVER_HSTMT";
+ case SQL_DRIVER_NAME:
+ return "SQL_DRIVER_NAME";
+ case SQL_DRIVER_ODBC_VER:
+ return "SQL_DRIVER_ODBC_VER";
+ case SQL_DRIVER_VER:
+ return "SQL_DRIVER_VER";
+ case SQL_DROP_ASSERTION:
+ return "SQL_DROP_ASSERTION";
+ case SQL_DROP_CHARACTER_SET:
+ return "SQL_DROP_CHARACTER_SET";
+ case SQL_DROP_COLLATION:
+ return "SQL_DROP_COLLATION";
+ case SQL_DROP_DOMAIN:
+ return "SQL_DROP_DOMAIN";
+ case SQL_DROP_SCHEMA:
+ return "SQL_DROP_SCHEMA";
+ case SQL_DROP_TABLE:
+ return "SQL_DROP_TABLE";
+ case SQL_DROP_TRANSLATION:
+ return "SQL_DROP_TRANSLATION";
+ case SQL_DROP_VIEW:
+ return "SQL_DROP_VIEW";
+ case SQL_DYNAMIC_CURSOR_ATTRIBUTES1:
+ return "SQL_DYNAMIC_CURSOR_ATTRIBUTES1";
+ case SQL_DYNAMIC_CURSOR_ATTRIBUTES2:
+ return "SQL_DYNAMIC_CURSOR_ATTRIBUTES2";
+ case SQL_EXPRESSIONS_IN_ORDERBY:
+ return "SQL_EXPRESSIONS_IN_ORDERBY";
+ case SQL_FILE_USAGE:
+ return "SQL_FILE_USAGE";
+ case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1:
+ return "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1";
+ case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2:
+ return "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2";
+ case SQL_GETDATA_EXTENSIONS:
+ return "SQL_GETDATA_EXTENSIONS";
+ case SQL_GROUP_BY:
+ return "SQL_GROUP_BY";
+ case SQL_IDENTIFIER_CASE:
+ return "SQL_IDENTIFIER_CASE";
+ case SQL_IDENTIFIER_QUOTE_CHAR:
+ return "SQL_IDENTIFIER_QUOTE_CHAR";
+ case SQL_INDEX_KEYWORDS:
+ return "SQL_INDEX_KEYWORDS";
+ case SQL_INFO_SCHEMA_VIEWS:
+ return "SQL_INFO_SCHEMA_VIEWS";
+ case SQL_INSERT_STATEMENT:
+ return "SQL_INSERT_STATEMENT";
+ case SQL_INTEGRITY:
+ return "SQL_INTEGRITY";
+ case SQL_KEYSET_CURSOR_ATTRIBUTES1:
+ return "SQL_KEYSET_CURSOR_ATTRIBUTES1";
+ case SQL_KEYSET_CURSOR_ATTRIBUTES2:
+ return "SQL_KEYSET_CURSOR_ATTRIBUTES2";
+ case SQL_KEYWORDS:
+ return "SQL_KEYWORDS";
+ case SQL_LIKE_ESCAPE_CLAUSE:
+ return "SQL_LIKE_ESCAPE_CLAUSE";
+ case SQL_MAX_ASYNC_CONCURRENT_STATEMENTS:
+ return "SQL_MAX_ASYNC_CONCURRENT_STATEMENTS";
+ case SQL_MAX_BINARY_LITERAL_LEN:
+ return "SQL_MAX_BINARY_LITERAL_LEN";
+ case SQL_MAX_CATALOG_NAME_LEN:
+ return "SQL_MAX_CATALOG_NAME_LEN";
+ case SQL_MAX_CHAR_LITERAL_LEN:
+ return "SQL_MAX_CHAR_LITERAL_LEN";
+ case SQL_MAX_COLUMN_NAME_LEN:
+ return "SQL_MAX_COLUMN_NAME_LEN";
+ case SQL_MAX_COLUMNS_IN_GROUP_BY:
+ return "SQL_MAX_COLUMNS_IN_GROUP_BY";
+ case SQL_MAX_COLUMNS_IN_INDEX:
+ return "SQL_MAX_COLUMNS_IN_INDEX";
+ case SQL_MAX_COLUMNS_IN_ORDER_BY:
+ return "SQL_MAX_COLUMNS_IN_ORDER_BY";
+ case SQL_MAX_COLUMNS_IN_SELECT:
+ return "SQL_MAX_COLUMNS_IN_SELECT";
+ case SQL_MAX_COLUMNS_IN_TABLE:
+ return "SQL_MAX_COLUMNS_IN_TABLE";
+ case SQL_MAX_CONCURRENT_ACTIVITIES:
+ return "SQL_MAX_CONCURRENT_ACTIVITIES";
+ case SQL_MAX_CURSOR_NAME_LEN:
+ return "SQL_MAX_CURSOR_NAME_LEN";
+ case SQL_MAX_DRIVER_CONNECTIONS:
+ return "SQL_MAX_DRIVER_CONNECTIONS";
+ case SQL_MAX_IDENTIFIER_LEN:
+ return "SQL_MAX_IDENTIFIER_LEN";
+ case SQL_MAX_INDEX_SIZE:
+ return "SQL_MAX_INDEX_SIZE";
+ case SQL_MAX_PROCEDURE_NAME_LEN:
+ return "SQL_MAX_PROCEDURE_NAME_LEN";
+ case SQL_MAX_ROW_SIZE:
+ return "SQL_MAX_ROW_SIZE";
+ case SQL_MAX_ROW_SIZE_INCLUDES_LONG:
+ return "SQL_MAX_ROW_SIZE_INCLUDES_LONG";
+ case SQL_MAX_SCHEMA_NAME_LEN:
+ return "SQL_MAX_SCHEMA_NAME_LEN";
+ case SQL_MAX_STATEMENT_LEN:
+ return "SQL_MAX_STATEMENT_LEN";
+ case SQL_MAX_TABLE_NAME_LEN:
+ return "SQL_MAX_TABLE_NAME_LEN";
+ case SQL_MAX_TABLES_IN_SELECT:
+ return "SQL_MAX_TABLES_IN_SELECT";
+ case SQL_MAX_USER_NAME_LEN:
+ return "SQL_MAX_USER_NAME_LEN";
+ case SQL_MULT_RESULT_SETS:
+ return "SQL_MULT_RESULT_SETS";
+ case SQL_MULTIPLE_ACTIVE_TXN:
+ return "SQL_MULTIPLE_ACTIVE_TXN";
+ case SQL_NEED_LONG_DATA_LEN:
+ return "SQL_NEED_LONG_DATA_LEN";
+ case SQL_NON_NULLABLE_COLUMNS:
+ return "SQL_NON_NULLABLE_COLUMNS";
+ case SQL_NULL_COLLATION:
+ return "SQL_NULL_COLLATION";
+ case SQL_NUMERIC_FUNCTIONS:
+ return "SQL_NUMERIC_FUNCTIONS";
+ case SQL_ODBC_API_CONFORMANCE:
+ return "SQL_ODBC_API_CONFORMANCE";
+ case SQL_ODBC_INTERFACE_CONFORMANCE:
+ return "SQL_ODBC_INTERFACE_CONFORMANCE";
+ case SQL_ODBC_VER:
+ return "SQL_ODBC_VER";
+ case SQL_OJ_CAPABILITIES:
+ return "SQL_OJ_CAPABILITIES";
+ case SQL_ORDER_BY_COLUMNS_IN_SELECT:
+ return "SQL_ORDER_BY_COLUMNS_IN_SELECT";
+ case SQL_PARAM_ARRAY_ROW_COUNTS:
+ return "SQL_PARAM_ARRAY_ROW_COUNTS";
+ case SQL_PARAM_ARRAY_SELECTS:
+ return "SQL_PARAM_ARRAY_SELECTS";
+ case SQL_PROCEDURE_TERM:
+ return "SQL_PROCEDURE_TERM";
+ case SQL_PROCEDURES:
+ return "SQL_PROCEDURES";
+ case SQL_POS_OPERATIONS:
+ return "SQL_POS_OPERATIONS";
+ case SQL_QUOTED_IDENTIFIER_CASE:
+ return "SQL_QUOTED_IDENTIFIER_CASE";
+ case SQL_ROW_UPDATES:
+ return "SQL_ROW_UPDATES";
+ case SQL_SCHEMA_TERM:
+ return "SQL_SCHEMA_TERM";
+ case SQL_SCHEMA_USAGE:
+ return "SQL_SCHEMA_USAGE";
+ case SQL_SCROLL_OPTIONS:
+ return "SQL_SCROLL_OPTIONS";
+ case SQL_SEARCH_PATTERN_ESCAPE:
+ return "SQL_SEARCH_PATTERN_ESCAPE";
+ case SQL_SERVER_NAME:
+ return "SQL_SERVER_NAME";
+ case SQL_SPECIAL_CHARACTERS:
+ return "SQL_SPECIAL_CHARACTERS";
+ case SQL_SQL_CONFORMANCE:
+ return "SQL_SQL_CONFORMANCE";
+ case SQL_SQL92_DATETIME_FUNCTIONS:
+ return "SQL_SQL92_DATETIME_FUNCTIONS";
+ case SQL_SQL92_FOREIGN_KEY_DELETE_RULE:
+ return "SQL_SQL92_FOREIGN_KEY_DELETE_RULE";
+ case SQL_SQL92_FOREIGN_KEY_UPDATE_RULE:
+ return "SQL_SQL92_FOREIGN_KEY_UPDATE_RULE";
+ case SQL_SQL92_GRANT:
+ return "SQL_SQL92_GRANT";
+ case SQL_SQL92_NUMERIC_VALUE_FUNCTIONS:
+ return "SQL_SQL92_NUMERIC_VALUE_FUNCTIONS";
+ case SQL_SQL92_PREDICATES:
+ return "SQL_SQL92_PREDICATES";
+ case SQL_SQL92_RELATIONAL_JOIN_OPERATORS:
+ return "SQL_SQL92_RELATIONAL_JOIN_OPERATORS";
+ case SQL_SQL92_REVOKE:
+ return "SQL_SQL92_REVOKE";
+ case SQL_SQL92_ROW_VALUE_CONSTRUCTOR:
+ return "SQL_SQL92_ROW_VALUE_CONSTRUCTOR";
+ case SQL_SQL92_STRING_FUNCTIONS:
+ return "SQL_SQL92_STRING_FUNCTIONS";
+ case SQL_SQL92_VALUE_EXPRESSIONS:
+ return "SQL_SQL92_VALUE_EXPRESSIONS";
+ case SQL_STANDARD_CLI_CONFORMANCE:
+ return "SQL_STANDARD_CLI_CONFORMANCE";
+ case SQL_STATIC_CURSOR_ATTRIBUTES1:
+ return "SQL_STATIC_CURSOR_ATTRIBUTES1";
+ case SQL_STATIC_CURSOR_ATTRIBUTES2:
+ return "SQL_STATIC_CURSOR_ATTRIBUTES2";
+ case SQL_STRING_FUNCTIONS:
+ return "SQL_STRING_FUNCTIONS";
+ case SQL_SUBQUERIES:
+ return "SQL_SUBQUERIES";
+ case SQL_SYSTEM_FUNCTIONS:
+ return "SQL_SYSTEM_FUNCTIONS";
+ case SQL_TABLE_TERM:
+ return "SQL_TABLE_TERM";
+ case SQL_TIMEDATE_ADD_INTERVALS:
+ return "SQL_TIMEDATE_ADD_INTERVALS";
+ case SQL_TIMEDATE_DIFF_INTERVALS:
+ return "SQL_TIMEDATE_DIFF_INTERVALS";
+ case SQL_TIMEDATE_FUNCTIONS:
+ return "SQL_TIMEDATE_FUNCTIONS";
+ case SQL_TXN_CAPABLE:
+ return "SQL_TXN_CAPABLE";
+ case SQL_TXN_ISOLATION_OPTION:
+ return "SQL_TXN_ISOLATION_OPTION";
+ case SQL_UNION:
+ return "SQL_UNION";
+ case SQL_USER_NAME:
+ return "SQL_USER_NAME";
+ case SQL_XOPEN_CLI_YEAR:
+ return "SQL_XOPEN_CLI_YEAR";
+ }
+
+ return "unknown";
+}
+
+
+/*!
+ \brief Returns a string version of SQLRETURN.
+
+ Returns a string version of SQLRETURN. This is great for
+ returning more readable debug output.
+
+ \param ret A SQLRETURN value.
+
+ \return A string constant describing ret.
+
+ \sa MYODBCDbgReturn
+*/
+QString MYODBCC::getReturnString( SQLRETURN nReturn )
+{
+ switch ( nReturn )
+ {
+ case SQL_SUCCESS:
+ return "SQL_SUCCESS";
+ case SQL_SUCCESS_WITH_INFO:
+ return "SQL_SUCCESS_WITH_INFO";
+#if (ODBCVER >= 0x0300)
+ case SQL_NO_DATA:
+ return "SQL_NO_DATA";
+#endif
+ case SQL_ERROR:
+ return "SQL_ERROR or SQL_NULL_DATA";
+ case SQL_INVALID_HANDLE:
+ return "SQL_INVALID_HANDLE or SQL_DATA_AT_EXEC";
+ case SQL_STILL_EXECUTING:
+ return "SQL_STILL_EXECUTING";
+ case SQL_NEED_DATA:
+ return "SQL_NEED_DATA";
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a statement attribute.
+
+ Returns a string version of a statement attribute. This is great for
+ returning more readable debug output.
+
+ \param nAttribute An statement attribute.
+
+ \return A string constant describing nAttribute.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getStmtAttrString( SQLINTEGER nAttribute )
+{
+ switch ( nAttribute )
+ {
+ case SQL_ATTR_APP_PARAM_DESC:
+ return "SQL_ATTR_APP_PARAM_DESC";
+ case SQL_ATTR_APP_ROW_DESC:
+ return "SQL_ATTR_APP_ROW_DESC";
+ case SQL_ATTR_ASYNC_ENABLE:
+ return "SQL_ATTR_ASYNC_ENABLE";
+ case SQL_ATTR_CONCURRENCY:
+ return "SQL_ATTR_CONCURRENCY";
+ case SQL_ATTR_CURSOR_SCROLLABLE:
+ return "SQL_ATTR_CURSOR_SCROLLABLE";
+ case SQL_ATTR_CURSOR_SENSITIVITY:
+ return "SQL_ATTR_CURSOR_SENSITIVITY";
+ case SQL_ATTR_CURSOR_TYPE:
+ return "SQL_ATTR_CURSOR_TYPE";
+ case SQL_ATTR_ENABLE_AUTO_IPD:
+ return "SQL_ATTR_ENABLE_AUTO_IPD";
+ case SQL_ATTR_FETCH_BOOKMARK_PTR:
+ return "SQL_ATTR_FETCH_BOOKMARK_PTR";
+ case SQL_ATTR_IMP_PARAM_DESC:
+ return "SQL_ATTR_IMP_PARAM_DESC";
+ case SQL_ATTR_IMP_ROW_DESC:
+ return "SQL_ATTR_IMP_ROW_DESC";
+ case SQL_ATTR_KEYSET_SIZE:
+ return "SQL_ATTR_KEYSET_SIZE";
+ case SQL_ATTR_MAX_LENGTH:
+ return "SQL_ATTR_MAX_LENGTH";
+ case SQL_ATTR_MAX_ROWS:
+ return "SQL_ATTR_MAX_ROWS";
+ case SQL_ATTR_METADATA_ID:
+ return "SQL_ATTR_METADATA_ID";
+ case SQL_ATTR_NOSCAN:
+ return "SQL_ATTR_NOSCAN";
+ case SQL_ATTR_PARAM_BIND_OFFSET_PTR:
+ return "SQL_ATTR_PARAM_BIND_OFFSET_PTR";
+ case SQL_ATTR_PARAM_BIND_TYPE:
+ return "SQL_ATTR_PARAM_BIND_TYPE";
+ case SQL_ATTR_PARAM_OPERATION_PTR:
+ return "SQL_ATTR_PARAM_OPERATION_PTR";
+ case SQL_ATTR_PARAM_STATUS_PTR:
+ return "SQL_ATTR_PARAM_STATUS_PTR";
+ case SQL_ATTR_PARAMS_PROCESSED_PTR:
+ return "SQL_ATTR_PARAMS_PROCESSED_PTR";
+ case SQL_ATTR_PARAMSET_SIZE:
+ return "SQL_ATTR_PARAMSET_SIZE";
+ case SQL_ATTR_QUERY_TIMEOUT:
+ return "SQL_ATTR_QUERY_TIMEOUT";
+ case SQL_ATTR_RETRIEVE_DATA:
+ return "SQL_ATTR_RETRIEVE_DATA";
+ case SQL_ATTR_ROW_ARRAY_SIZE:
+ return "SQL_ATTR_ROW_ARRAY_SIZE";
+ case SQL_ATTR_ROW_BIND_OFFSET_PTR:
+ return "SQL_ATTR_ROW_BIND_OFFSET_PTR";
+ case SQL_ATTR_ROW_BIND_TYPE:
+ return "SQL_ATTR_ROW_BIND_TYPE";
+ case SQL_ATTR_ROW_NUMBER:
+ return "SQL_ATTR_ROW_NUMBER";
+ case SQL_ATTR_ROW_OPERATION_PTR:
+ return "SQL_ATTR_ROW_OPERATION_PTR";
+ case SQL_ATTR_ROW_STATUS_PTR:
+ return "SQL_ATTR_ROW_STATUS_PTR";
+ case SQL_ATTR_ROWS_FETCHED_PTR:
+ return "SQL_ATTR_ROWS_FETCHED_PTR";
+ case SQL_ATTR_SIMULATE_CURSOR:
+ return "SQL_ATTR_SIMULATE_CURSOR";
+ case SQL_ATTR_USE_BOOKMARKS:
+ return "SQL_ATTR_USE_BOOKMARKS";
+ }
+
+ return "unknown";
+}
+
+/*!
+ \brief Returns a string version of a statement option.
+
+ Returns a string version of a statement option. This is great for
+ returning more readable debug output.
+
+ \param nOption An statement attribute.
+
+ \return A string constant describing nOption.
+
+ \sa MYODBCDbgPrint
+ MYODBCDbgPrint2
+*/
+QString MYODBCC::getStmtOptionString( SQLUSMALLINT nOption )
+{
+ switch ( nOption )
+ {
+ case SQL_ASYNC_ENABLE:
+ return "SQL_ASYNC_ENABLE";
+ case SQL_BIND_TYPE:
+ return "SQL_BIND_TYPE";
+ case SQL_CONCURRENCY:
+ return "SQL_CONCURRENCY";
+ case SQL_CURSOR_TYPE:
+ return "SQL_CURSOR_TYPE";
+ case SQL_GET_BOOKMARK:
+ return "SQL_GET_BOOKMARK";
+ case SQL_KEYSET_SIZE:
+ return "SQL_KEYSET_SIZE";
+ case SQL_MAX_LENGTH:
+ return "SQL_MAX_LENGTH";
+ case SQL_MAX_ROWS:
+ return "SQL_MAX_ROWS";
+ case SQL_NOSCAN:
+ return "SQL_NOSCAN";
+ case SQL_QUERY_TIMEOUT:
+ return "SQL_QUERY_TIMEOUT";
+ case SQL_RETRIEVE_DATA:
+ return "SQL_RETRIEVE_DATA";
+ case SQL_ROWSET_SIZE:
+ return "SQL_ROWSET_SIZE";
+ case SQL_ROW_NUMBER:
+ return "SQL_ROW_NUMBER";
+ case SQL_SIMULATE_CURSOR:
+ return "SQL_SIMULATE_CURSOR";
+ case SQL_USE_BOOKMARKS:
+ return "SQL_USE_BOOKMARKS";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getTypeStringC( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_C_CHAR:
+ return "SQL_C_CHAR";
+ case SQL_C_SSHORT:
+ return "SQL_C_SSHORT";
+ case SQL_C_USHORT:
+ return "SQL_C_USHORT";
+ case SQL_C_SLONG:
+ return "SQL_C_SLONG";
+ case SQL_C_ULONG:
+ return "SQL_C_ULONG";
+ case SQL_C_FLOAT:
+ return "SQL_C_FLOAT";
+ case SQL_C_DOUBLE:
+ return "SQL_C_DOUBLE";
+ case SQL_C_BIT:
+ return "SQL_C_BIT";
+ case SQL_C_STINYINT:
+ return "SQL_C_STINYINT";
+ case SQL_C_UTINYINT:
+ return "SQL_C_UTINYINT";
+ case SQL_C_SBIGINT:
+ return "SQL_C_SBIGINT";
+ case SQL_C_UBIGINT:
+ return "SQL_C_UBIGINT";
+ case SQL_C_BINARY:
+ return "SQL_C_BINARY";
+ /* case SQL_C_VARBOOKMARK: */ /* SQL_C_BINARY */
+ case SQL_C_NUMERIC:
+ return "SQL_C_NUMERIC";
+ case SQL_C_GUID:
+ return "SQL_C_GUID";
+ case SQL_C_DEFAULT:
+ return "SQL_C_DEFAULT";
+ case SQL_DATETIME:
+ return "SQL_DATETIME";
+ case SQL_INTERVAL:
+ return "SQL_INTERVAL";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getTypeStringSQL( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_CHAR:
+ return "SQL_CHAR";
+ case SQL_VARCHAR:
+ return "SQL_VARCHAR";
+ case SQL_LONGVARCHAR:
+ return "SQL_LONGVARCHAR";
+ case SQL_WCHAR:
+ return "SQL_WCHAR";
+ case SQL_WVARCHAR:
+ return "SQL_WVARCHAR";
+ case SQL_WLONGVARCHAR:
+ return "SQL_WLONGVARCHAR";
+ case SQL_DECIMAL:
+ return "SQL_DECIMAL";
+ case SQL_NUMERIC:
+ return "SQL_NUMERIC";
+ case SQL_SMALLINT:
+ return "SQL_SMALLINT";
+ case SQL_INTEGER:
+ return "SQL_INTEGER";
+ case SQL_REAL:
+ return "SQL_REAL";
+ case SQL_FLOAT:
+ return "SQL_FLOAT";
+ case SQL_DOUBLE:
+ return "SQL_DOUBLE";
+ case SQL_BIT:
+ return "SQL_BIT";
+ case SQL_TINYINT:
+ return "SQL_TINYINT";
+ case SQL_BIGINT:
+ return "SQL_BIGINT";
+ case SQL_BINARY:
+ return "SQL_BINARY";
+ case SQL_VARBINARY:
+ return "SQL_VARBINARY";
+ case SQL_LONGVARBINARY:
+ return "SQL_LONGVARBINARY";
+ case SQL_DATETIME:
+ return "SQL_DATETIME";
+ case SQL_INTERVAL:
+ return "SQL_INTERVAL";
+ case SQL_GUID:
+ return "SQL_GUID";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getConciseTypeStringC( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_C_CHAR:
+ return "SQL_C_CHAR";
+ case SQL_C_SSHORT:
+ return "SQL_C_SSHORT";
+ case SQL_C_USHORT:
+ return "SQL_C_USHORT";
+ case SQL_C_SLONG:
+ return "SQL_C_SLONG";
+ case SQL_C_ULONG:
+ return "SQL_C_ULONG";
+ case SQL_C_FLOAT:
+ return "SQL_C_FLOAT";
+ case SQL_C_DOUBLE:
+ return "SQL_C_DOUBLE";
+ case SQL_C_BIT:
+ return "SQL_C_BIT";
+ case SQL_C_STINYINT:
+ return "SQL_C_STINYINT";
+ case SQL_C_UTINYINT:
+ return "SQL_C_UTINYINT";
+ case SQL_C_SBIGINT:
+ return "SQL_C_SBIGINT";
+ case SQL_C_UBIGINT:
+ return "SQL_C_UBIGINT";
+ case SQL_C_BINARY:
+ return "SQL_C_BINARY";
+ /* case SQL_C_VARBOOKMARK: */ /* SQL_C_BINARY */
+ case SQL_C_TYPE_DATE:
+ return "SQL_C_TYPE_DATE";
+ case SQL_C_TYPE_TIME:
+ return "SQL_C_TYPE_TIME";
+ case SQL_C_TYPE_TIMESTAMP:
+ return "SQL_C_TYPE_TIMESTAMP";
+ case SQL_C_NUMERIC:
+ return "SQL_C_NUMERIC";
+ case SQL_C_GUID:
+ return "SQL_C_GUID";
+ case SQL_C_DEFAULT:
+ return "SQL_C_DEFAULT";
+ case SQL_C_INTERVAL_MONTH:
+ return "SQL_C_INTERVAL_MONTH";
+ case SQL_C_INTERVAL_YEAR:
+ return "SQL_C_INTERVAL_YEAR";
+ case SQL_C_INTERVAL_YEAR_TO_MONTH:
+ return "SQL_C_INTERVAL_YEAR_TO_MONTH";
+ case SQL_C_INTERVAL_DAY:
+ return "SQL_C_INTERVAL_DAY";
+ case SQL_C_INTERVAL_HOUR:
+ return "SQL_C_INTERVAL_HOUR";
+ case SQL_C_INTERVAL_MINUTE:
+ return "SQL_C_INTERVAL_MINUTE";
+ case SQL_C_INTERVAL_SECOND:
+ return "SQL_C_INTERVAL_SECOND";
+ case SQL_C_INTERVAL_DAY_TO_HOUR:
+ return "SQL_C_INTERVAL_DAY_TO_HOUR";
+ case SQL_C_INTERVAL_DAY_TO_MINUTE:
+ return "SQL_C_INTERVAL_DAY_TO_MINUTE";
+ case SQL_C_INTERVAL_DAY_TO_SECOND:
+ return "SQL_C_INTERVAL_DAY_TO_SECOND";
+ case SQL_C_INTERVAL_HOUR_TO_MINUTE:
+ return "SQL_C_INTERVAL_HOUR_TO_MINUTE";
+ case SQL_C_INTERVAL_HOUR_TO_SECOND:
+ return "SQL_C_INTERVAL_HOUR_TO_SECOND";
+ case SQL_C_INTERVAL_MINUTE_TO_SECOND:
+ return "SQL_C_INTERVAL_MINUTE_TO_SECOND";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getConciseTypeStringSQL( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_CHAR:
+ return "SQL_CHAR";
+ case SQL_VARCHAR:
+ return "SQL_VARCHAR";
+ case SQL_LONGVARCHAR:
+ return "SQL_LONGVARCHAR";
+ case SQL_WCHAR:
+ return "SQL_WCHAR";
+ case SQL_WVARCHAR:
+ return "SQL_WVARCHAR";
+ case SQL_WLONGVARCHAR:
+ return "SQL_WLONGVARCHAR";
+ case SQL_DECIMAL:
+ return "SQL_DECIMAL";
+ case SQL_NUMERIC:
+ return "SQL_NUMERIC";
+ case SQL_SMALLINT:
+ return "SQL_SMALLINT";
+ case SQL_INTEGER:
+ return "SQL_INTEGER";
+ case SQL_REAL:
+ return "SQL_REAL";
+ case SQL_FLOAT:
+ return "SQL_FLOAT";
+ case SQL_DOUBLE:
+ return "SQL_DOUBLE";
+ case SQL_BIT:
+ return "SQL_BIT";
+ case SQL_TINYINT:
+ return "SQL_TINYINT";
+ case SQL_BIGINT:
+ return "SQL_BIGINT";
+ case SQL_BINARY:
+ return "SQL_BINARY";
+ case SQL_VARBINARY:
+ return "SQL_VARBINARY";
+ case SQL_LONGVARBINARY:
+ return "SQL_LONGVARBINARY";
+ case SQL_TYPE_DATE:
+ return "SQL_TYPE_DATE";
+ case SQL_TYPE_TIME:
+ return "SQL_TYPE_TIME";
+ case SQL_TYPE_TIMESTAMP:
+ return "SQL_TYPE_TIMESTAMP";
+ case SQL_INTERVAL_MONTH:
+ return "SQL_INTERVAL_MONTH";
+ case SQL_INTERVAL_YEAR:
+ return "SQL_INTERVAL_YEAR";
+ case SQL_INTERVAL_YEAR_TO_MONTH:
+ return "SQL_INTERVAL_YEAR_TO_MONTH";
+ case SQL_INTERVAL_DAY:
+ return "SQL_INTERVAL_DAY";
+ case SQL_INTERVAL_HOUR:
+ return "SQL_INTERVAL_HOUR";
+ case SQL_INTERVAL_MINUTE:
+ return "SQL_INTERVAL_MINUTE";
+ case SQL_INTERVAL_SECOND:
+ return "SQL_INTERVAL_SECOND";
+ case SQL_INTERVAL_DAY_TO_HOUR:
+ return "SQL_INTERVAL_DAY_TO_HOUR";
+ case SQL_INTERVAL_DAY_TO_MINUTE:
+ return "SQL_INTERVAL_DAY_TO_MINUTE";
+ case SQL_INTERVAL_DAY_TO_SECOND:
+ return "SQL_INTERVAL_DAY_TO_SECOND";
+ case SQL_INTERVAL_HOUR_TO_MINUTE:
+ return "SQL_INTERVAL_HOUR_TO_MINUTE";
+ case SQL_INTERVAL_HOUR_TO_SECOND:
+ return "SQL_INTERVAL_HOUR_TO_SECOND";
+ case SQL_INTERVAL_MINUTE_TO_SECOND:
+ return "SQL_INTERVAL_MINUTE_TO_SECOND";
+ case SQL_GUID:
+ return "SQL_GUID";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getIntervalConciseTypeStringC( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_C_INTERVAL_MONTH:
+ return "SQL_C_INTERVAL_MONTH";
+ case SQL_C_INTERVAL_YEAR:
+ return "SQL_C_INTERVAL_YEAR";
+ case SQL_C_INTERVAL_YEAR_TO_MONTH:
+ return "SQL_C_INTERVAL_YEAR_TO_MONTH";
+ case SQL_C_INTERVAL_DAY:
+ return "SQL_C_INTERVAL_DAY";
+ case SQL_C_INTERVAL_HOUR:
+ return "SQL_C_INTERVAL_HOUR";
+ case SQL_C_INTERVAL_MINUTE:
+ return "SQL_C_INTERVAL_MINUTE";
+ case SQL_C_INTERVAL_SECOND:
+ return "SQL_C_INTERVAL_SECOND";
+ case SQL_C_INTERVAL_DAY_TO_HOUR:
+ return "SQL_C_INTERVAL_DAY_TO_HOUR";
+ case SQL_C_INTERVAL_DAY_TO_MINUTE:
+ return "SQL_C_INTERVAL_DAY_TO_MINUTE";
+ case SQL_C_INTERVAL_DAY_TO_SECOND:
+ return "SQL_C_INTERVAL_DAY_TO_SECOND";
+ case SQL_C_INTERVAL_HOUR_TO_MINUTE:
+ return "SQL_C_INTERVAL_HOUR_TO_MINUTE";
+ case SQL_C_INTERVAL_HOUR_TO_SECOND:
+ return "SQL_C_INTERVAL_HOUR_TO_SECOND";
+ case SQL_C_INTERVAL_MINUTE_TO_SECOND:
+ return "SQL_C_INTERVAL_MINUTE_TO_SECOND";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getIntervalConciseTypeStringSQL( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_INTERVAL_MONTH:
+ return "SQL_INTERVAL_MONTH";
+ case SQL_INTERVAL_YEAR:
+ return "SQL_INTERVAL_YEAR";
+ case SQL_INTERVAL_YEAR_TO_MONTH:
+ return "SQL_INTERVAL_YEAR_TO_MONTH";
+ case SQL_INTERVAL_DAY:
+ return "SQL_INTERVAL_DAY";
+ case SQL_INTERVAL_HOUR:
+ return "SQL_INTERVAL_HOUR";
+ case SQL_INTERVAL_MINUTE:
+ return "SQL_INTERVAL_MINUTE";
+ case SQL_INTERVAL_SECOND:
+ return "SQL_INTERVAL_SECOND";
+ case SQL_INTERVAL_DAY_TO_HOUR:
+ return "SQL_INTERVAL_DAY_TO_HOUR";
+ case SQL_INTERVAL_DAY_TO_MINUTE:
+ return "SQL_INTERVAL_DAY_TO_MINUTE";
+ case SQL_INTERVAL_DAY_TO_SECOND:
+ return "SQL_INTERVAL_DAY_TO_SECOND";
+ case SQL_INTERVAL_HOUR_TO_MINUTE:
+ return "SQL_INTERVAL_HOUR_TO_MINUTE";
+ case SQL_INTERVAL_HOUR_TO_SECOND:
+ return "SQL_INTERVAL_HOUR_TO_SECOND";
+ case SQL_INTERVAL_MINUTE_TO_SECOND:
+ return "SQL_INTERVAL_MINUTE_TO_SECOND";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getDateTimeCodeString( SQLSMALLINT nCode )
+{
+ switch ( nCode )
+ {
+ case SQL_CODE_DATE:
+ return "SQL_CODE_DATE";
+ case SQL_CODE_TIME:
+ return "SQL_CODE_TIME";
+ case SQL_CODE_TIMESTAMP:
+ return "SQL_CODE_TIMESTAMP";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getIntervalCodeString( SQLSMALLINT nCode )
+{
+ switch ( nCode )
+ {
+ case SQL_CODE_YEAR:
+ return "SQL_CODE_YEAR";
+ case SQL_CODE_MONTH:
+ return "SQL_CODE_MONTH";
+ case SQL_CODE_DAY:
+ return "SQL_CODE_DAY";
+ case SQL_CODE_HOUR:
+ return "SQL_CODE_HOUR";
+ case SQL_CODE_MINUTE:
+ return "SQL_CODE_MINUTE";
+ case SQL_CODE_SECOND:
+ return "SQL_CODE_SECOND";
+ case SQL_CODE_YEAR_TO_MONTH:
+ return "SQL_CODE_YEAR_TO_MONTH";
+ case SQL_CODE_DAY_TO_HOUR:
+ return "SQL_CODE_DAY_TO_HOUR";
+ case SQL_CODE_DAY_TO_MINUTE:
+ return "SQL_CODE_DAY_TO_MINUTE";
+ case SQL_CODE_DAY_TO_SECOND:
+ return "SQL_CODE_DAY_TO_SECOND";
+ case SQL_CODE_HOUR_TO_MINUTE:
+ return "SQL_CODE_HOUR_TO_MINUTE";
+ case SQL_CODE_HOUR_TO_SECOND:
+ return "SQL_CODE_HOUR_TO_SECOND";
+ case SQL_CODE_MINUTE_TO_SECOND:
+ return "SQL_CODE_MINUTE_TO_SECOND";
+ }
+
+ return "unknown";
+}
+
+QString MYODBCC::getInstallerErrorString( RETCODE nRetCode )
+{
+ switch ( nRetCode )
+ {
+ case ODBC_ERROR_GENERAL_ERR:
+ return "ODBC_ERROR_GENERAL_ERR";
+ case ODBC_ERROR_INVALID_BUFF_LEN:
+ return "ODBC_ERROR_INVALID_BUFF_LEN";
+ case ODBC_ERROR_INVALID_HWND:
+ return "ODBC_ERROR_INVALID_HWND";
+ case ODBC_ERROR_INVALID_STR:
+ return "ODBC_ERROR_INVALID_STR";
+ case ODBC_ERROR_INVALID_REQUEST_TYPE:
+ return "ODBC_ERROR_INVALID_REQUEST_TYPE";
+ case ODBC_ERROR_COMPONENT_NOT_FOUND:
+ return "ODBC_ERROR_COMPONENT_NOT_FOUND";
+ case ODBC_ERROR_INVALID_NAME:
+ return "ODBC_ERROR_INVALID_NAME";
+ case ODBC_ERROR_INVALID_KEYWORD_VALUE:
+ return "ODBC_ERROR_INVALID_KEYWORD_VALUE";
+ case ODBC_ERROR_INVALID_DSN:
+ return "ODBC_ERROR_INVALID_DSN";
+ case ODBC_ERROR_INVALID_INF:
+ return "ODBC_ERROR_INVALID_INF";
+ case ODBC_ERROR_REQUEST_FAILED:
+ return "ODBC_ERROR_REQUEST_FAILED";
+ case ODBC_ERROR_INVALID_PATH:
+ return "ODBC_ERROR_INVALID_PATH";
+ case ODBC_ERROR_LOAD_LIB_FAILED:
+ return "ODBC_ERROR_LOAD_LIB_FAILED";
+ case ODBC_ERROR_INVALID_PARAM_SEQUENCE:
+ return "ODBC_ERROR_INVALID_PARAM_SEQUENCE";
+ case ODBC_ERROR_INVALID_LOG_FILE:
+ return "ODBC_ERROR_INVALID_LOG_FILE";
+ case ODBC_ERROR_USER_CANCELED:
+ return "ODBC_ERROR_USER_CANCELED";
+ case ODBC_ERROR_USAGE_UPDATE_FAILED:
+ return "ODBC_ERROR_USAGE_UPDATE_FAILED";
+ case ODBC_ERROR_CREATE_DSN_FAILED:
+ return "ODBC_ERROR_CREATE_DSN_FAILED";
+ case ODBC_ERROR_WRITING_SYSINFO_FAILED:
+ return "ODBC_ERROR_WRITING_SYSINFO_FAILED";
+ case ODBC_ERROR_REMOVE_DSN_FAILED:
+ return "ODBC_ERROR_REMOVE_DSN_FAILED";
+ case ODBC_ERROR_OUT_OF_MEM:
+ return "ODBC_ERROR_OUT_OF_MEM";
+ case ODBC_ERROR_OUTPUT_STRING_TRUNCATED:
+ return "ODBC_ERROR_OUTPUT_STRING_TRUNCATED";
+ }
+
+ return "unknown";
+}
+
+void *MYODBCC::doMemCpy( void *pDest, const void *pSrc, size_t nBytes )
+{
+ return memcpy( pDest, pSrc, nBytes );
+}
+
+errno_t MYODBCC::doStrNCpy( SQLWCHAR *pszDest, size_t nMaxChars, const SQLWCHAR *pszSrc,
size_t nChars )
+{
+ return wcsncpy_s( pszDest, nMaxChars, pszSrc, nChars );
+}
+
+void MYODBCC::doFree( void *p )
+{
+ if ( p )
+ free( p );
+}
+
+bool MYODBCC::isConnectAttr( SQLINTEGER nAttribute )
+{
+ switch ( nAttribute )
+ {
+ case SQL_ATTR_ACCESS_MODE:
+ case SQL_ATTR_ASYNC_ENABLE:
+ case SQL_ATTR_AUTO_IPD:
+ case SQL_ATTR_AUTOCOMMIT:
+ case SQL_ATTR_CONNECTION_DEAD:
+ case SQL_ATTR_CONNECTION_TIMEOUT:
+ case SQL_ATTR_CURRENT_CATALOG:
+ case SQL_ATTR_LOGIN_TIMEOUT:
+ case SQL_ATTR_METADATA_ID:
+ case SQL_ATTR_ODBC_CURSORS:
+ case SQL_ATTR_PACKET_SIZE:
+ case SQL_ATTR_QUIET_MODE:
+ case SQL_ATTR_TRACE:
+ case SQL_ATTR_TRACEFILE:
+ case SQL_ATTR_TRANSLATE_LIB:
+ case SQL_ATTR_TRANSLATE_OPTION:
+ case SQL_ATTR_TXN_ISOLATION:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isConnectOption( SQLUSMALLINT nOption )
+{
+ switch ( nOption )
+ {
+ case SQL_ACCESS_MODE:
+ case SQL_AUTOCOMMIT:
+ case SQL_CURRENT_QUALIFIER:
+ case SQL_LOGIN_TIMEOUT:
+ case SQL_ODBC_CURSORS:
+ case SQL_OPT_TRACE:
+ case SQL_OPT_TRACEFILE:
+ case SQL_PACKET_SIZE:
+ case SQL_QUIET_MODE:
+ case SQL_TRANSLATE_DLL:
+ case SQL_TRANSLATE_OPTION:
+ case SQL_TXN_ISOLATION:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isDiagField( SQLSMALLINT nDiagField )
+{
+ switch ( nDiagField )
+ {
+ case SQL_DIAG_CURSOR_ROW_COUNT:
+ case SQL_DIAG_DYNAMIC_FUNCTION:
+ case SQL_DIAG_DYNAMIC_FUNCTION_CODE:
+ case SQL_DIAG_NUMBER:
+ case SQL_DIAG_RETURNCODE:
+ case SQL_DIAG_ROW_COUNT:
+ case SQL_DIAG_CLASS_ORIGIN:
+ case SQL_DIAG_COLUMN_NUMBER:
+ case SQL_DIAG_CONNECTION_NAME:
+ case SQL_DIAG_MESSAGE_TEXT:
+ case SQL_DIAG_NATIVE:
+ case SQL_DIAG_ROW_NUMBER:
+ case SQL_DIAG_SERVER_NAME:
+ case SQL_DIAG_SQLSTATE:
+ case SQL_DIAG_SUBCLASS_ORIGIN:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isEnvAttr( SQLINTEGER nAttribute )
+{
+ switch ( nAttribute )
+ {
+ case SQL_ATTR_CONNECTION_POOLING:
+ case SQL_ATTR_CP_MATCH:
+ case SQL_ATTR_ODBC_VERSION:
+ case SQL_ATTR_OUTPUT_NTS:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isFunctions( SQLUSMALLINT nFunction )
+{
+ switch ( nFunction )
+ {
+ case SQL_API_ALL_FUNCTIONS:
+ case SQL_API_SQLALLOCCONNECT:
+ case SQL_API_SQLALLOCENV:
+ case SQL_API_SQLALLOCHANDLE:
+ case SQL_API_SQLALLOCSTMT:
+ case SQL_API_SQLBINDCOL:
+ case SQL_API_SQLCANCEL:
+ case SQL_API_SQLCLOSECURSOR:
+/* Same value as SQL_API_SQLCOLATTRIBUTES...
+ case SQL_API_SQLCOLATTRIBUTE:
+ return "SQL_API_SQLCOLATTRIBUTE";
+*/
+ case SQL_API_SQLCOLUMNS:
+ case SQL_API_SQLCONNECT:
+ case SQL_API_SQLCOPYDESC:
+ case SQL_API_SQLDATASOURCES:
+ case SQL_API_SQLDESCRIBECOL:
+ case SQL_API_SQLDISCONNECT:
+ case SQL_API_SQLENDTRAN:
+ case SQL_API_SQLERROR:
+ case SQL_API_SQLEXECDIRECT:
+ case SQL_API_SQLEXECUTE:
+ case SQL_API_SQLFETCH:
+ case SQL_API_SQLFETCHSCROLL:
+ case SQL_API_SQLFREECONNECT:
+ case SQL_API_SQLFREEENV:
+ case SQL_API_SQLFREEHANDLE:
+ case SQL_API_SQLFREESTMT:
+ case SQL_API_SQLGETCONNECTATTR:
+ case SQL_API_SQLGETCONNECTOPTION:
+ case SQL_API_SQLGETCURSORNAME:
+ case SQL_API_SQLGETDATA:
+ case SQL_API_SQLGETDESCFIELD:
+ case SQL_API_SQLGETDESCREC:
+ case SQL_API_SQLGETDIAGFIELD:
+ case SQL_API_SQLGETDIAGREC:
+ case SQL_API_SQLGETENVATTR:
+ case SQL_API_SQLGETFUNCTIONS:
+ case SQL_API_SQLGETINFO:
+ case SQL_API_SQLGETSTMTATTR:
+ case SQL_API_SQLGETSTMTOPTION:
+ case SQL_API_SQLGETTYPEINFO:
+ case SQL_API_SQLNUMRESULTCOLS:
+ case SQL_API_SQLPARAMDATA:
+ case SQL_API_SQLPREPARE:
+ case SQL_API_SQLPUTDATA:
+ case SQL_API_SQLROWCOUNT:
+ case SQL_API_SQLSETCONNECTATTR:
+ case SQL_API_SQLSETCONNECTOPTION:
+ case SQL_API_SQLSETCURSORNAME:
+ case SQL_API_SQLSETDESCFIELD:
+ case SQL_API_SQLSETDESCREC:
+ case SQL_API_SQLSETENVATTR:
+ case SQL_API_SQLSETSTMTATTR:
+ case SQL_API_SQLSETSTMTOPTION:
+ case SQL_API_SQLSPECIALCOLUMNS:
+ case SQL_API_SQLSTATISTICS:
+ case SQL_API_SQLTABLES:
+ case SQL_API_SQLTRANSACT:
+ case SQL_API_SQLBULKOPERATIONS:
+ case SQL_API_SQLBINDPARAMETER:
+ case SQL_API_SQLBROWSECONNECT:
+ case SQL_API_SQLCOLATTRIBUTES:
+ case SQL_API_SQLCOLUMNPRIVILEGES :
+ case SQL_API_SQLDESCRIBEPARAM:
+ case SQL_API_SQLDRIVERCONNECT:
+ case SQL_API_SQLDRIVERS:
+ case SQL_API_SQLEXTENDEDFETCH:
+ case SQL_API_SQLFOREIGNKEYS:
+ case SQL_API_SQLMORERESULTS:
+ case SQL_API_SQLNATIVESQL:
+ case SQL_API_SQLNUMPARAMS:
+ case SQL_API_SQLPARAMOPTIONS:
+ case SQL_API_SQLPRIMARYKEYS:
+ case SQL_API_SQLPROCEDURECOLUMNS:
+ case SQL_API_SQLPROCEDURES:
+ case SQL_API_SQLSETPOS:
+ case SQL_API_SQLSETSCROLLOPTIONS:
+ case SQL_API_SQLTABLEPRIVILEGES:
+ case SQL_API_ODBC3_ALL_FUNCTIONS:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isHandleType( SQLSMALLINT nHandleType )
+{
+ switch ( nHandleType )
+ {
+ case SQL_HANDLE_ENV:
+ case SQL_HANDLE_DBC:
+ case SQL_HANDLE_STMT:
+ case SQL_HANDLE_DESC:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isInfoType( SQLUSMALLINT nInfoType )
+{
+ switch ( nInfoType )
+ {
+ case SQL_ACCESSIBLE_PROCEDURES:
+ case SQL_ACCESSIBLE_TABLES:
+ case SQL_ACTIVE_ENVIRONMENTS:
+ case SQL_AGGREGATE_FUNCTIONS:
+ case SQL_ALTER_DOMAIN:
+ case SQL_ALTER_TABLE:
+ case SQL_ASYNC_MODE:
+ case SQL_BATCH_ROW_COUNT:
+ case SQL_BATCH_SUPPORT:
+ case SQL_BOOKMARK_PERSISTENCE:
+ case SQL_CATALOG_LOCATION:
+ case SQL_CATALOG_NAME:
+ case SQL_CATALOG_NAME_SEPARATOR:
+ case SQL_CATALOG_TERM:
+ case SQL_CATALOG_USAGE:
+ case SQL_COLLATION_SEQ:
+ case SQL_COLUMN_ALIAS:
+ case SQL_CONCAT_NULL_BEHAVIOR:
+ case SQL_CONVERT_BIGINT:
+ case SQL_CONVERT_BINARY:
+ case SQL_CONVERT_BIT:
+ case SQL_CONVERT_CHAR:
+#ifdef SQL_CONVERT_GUID
+ case SQL_CONVERT_GUID:
+#endif
+ case SQL_CONVERT_DATE:
+ case SQL_CONVERT_DECIMAL:
+ case SQL_CONVERT_DOUBLE:
+ case SQL_CONVERT_FLOAT:
+ case SQL_CONVERT_INTEGER:
+ case SQL_CONVERT_INTERVAL_YEAR_MONTH:
+ case SQL_CONVERT_INTERVAL_DAY_TIME:
+ case SQL_CONVERT_LONGVARBINARY:
+ case SQL_CONVERT_LONGVARCHAR:
+ case SQL_CONVERT_NUMERIC:
+ case SQL_CONVERT_REAL:
+ case SQL_CONVERT_SMALLINT:
+ case SQL_CONVERT_TIME:
+ case SQL_CONVERT_TIMESTAMP:
+ case SQL_CONVERT_TINYINT:
+ case SQL_CONVERT_VARBINARY:
+ case SQL_CONVERT_VARCHAR:
+ case SQL_CONVERT_FUNCTIONS:
+ case SQL_CORRELATION_NAME:
+ case SQL_CREATE_ASSERTION:
+ case SQL_CREATE_CHARACTER_SET:
+ case SQL_CREATE_COLLATION:
+ case SQL_CREATE_DOMAIN:
+ case SQL_CREATE_SCHEMA:
+ case SQL_CREATE_TABLE:
+ case SQL_CREATE_TRANSLATION:
+ case SQL_CREATE_VIEW:
+ case SQL_CURSOR_COMMIT_BEHAVIOR:
+ case SQL_CURSOR_ROLLBACK_BEHAVIOR:
+ case SQL_CURSOR_SENSITIVITY:
+ case SQL_DATA_SOURCE_NAME:
+ case SQL_DATA_SOURCE_READ_ONLY:
+ case SQL_DATABASE_NAME:
+ case SQL_DATETIME_LITERALS:
+ case SQL_DBMS_NAME:
+ case SQL_DBMS_VER:
+ case SQL_DDL_INDEX:
+ case SQL_DEFAULT_TXN_ISOLATION:
+ case SQL_DESCRIBE_PARAMETER:
+ case SQL_DM_VER:
+ case SQL_DRIVER_HDBC:
+ case SQL_DRIVER_HENV:
+ case SQL_DRIVER_HDESC:
+ case SQL_DRIVER_HLIB:
+ case SQL_DRIVER_HSTMT:
+ case SQL_DRIVER_NAME:
+ case SQL_DRIVER_ODBC_VER:
+ case SQL_DRIVER_VER:
+ case SQL_DROP_ASSERTION:
+ case SQL_DROP_CHARACTER_SET:
+ case SQL_DROP_COLLATION:
+ case SQL_DROP_DOMAIN:
+ case SQL_DROP_SCHEMA:
+ case SQL_DROP_TABLE:
+ case SQL_DROP_TRANSLATION:
+ case SQL_DROP_VIEW:
+ case SQL_DYNAMIC_CURSOR_ATTRIBUTES1:
+ case SQL_DYNAMIC_CURSOR_ATTRIBUTES2:
+ case SQL_EXPRESSIONS_IN_ORDERBY:
+ case SQL_FILE_USAGE:
+ case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1:
+ case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2:
+ case SQL_GETDATA_EXTENSIONS:
+ case SQL_GROUP_BY:
+ case SQL_IDENTIFIER_CASE:
+ case SQL_IDENTIFIER_QUOTE_CHAR:
+ case SQL_INDEX_KEYWORDS:
+ case SQL_INFO_SCHEMA_VIEWS:
+ case SQL_INSERT_STATEMENT:
+ case SQL_INTEGRITY:
+ case SQL_KEYSET_CURSOR_ATTRIBUTES1:
+ case SQL_KEYSET_CURSOR_ATTRIBUTES2:
+ case SQL_KEYWORDS:
+ case SQL_LIKE_ESCAPE_CLAUSE:
+ case SQL_MAX_ASYNC_CONCURRENT_STATEMENTS:
+ case SQL_MAX_BINARY_LITERAL_LEN:
+ case SQL_MAX_CATALOG_NAME_LEN:
+ case SQL_MAX_CHAR_LITERAL_LEN:
+ case SQL_MAX_COLUMN_NAME_LEN:
+ case SQL_MAX_COLUMNS_IN_GROUP_BY:
+ case SQL_MAX_COLUMNS_IN_INDEX:
+ case SQL_MAX_COLUMNS_IN_ORDER_BY:
+ case SQL_MAX_COLUMNS_IN_SELECT:
+ case SQL_MAX_COLUMNS_IN_TABLE:
+ case SQL_MAX_CONCURRENT_ACTIVITIES:
+ case SQL_MAX_CURSOR_NAME_LEN:
+ case SQL_MAX_DRIVER_CONNECTIONS:
+ case SQL_MAX_IDENTIFIER_LEN:
+ case SQL_MAX_INDEX_SIZE:
+ case SQL_MAX_PROCEDURE_NAME_LEN:
+ case SQL_MAX_ROW_SIZE:
+ case SQL_MAX_ROW_SIZE_INCLUDES_LONG:
+ case SQL_MAX_SCHEMA_NAME_LEN:
+ case SQL_MAX_STATEMENT_LEN:
+ case SQL_MAX_TABLE_NAME_LEN:
+ case SQL_MAX_TABLES_IN_SELECT:
+ case SQL_MAX_USER_NAME_LEN:
+ case SQL_MULT_RESULT_SETS:
+ case SQL_MULTIPLE_ACTIVE_TXN:
+ case SQL_NEED_LONG_DATA_LEN:
+ case SQL_NON_NULLABLE_COLUMNS:
+ case SQL_NULL_COLLATION:
+ case SQL_NUMERIC_FUNCTIONS:
+ case SQL_ODBC_API_CONFORMANCE:
+ case SQL_ODBC_INTERFACE_CONFORMANCE:
+ case SQL_ODBC_VER:
+ case SQL_OJ_CAPABILITIES:
+ case SQL_ORDER_BY_COLUMNS_IN_SELECT:
+ case SQL_PARAM_ARRAY_ROW_COUNTS:
+ case SQL_PARAM_ARRAY_SELECTS:
+ case SQL_PROCEDURE_TERM:
+ case SQL_PROCEDURES:
+ case SQL_POS_OPERATIONS:
+ case SQL_QUOTED_IDENTIFIER_CASE:
+ case SQL_ROW_UPDATES:
+ case SQL_SCHEMA_TERM:
+ case SQL_SCHEMA_USAGE:
+ case SQL_SCROLL_OPTIONS:
+ case SQL_SEARCH_PATTERN_ESCAPE:
+ case SQL_SERVER_NAME:
+ case SQL_SPECIAL_CHARACTERS:
+ case SQL_SQL_CONFORMANCE:
+ case SQL_SQL92_DATETIME_FUNCTIONS:
+ case SQL_SQL92_FOREIGN_KEY_DELETE_RULE:
+ case SQL_SQL92_FOREIGN_KEY_UPDATE_RULE:
+ case SQL_SQL92_GRANT:
+ case SQL_SQL92_NUMERIC_VALUE_FUNCTIONS:
+ case SQL_SQL92_PREDICATES:
+ case SQL_SQL92_RELATIONAL_JOIN_OPERATORS:
+ case SQL_SQL92_REVOKE:
+ case SQL_SQL92_ROW_VALUE_CONSTRUCTOR:
+ case SQL_SQL92_STRING_FUNCTIONS:
+ case SQL_SQL92_VALUE_EXPRESSIONS:
+ case SQL_STANDARD_CLI_CONFORMANCE:
+ case SQL_STATIC_CURSOR_ATTRIBUTES1:
+ case SQL_STATIC_CURSOR_ATTRIBUTES2:
+ case SQL_STRING_FUNCTIONS:
+ case SQL_SUBQUERIES:
+ case SQL_SYSTEM_FUNCTIONS:
+ case SQL_TABLE_TERM:
+ case SQL_TIMEDATE_ADD_INTERVALS:
+ case SQL_TIMEDATE_DIFF_INTERVALS:
+ case SQL_TIMEDATE_FUNCTIONS:
+ case SQL_TXN_CAPABLE:
+ case SQL_TXN_ISOLATION_OPTION:
+ case SQL_UNION:
+ case SQL_USER_NAME:
+ case SQL_XOPEN_CLI_YEAR:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isReturn( SQLRETURN nReturn )
+{
+ switch ( nReturn )
+ {
+ case SQL_SUCCESS:
+ case SQL_SUCCESS_WITH_INFO:
+#if (ODBCVER >= 0x0300)
+ case SQL_NO_DATA:
+#endif
+ case SQL_ERROR:
+ case SQL_INVALID_HANDLE:
+ case SQL_STILL_EXECUTING:
+ case SQL_NEED_DATA:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isStmtAttr( SQLINTEGER nAttribute )
+{
+ switch ( nAttribute )
+ {
+ case SQL_ATTR_APP_PARAM_DESC:
+ case SQL_ATTR_APP_ROW_DESC:
+ case SQL_ATTR_ASYNC_ENABLE:
+ case SQL_ATTR_CONCURRENCY:
+ case SQL_ATTR_CURSOR_SCROLLABLE:
+ case SQL_ATTR_CURSOR_SENSITIVITY:
+ case SQL_ATTR_CURSOR_TYPE:
+ case SQL_ATTR_ENABLE_AUTO_IPD:
+ case SQL_ATTR_FETCH_BOOKMARK_PTR:
+ case SQL_ATTR_IMP_PARAM_DESC:
+ case SQL_ATTR_IMP_ROW_DESC:
+ case SQL_ATTR_KEYSET_SIZE:
+ case SQL_ATTR_MAX_LENGTH:
+ case SQL_ATTR_MAX_ROWS:
+ case SQL_ATTR_METADATA_ID:
+ case SQL_ATTR_NOSCAN:
+ case SQL_ATTR_PARAM_BIND_OFFSET_PTR:
+ case SQL_ATTR_PARAM_BIND_TYPE:
+ case SQL_ATTR_PARAM_OPERATION_PTR:
+ case SQL_ATTR_PARAM_STATUS_PTR:
+ case SQL_ATTR_PARAMS_PROCESSED_PTR:
+ case SQL_ATTR_PARAMSET_SIZE:
+ case SQL_ATTR_QUERY_TIMEOUT:
+ case SQL_ATTR_RETRIEVE_DATA:
+ case SQL_ATTR_ROW_ARRAY_SIZE:
+ case SQL_ATTR_ROW_BIND_OFFSET_PTR:
+ case SQL_ATTR_ROW_BIND_TYPE:
+ case SQL_ATTR_ROW_NUMBER:
+ case SQL_ATTR_ROW_OPERATION_PTR:
+ case SQL_ATTR_ROW_STATUS_PTR:
+ case SQL_ATTR_ROWS_FETCHED_PTR:
+ case SQL_ATTR_SIMULATE_CURSOR:
+ case SQL_ATTR_USE_BOOKMARKS:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isStmtOption( SQLUSMALLINT nOption )
+{
+ switch ( nOption )
+ {
+ case SQL_ASYNC_ENABLE:
+ case SQL_BIND_TYPE:
+ case SQL_CONCURRENCY:
+ case SQL_CURSOR_TYPE:
+ case SQL_GET_BOOKMARK:
+ case SQL_KEYSET_SIZE:
+ case SQL_MAX_LENGTH:
+ case SQL_MAX_ROWS:
+ case SQL_NOSCAN:
+ case SQL_QUERY_TIMEOUT:
+ case SQL_RETRIEVE_DATA:
+ case SQL_ROWSET_SIZE:
+ case SQL_ROW_NUMBER:
+ case SQL_SIMULATE_CURSOR:
+ case SQL_USE_BOOKMARKS:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isTypeC( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_C_CHAR: /* 1 */
+ case SQL_C_SSHORT: /* 5 + -20 = -15 */
+ case SQL_C_USHORT: /* 5 + -22 = -17 */
+ case SQL_C_SLONG: /* 4 + -20 = -16 */
+ case SQL_C_ULONG: /* 4 + -22 = -18 */
+ case SQL_C_FLOAT: /* 7 */
+ case SQL_C_DOUBLE: /* 8 */
+ case SQL_C_BIT: /* -7 */
+ case SQL_C_STINYINT: /* -6 + -20 = -26 */
+ case SQL_C_UTINYINT: /* -6 + -22 = -28 */
+ case SQL_C_SBIGINT: /* -5 + -20 = -25 */
+ case SQL_C_UBIGINT: /* -5 + -22 = -27 */
+ case SQL_C_BINARY: /* -2 */
+ /* case SQL_C_VARBOOKMARK: */ /* SQL_C_BINARY */
+ case SQL_C_NUMERIC: /* 2 */
+ case SQL_C_GUID: /* -11 */
+ case SQL_C_DEFAULT: /* 99 */
+ case SQL_DATETIME: /* 9 */
+ case SQL_INTERVAL: /* 10 */
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isTypeSQL( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_CHAR:
+ case SQL_VARCHAR:
+ case SQL_LONGVARCHAR:
+ case SQL_WCHAR:
+ case SQL_WVARCHAR:
+ case SQL_WLONGVARCHAR:
+ case SQL_DECIMAL:
+ case SQL_NUMERIC:
+ case SQL_SMALLINT:
+ case SQL_INTEGER:
+ case SQL_REAL:
+ case SQL_FLOAT:
+ case SQL_DOUBLE:
+ case SQL_BIT:
+ case SQL_TINYINT:
+ case SQL_BIGINT:
+ case SQL_BINARY:
+ case SQL_VARBINARY:
+ case SQL_LONGVARBINARY:
+ case SQL_DATETIME:
+ case SQL_INTERVAL:
+ case SQL_GUID:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isConciseTypeC( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_C_CHAR: /* 1 */
+ case SQL_C_SSHORT: /* 5 + -20 = -15 */
+ case SQL_C_USHORT: /* 5 + -22 = -17 */
+ case SQL_C_SLONG: /* 4 + -20 = -16 */
+ case SQL_C_ULONG: /* 4 + -22 = -18 */
+ case SQL_C_FLOAT: /* 7 */
+ case SQL_C_DOUBLE: /* 8 */
+ case SQL_C_BIT: /* -7 */
+ case SQL_C_STINYINT: /* -6 + -20 = -26 */
+ case SQL_C_UTINYINT: /* -6 + -22 = -28 */
+ case SQL_C_SBIGINT: /* -5 + -20 = -25 */
+ case SQL_C_UBIGINT: /* -5 + -22 = -27 */
+ case SQL_C_BINARY: /* -2 */
+ /* case SQL_C_VARBOOKMARK: */ /* SQL_C_BINARY */
+ case SQL_C_TYPE_DATE: /* 91 */
+ case SQL_C_TYPE_TIME: /* 92 */
+ case SQL_C_TYPE_TIMESTAMP: /* 93 */
+ case SQL_C_NUMERIC: /* 2 */
+ case SQL_C_GUID: /* -11 */
+ case SQL_C_DEFAULT: /* 99 */
+ case SQL_C_INTERVAL_MONTH: /* 102 */
+ case SQL_C_INTERVAL_YEAR: /* 101 */
+ case SQL_C_INTERVAL_YEAR_TO_MONTH: /* 107 */
+ case SQL_C_INTERVAL_DAY: /* 103 */
+ case SQL_C_INTERVAL_HOUR: /* 104 */
+ case SQL_C_INTERVAL_MINUTE: /* 105 */
+ case SQL_C_INTERVAL_SECOND: /* 106 */
+ case SQL_C_INTERVAL_DAY_TO_HOUR: /* 108 */
+ case SQL_C_INTERVAL_DAY_TO_MINUTE: /* 109 */
+ case SQL_C_INTERVAL_DAY_TO_SECOND: /* 110 */
+ case SQL_C_INTERVAL_HOUR_TO_MINUTE: /* 111 */
+ case SQL_C_INTERVAL_HOUR_TO_SECOND: /* 112 */
+ case SQL_C_INTERVAL_MINUTE_TO_SECOND: /* 113 */
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isConciseTypeSQL( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_CHAR: /* 1 */
+ case SQL_VARCHAR: /* 12 */
+ case SQL_LONGVARCHAR: /* -1 */
+ case SQL_WCHAR: /* -8 */
+ case SQL_WVARCHAR: /* -9 */
+ case SQL_WLONGVARCHAR: /* -10 */
+ case SQL_DECIMAL: /* 3 */
+ case SQL_NUMERIC: /* 2 */
+ case SQL_SMALLINT: /* 5 */
+ case SQL_INTEGER: /* 4 */
+ case SQL_REAL: /* 7 */
+ case SQL_FLOAT: /* 6 */
+ case SQL_DOUBLE: /* 8 */
+ case SQL_BIT: /* -7 */
+ case SQL_TINYINT: /* -6 */
+ case SQL_BIGINT: /* -5 */
+ case SQL_BINARY: /* -2 */
+ case SQL_VARBINARY: /* -3 */
+ case SQL_LONGVARBINARY: /* -4 */
+ case SQL_TYPE_DATE: /* 91 */
+ case SQL_TYPE_TIME: /* 92 */
+ case SQL_TYPE_TIMESTAMP: /* 93 */
+ case SQL_INTERVAL_MONTH: /* 102 */
+ case SQL_INTERVAL_YEAR: /* 101 */
+ case SQL_INTERVAL_YEAR_TO_MONTH: /* 107 */
+ case SQL_INTERVAL_DAY: /* 103 */
+ case SQL_INTERVAL_HOUR: /* 104 */
+ case SQL_INTERVAL_MINUTE: /* 105 */
+ case SQL_INTERVAL_SECOND: /* 106 */
+ case SQL_INTERVAL_DAY_TO_HOUR: /* 108 */
+ case SQL_INTERVAL_DAY_TO_MINUTE: /* 109 */
+ case SQL_INTERVAL_DAY_TO_SECOND: /* 110 */
+ case SQL_INTERVAL_HOUR_TO_MINUTE: /* 111 */
+ case SQL_INTERVAL_HOUR_TO_SECOND: /* 112 */
+ case SQL_INTERVAL_MINUTE_TO_SECOND: /* 113 */
+ case SQL_GUID: /* -11 */
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isIntervalConciseTypeC( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_C_INTERVAL_MONTH: /* 102 */
+ case SQL_C_INTERVAL_YEAR: /* 101 */
+ case SQL_C_INTERVAL_YEAR_TO_MONTH: /* 107 */
+ case SQL_C_INTERVAL_DAY: /* 103 */
+ case SQL_C_INTERVAL_HOUR: /* 104 */
+ case SQL_C_INTERVAL_MINUTE: /* 105 */
+ case SQL_C_INTERVAL_SECOND: /* 106 */
+ case SQL_C_INTERVAL_DAY_TO_HOUR: /* 108 */
+ case SQL_C_INTERVAL_DAY_TO_MINUTE: /* 109 */
+ case SQL_C_INTERVAL_DAY_TO_SECOND: /* 110 */
+ case SQL_C_INTERVAL_HOUR_TO_MINUTE: /* 111 */
+ case SQL_C_INTERVAL_HOUR_TO_SECOND: /* 112 */
+ case SQL_C_INTERVAL_MINUTE_TO_SECOND: /* 113 */
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isIntervalConciseTypeSQL( SQLSMALLINT nType )
+{
+ switch ( nType )
+ {
+ case SQL_INTERVAL_MONTH: /* 102 */
+ case SQL_INTERVAL_YEAR: /* 101 */
+ case SQL_INTERVAL_YEAR_TO_MONTH: /* 107 */
+ case SQL_INTERVAL_DAY: /* 103 */
+ case SQL_INTERVAL_HOUR: /* 104 */
+ case SQL_INTERVAL_MINUTE: /* 105 */
+ case SQL_INTERVAL_SECOND: /* 106 */
+ case SQL_INTERVAL_DAY_TO_HOUR: /* 108 */
+ case SQL_INTERVAL_DAY_TO_MINUTE: /* 109 */
+ case SQL_INTERVAL_DAY_TO_SECOND: /* 110 */
+ case SQL_INTERVAL_HOUR_TO_MINUTE: /* 111 */
+ case SQL_INTERVAL_HOUR_TO_SECOND: /* 112 */
+ case SQL_INTERVAL_MINUTE_TO_SECOND: /* 113 */
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isDateTimeCode( SQLSMALLINT nCode )
+{
+ switch ( nCode )
+ {
+ case SQL_CODE_DATE:
+ case SQL_CODE_TIME:
+ case SQL_CODE_TIMESTAMP:
+ return true;
+ }
+
+ return false;
+}
+
+bool MYODBCC::isIntervalCode( SQLSMALLINT nCode )
+{
+ switch ( nCode )
+ {
+ case SQL_CODE_YEAR:
+ case SQL_CODE_MONTH:
+ case SQL_CODE_DAY:
+ case SQL_CODE_HOUR:
+ case SQL_CODE_MINUTE:
+ case SQL_CODE_SECOND:
+ case SQL_CODE_YEAR_TO_MONTH:
+ case SQL_CODE_DAY_TO_HOUR:
+ case SQL_CODE_DAY_TO_MINUTE:
+ case SQL_CODE_DAY_TO_SECOND:
+ case SQL_CODE_HOUR_TO_MINUTE:
+ case SQL_CODE_HOUR_TO_SECOND:
+ case SQL_CODE_MINUTE_TO_SECOND:
+ return true;
+ }
+
+ return false;
+}
+
Modified: MYODBCC/MYODBCCLib/MYODBCCLib.pro
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCLib.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCLib.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -14,7 +14,9 @@
include( ../../common.pri )
include( ../../config.pri )
include( ../../defines.pri )
+include( ../../odbc.pri )
CONFIG += staticlib
+CONFIG += console
# #########################################################
# UNIX
@@ -39,13 +41,5 @@
../include/MYODBCC.h \
MYODBCCInternal.h
SOURCES = \
- MYODBCCStrCaseCmp.c \
- MYODBCCStrCmpLiteral.c \
- MYODBCCStrCmpWild.c \
- MYODBCCStrCopyIn.c \
- MYODBCCStrCopyOut.c \
- MYODBCCStrCopyOut1.c \
- MYODBCCStrCopyOut2.c \
- MYODBCCStrDup.c \
- MYODBCCStrNCaseCmp.c
+ MYODBCC.cpp
Modified: MYODBCC/MYODBCCLib/MYODBCCLib.vpj
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCLib.vpj 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCLib.vpj 2006-02-13 17:22:45 UTC (rev 56)
@@ -53,15 +53,7 @@
<Folder
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="MYODBCCStrCaseCmp.c"/>
- <F N="MYODBCCStrCmpLiteral.c"/>
- <F N="MYODBCCStrCmpWild.c"/>
- <F N="MYODBCCStrCopyIn.c"/>
- <F N="MYODBCCStrCopyOut.c"/>
- <F N="MYODBCCStrCopyOut1.c"/>
- <F N="MYODBCCStrCopyOut2.c"/>
- <F N="MYODBCCStrDup.c"/>
- <F N="MYODBCCStrNCaseCmp.c"/>
+ <F N="MYODBCC.cpp"/>
</Folder>
<Folder
Name="Header Files"
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCaseCmp.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCaseCmp.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCaseCmp.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,62 +0,0 @@
-/*!
- \file MYODBCCStrCaseCmp.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-#ifndef _UNIX_
-
-int MYODBCCStrCaseCmp( const char *psz1,
- const char *psz2 )
-{
- int nChar = 0;
-
- while ( 1 )
- {
- if ( psz1[nChar] == '\0' || psz2[nChar] == '\0' )
- {
- if ( psz1[nChar] != '\0' )
- return (1);
- else if ( psz2[nChar] != '\0' )
- return (-1);
- return 0;
- }
- if ( toupper( psz1[nChar] ) != toupper( psz2[nChar] ) )
- {
- if ( toupper( psz1[nChar] ) < toupper( psz2[nChar] ) )
- return (-1);
- return 1;
- }
- nChar++;
- }
-
- return 0;
-}
-
-#endif
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCmpLiteral.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCmpLiteral.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCmpLiteral.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,60 +0,0 @@
-/*!
- \file MYODBCCStrCmpLiteral.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrCmpLiteral( SQLCHAR * pcLeft,
- SQLSMALLINT nLeftLen,
- SQLCHAR * pcRight,
- SQLSMALLINT nRightLen )
-{
- int nIndex = 0;
-
- /* handle null string pointers */
- if ( !pcLeft && !pcRight )
- return MYODBC_C_TRUE;
- if ( !pcLeft || !pcRight )
- return MYODBC_C_FALSE;
-
- while ( 1 )
- {
- /* handle end of string condition */
- if ( MYODBCCStrEnd( pcLeft, nLeftLen, nIndex ) && ( MYODBCCStrEnd(
pcRight, nRightLen, nIndex ) ) )
- return MYODBC_C_TRUE;
- else if ( MYODBCCStrEnd( pcLeft, nLeftLen, nIndex ) || MYODBCCStrEnd( pcRight,
nRightLen, nIndex ) )
- return MYODBC_C_FALSE;
- /* compare chars */
- else if ( toupper( pcLeft[nIndex] ) != toupper( pcRight[nIndex] ) )
- return MYODBC_C_FALSE;
- nIndex++;
- }
-
- return MYODBC_C_TRUE;
-}
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCmpWild.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCmpWild.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCmpWild.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,66 +0,0 @@
-/*!
- \file MYODBCCStrCmpWild.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrCmpWild( SQLCHAR * pcLeft,
- SQLSMALLINT nLeftLen,
- SQLCHAR * pcRight,
- SQLSMALLINT nRightLen )
-{
- int nIndex = 0;
-
- /* handle null string pointers */
- if ( !pcLeft && !pcRight )
- return MYODBC_C_TRUE;
- if ( !pcLeft || !pcRight )
- return MYODBC_C_FALSE;
-
- /* '%' means everything match so catch this and return quickly */
- if ( pcLeft[0] == '%' && (nLeftLen == SQL_NTS || nLeftLen == 1) )
- return MYODBC_C_TRUE;
-
- while ( 1 )
- {
- /* handle end of string condition */
- if ( MYODBCCStrEnd( pcLeft, nLeftLen, nIndex ) && ( MYODBCCStrEnd(
pcRight, nRightLen, nIndex ) ) )
- return MYODBC_C_TRUE;
- else if ( MYODBCCStrEnd( pcLeft, nLeftLen, nIndex ) || MYODBCCStrEnd( pcRight,
nRightLen, nIndex ) )
- return MYODBC_C_FALSE;
- /* compare chars */
- else if ( toupper( pcLeft[nIndex] ) <= toupper( pcRight[nIndex] ) )
- return MYODBC_C_FALSE;
- else if ( toupper( pcLeft[nIndex] ) >= toupper( pcRight[nIndex] ) )
- return MYODBC_C_FALSE;
- nIndex++;
- }
-
- return MYODBC_C_TRUE;
-}
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCopyIn.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCopyIn.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCopyIn.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,83 +0,0 @@
-/*!
- \file MYODBCCStrCopyIn.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrCopyIn( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pszSrc,
- SQLINTEGER nSrcLen )
-{
- SQLINTEGER nIndex = 0;
-
- /* sanity checks */
- if ( !pszDest )
- MYODBCCAssert( "!pszDest" );
- if ( nDestMax < 1 )
- MYODBCCAssert( "nDestMax < 1" );
- if ( nSrcLen < 0 && nSrcLen != SQL_NTS )
- MYODBCCAssert( "nSrcLen < 0 && nSrcLen != SQL_NTS" );
-
- if ( !pszSrc )
- {
- *pszDest = '\0';
- return MYODBC_C_TRUE; /* ok - but nothing to copy */
- }
-
- if ( nSrcLen == 0 )
- {
- *pszDest = '\0';
- if ( *pszSrc )
- return MYODBC_C_FALSE; /* truncated */
- return MYODBC_C_TRUE; /* ok - but nothing to copy */
- }
-
- /* pszSrc is null terminated so only rely on null term and nDestMax to stop copy */
- if ( nSrcLen == SQL_NTS )
- nSrcLen = nDestMax + 1;
-
- /* copy chars while room in pszDest and until end of pszSrc */
- for ( nIndex = 0; (nIndex < nDestMax) && (nIndex < nSrcLen); nIndex++ )
- {
- pszDest[nIndex] = pszSrc[nIndex];
- if ( pszSrc[nIndex] == '\0' ) /* we _always_ stop copy when we hit null */
- return MYODBC_C_TRUE;
- }
-
- /* pszDest full - ensure last char is null terminator */
- if ( nIndex >= nDestMax )
- pszDest[(nDestMax - 1)] = '\0';
- else
- pszDest[nIndex] = '\0';
-
- /* results truncated */
- return MYODBC_C_FALSE;
-}
-
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCopyOut.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCopyOut.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCopyOut.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,86 +0,0 @@
-/*!
- \file MYODBCCStrCopyOut.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrCopyOut( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pszSrc,
- SQLINTEGER * pnSrcLen )
-{
- SQLINTEGER nIndex = 0;
- SQLINTEGER nLen;
- SQLINTEGER *pnLen;
-
- /* use dummy for pnSrcLen if pnSrcLen is NULL */
- if ( pnSrcLen )
- pnLen = pnSrcLen;
- else
- pnLen = &nLen;
-
- /* no chars copied so far */
- *pnLen = 0;
-
- /* sanity checks */
- if ( !pszDest || nDestMax < 1 )
- MYODBCCAssert( "Nothing to do." );
-
- if ( !pszSrc )
- {
- *pszDest = '\0';
- return MYODBC_C_TRUE; /* ok - but nothing to copy */
- }
-
- /* copy chars while room in pszDest or end of pszSrc */
- for ( nIndex = 0; nIndex < nDestMax; nIndex++ )
- {
- pszDest[nIndex] = pszSrc[nIndex];
- if ( pszSrc[nIndex] == '\0' )
- return MYODBC_C_TRUE;
- (*pnLen)++;
- }
-
- /* pszDest full - ensure last char is null terminator */
- pszDest[nIndex] = '\0';
-
- /* no need to determine strlen if pnSrcLen is null */
- if ( !pnSrcLen )
- return MYODBC_C_FALSE;
-
- /* scan till end to get pszSrc strlen */
- for ( ; pszSrc[nIndex] != '\0'; nIndex++ )
- {
- (*pnLen)++;
- }
-
- /* results truncated */
- return MYODBC_C_FALSE;
-}
-
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCopyOut1.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCopyOut1.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCopyOut1.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,83 +0,0 @@
-/*!
- \file MYODBCCStrCopyOut1.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrCopyOut1( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pszSrc,
- SQLINTEGER * pnSrcLen )
-{
- SQLINTEGER n = 0;
- SQLINTEGER nLen;
- SQLINTEGER *pnLen;
-
- /* use dummy for pnSrcLen if pnSrcLen is NULL */
- if ( pnSrcLen )
- pnLen = pnSrcLen;
- else
- pnLen = &nLen;
-
- /* no chars copied so far */
- *pnLen = 0;
-
- /* sanity checks */
- if ( !pszDest || nDestMax < 1 )
- MYODBCCAssert( "Nothing to do." );
-
- if ( !pszSrc )
- {
- *pszDest = '\0';
- return MYODBC_C_TRUE; /* ok - but nothing to copy */
- }
-
- /* copy chars while room in pszDest or end of pszSrc */
- for ( n = 0; n < nDestMax; n++ )
- {
- pszDest[n] = pszSrc[n];
- if ( pszSrc[n] == '\0' )
- return MYODBC_C_TRUE;
- (*pnLen)++;
- }
-
- /* no need to determine strlen if pnSrcLen is null */
- if ( !pnSrcLen )
- return MYODBC_C_FALSE;
-
- /* scan till end to get pszSrc strlen */
- for ( ; pszSrc[n] != '\0'; n++ )
- {
- (*pnLen)++;
- }
-
- /* results truncated */
- return MYODBC_C_FALSE;
-}
-
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrCopyOut2.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrCopyOut2.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrCopyOut2.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,44 +0,0 @@
-/*!
- \file MYODBCCStrCopyOut2.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrCopyOut2( SQLCHAR *pszDest, SQLINTEGER nDestMax, SQLCHAR *pszSrc,
SQLINTEGER *pnStrLenOrIndPtr )
-{
- if ( !pszSrc )
- {
- if ( pnStrLenOrIndPtr )
- *pnStrLenOrIndPtr = SQL_NULL_DATA;
- return MYODBC_C_TRUE;
- }
-
- return MYODBCCStrCopyOut( pszDest, nDestMax, pszSrc, pnStrLenOrIndPtr );
-}
-
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrDup.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrDup.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrDup.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,57 +0,0 @@
-/*!
- \file MYODBCCStrDup.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-SQLCHAR *MYODBCCStrDup( SQLCHAR *pcSrc, SQLINTEGER nSrcLen )
-{
- SQLCHAR * pszDest = NULL;
- int n = 0;
-
- if ( !pcSrc )
- return NULL;
-
- if ( nSrcLen < 0 && nSrcLen != SQL_NTS )
- MYODBCCAssert( "nSrcLen must be SQL_NTS or >= 0" );
-
- if ( nSrcLen == SQL_NTS )
- n = strlen( pcSrc ) + 1;
- else if ( nSrcLen > 1 )
- n = nSrcLen + 1;
- else
- return NULL;
-
- pszDest = MYODBCCMalloc( n );
- MYODBCCStrCopyIn( pszDest, n, pcSrc, nSrcLen );
-
- return pszDest;
-}
-
-
-
Deleted: MYODBCC/MYODBCCLib/MYODBCCStrNCaseCmp.c
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCCStrNCaseCmp.c 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/MYODBCCLib/MYODBCCStrNCaseCmp.c 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,67 +0,0 @@
-/*!
- \file MYODBCCStrNCaseCmp.c
- \author Peter Harvey <pharvey@stripped>
- Copyright (C) MySQL AB 2004-2005, Released under GPL.
- \version Connector/ODBC v5
- \date 2005
- \brief Code to abstract and enhance the standard C library to
- increase portability, and ease to debug.
-
- \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 "MYODBCCInternal.h"
-
-#ifndef _UNIX_
-
-int MYODBCCStrNCaseCmp( const char * psz1,
- const char * psz2,
- unsigned int nMaxCharsToCompare )
-{
- unsigned int nChar = 0;
-
- while ( 1 )
- {
- if ( nChar == nMaxCharsToCompare )
- return 0;
-
- if ( psz1[nChar] == '\0' || psz2[nChar] == '\0' )
- {
- if ( psz1[nChar] != '\0' )
- return (1);
- else if ( psz2[nChar] != '\0' )
- return (-1);
- return 0;
- }
- if ( toupper( psz1[nChar] ) != toupper( psz2[nChar] ) )
- {
- if ( toupper( psz1[nChar] ) < toupper( psz2[nChar] ) )
- return(-1);
- return 1;
- }
- nChar++;
- }
-
- return 0;
-}
-
-#endif
-
Modified: MYODBCC/include/MYODBCC.h
===================================================================
--- MYODBCC/include/MYODBCC.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCC/include/MYODBCC.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -30,21 +30,6 @@
#ifndef MYODBC_C_H
#define MYODBC_C_H
-/*
- Include all the standard C type stuff we need...
-*/
-#include <ctype.h>
-#include <time.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <tchar.h>
-
-#if !defined( max )
- #define max( a, b ) (((a) > (b)) ? (a) : (b))
- #define min( a, b ) (((a) < (b)) ? (a) : (b))
-#endif
-
/*!
\brief Set ODBC version we want build for.
*/
@@ -52,445 +37,66 @@
#ifdef WIN32
#include <windows.h>
-#else
- #include <ltdl.h>
#endif
+#include <string.h>
+
#include <sqltypes.h>
#include <sql.h>
#include <odbcinst.h>
#include <sqlext.h>
-/*!
- \brief DBMS and driver name.
+#include <QString>
- These are used in formatting the diagnostic message.
-*/
-#define MYODBC_VENDOR "MySQL"
-#define MYODBC_NAME "MyODBC"
-
-/*!
- \brief File name of driver.
-
- A character string with the file name of the driver used to access the data source.
-
- This is used for SQLGetInfo( SQL_DRIVER_NAME ).
-*/
-/*!
- \todo
-
- Need to get the file name on all platforms so perhaps get this from
- the build system.
-*/
-#ifdef _WIN32
-#define MYODBC_DRIVER_NAME "myodbc5.dll"
-#else
-#define MYODBC_DRIVER_NAME "libmyodbc5.so"
-#endif
-
-/*!
- \brief Version of ODBC supported by driver.
-
- A character string with the version of ODBC that the driver supports. The version
- is of the form ##.##, where the first two digits are the major version and the next
- two digits are the minor version. SQL_SPEC_MAJOR and SQL_SPEC_MINOR define the major
- and minor version numbers. For the version of ODBC described in this manual, these
- are 3 and 0, and the driver should return "03.00".
-
- This is used for SQLGetInfo( SQL_DRIVER_ODBC_VER ).
-*/
-/* #define MYODBC_DRIVER_ODBC_VER "03.00" */
-#define MYODBC_DRIVER_ODBC_VER "03.51"
-
-/*!
- \brief Driver version.
-
- A character string with the version of the driver and optionally, a description of
- the driver. At a minimum, the version is of the form ##.##.####, where the first two
- digits are the major version, the next two digits are the minor version, and the last
- four digits are the release version.
-
- This is used for SQLGetInfo( SQL_DRIVER_VER ) and when formatting diagnostic
messages.
-*/
-/*!
- \todo
-
- Get this from build system (gnu auto-tools or qmake etc).
-*/
-#define MYODBC_DRIVER_VER "05.00.0000"
-
-/*!
- \brief bool
-
- Creating something for a bool is common
- but here we take it a step further by creating
- a 'type' and using enum to make it even more
- strict. This should increase the ability of
- the compiler to help us create cleaner code.
-*/
-typedef enum
+/* basically just a namespace for us to play in */
+class MYODBCC
{
- MYODBC_C_FALSE = 0,
- MYODBC_C_TRUE
+public:
+ static void * getMem( size_t nBytes );
+ static size_t getStrLen( const SQLWCHAR *psz, size_t nMaxChars );
+ static QString getConnectAttrString( SQLINTEGER nAttribute );
+ static QString getConnectOptionString( SQLUSMALLINT nOption );
+ static QString getDiagFieldString( SQLSMALLINT nDiagField );
+ static QString getEnvAttrString( SQLINTEGER nAttribute );
+ static QString getFunctionsString( SQLUSMALLINT nFunction );
+ static QString getHandleTypeString( SQLSMALLINT nHandleType );
+ static QString getInfoTypeString( SQLUSMALLINT nInfoType );
+ static QString getReturnString( SQLRETURN nReturn );
+ static QString getStmtAttrString( SQLINTEGER nAttribute );
+ static QString getStmtOptionString( SQLUSMALLINT nOption );
+ static QString getTypeStringC( SQLSMALLINT nType );
+ static QString getTypeStringSQL( SQLSMALLINT nType );
+ static QString getConciseTypeStringC( SQLSMALLINT nType );
+ static QString getConciseTypeStringSQL( SQLSMALLINT nType );
+ static QString getIntervalConciseTypeStringC( SQLSMALLINT nType );
+ static QString getIntervalConciseTypeStringSQL( SQLSMALLINT nType );
+ static QString getDateTimeCodeString( SQLSMALLINT nCode );
+ static QString getIntervalCodeString( SQLSMALLINT nCode );
+ static QString getInstallerErrorString( RETCODE nRetCode );
-} MYODBC_C_BOOL;
+ static void * doMemCpy( void *pDest, const void *pSrc, size_t nBytes );
+ static errno_t doStrNCpy( SQLWCHAR *pszDest, size_t nMaxChars, const SQLWCHAR
*pszSrc, size_t nChars = _TRUNCATE );
+ static void doFree( void *p );
-/* library handling wrappers */
-#ifdef WIN32
- #define MYODBC_C_DLL HMODULE
- #define MYODBCCInitLibrary() abs(0)
- #define MYODBCCLoadLibrary(A) LoadLibrary(A)
- #define MYODBCCFreeLibrary(A) FreeLibrary(A)
- #define MYODBCCGetProcAddress(A,B) GetProcAddress(A,B)
-#else
- #define MYODBC_C_DLL void *
- #define MYODBCCInitLibrary() lt_dlinit()
- #define MYODBCCLoadLibrary(A) lt_dlopen(A)
- #define MYODBCCFreeLibrary(A) lt_dlclose(A)
- #define MYODBCCGetProcAddress(A,B) lt_dlsym(A,B)
-#endif
+ static bool isConnectAttr( SQLINTEGER nAttribute );
+ static bool isConnectOption( SQLUSMALLINT nOption );
+ static bool isDiagField( SQLSMALLINT nDiagField );
+ static bool isEnvAttr( SQLINTEGER nAttribute );
+ static bool isFunctions( SQLUSMALLINT nFunction );
+ static bool isHandleType( SQLSMALLINT nHandleType );
+ static bool isInfoType( SQLUSMALLINT nInfoType );
+ static bool isReturn( SQLRETURN nReturn );
+ static bool isStmtAttr( SQLINTEGER nAttribute );
+ static bool isStmtOption( SQLUSMALLINT nOption );
+ static bool isTypeC( SQLSMALLINT nType );
+ static bool isTypeSQL( SQLSMALLINT nType );
+ static bool isConciseTypeC( SQLSMALLINT nType );
+ static bool isConciseTypeSQL( SQLSMALLINT nType );
+ static bool isIntervalConciseTypeC( SQLSMALLINT nType );
+ static bool isIntervalConciseTypeSQL( SQLSMALLINT nType );
+ static bool isDateTimeCode( SQLSMALLINT nCode );
+ static bool isIntervalCode( SQLSMALLINT nCode );
+};
-/* unicode aware (or not) */
-#ifdef WIN32
- #define MYODBCCfprintf _ftprintf_s
- #define MYODBCCstrlen wcslen
- #define MYODBCCstrncpy wcsncpy_s
-#else
#endif
-/* macros to make some fairly standard C code more portable and to allow for use mem
checkers */
-#define MYODBCCMalloc(A) malloc(A)
-#define MYODBCCCalloc(A,B) calloc(A,B)
-#define MYODBCCRealloc(A,B) realloc(A,B)
-#define MYODBCCFree(A) { if (A) free(A); }
-#define MYODBCCFreeNull(A) { if ((A) && *(A)) { free(*(A)); *(A) = NULL; } }
-#define MYODBCCMemMove(A,B,C) memmove(A,B,C)
-#define MYODBCCMemCpy(A,B,C) memcpy(A,B,C)
-#define MYODBCCMemSet(A,B,C) memset(A,B,C)
-
-#define MYODBCCStrCmp(A,B) strcmp(A,B)
-#define MYODBCCStrNCpy(A,B) strncpy(A,B)
-#define MYODBCCStrLen(A) strlen(A)
-#define MYODBCCStrCat(A,B) strcat(A,B)
-#define MYODBCCIntToAlpha(A,B,C) itoa(A,B,C)
-/* returns true if NULL or empty, nLen must be SQL_NTS || >= 0 */
-#define MYODBCCStrIsEmpty(pStr,nLen) (pStr == NULL || nLen == 0 || *pStr == '\0')
-#define MYODBCCStrEnd(pc,nLen,nIndex) ( (nLen==SQL_NTS && pc[nIndex]=='\0') ||
(nLen!=SQL_NTS && nIndex >= nLen) )
-#define MYODBCCDigit(A) ((int) (A - '0'))
-
-typedef unsigned long long MYODBC_C_ULONGLONG;
-typedef long long MYODBC_C_LONGLONG;
-
-/*!
- \brief Compares two strings.
-
- Compares two strings where difference in upper/lower case is
- not considered a difference in the character.
-
- This function compares at most nMaxCharsToCompare. If
- nMaxCharsToCompare has limited the compare - the two strings
- are considered equal.
-
- This function exists to provide strcasecmp() functionality on
- platforms which do not otherwise support this function.
-
- \param psz1 first string to compare
- \param psz2 second string to compare
- \param nMaxCharsToCompare max characters to compare
-
- \return int
-
- \retval 0 if strings match (up to nMacCharsToCompare)
- \retval <0 if psz1 is less than psz2
- \retval >0 if psz1 is greater than psz2
-
- \sa MYODBCCStrCaseCmp
-*/
-#ifdef _UNIX_
- #define MYODBCCStrNCaseCmp(A,B,C) strncasecmp(A,B,C)
-#else
-int MYODBCCStrNCaseCmp( const char *psz1, const char *psz2, unsigned int
nMaxCharsToCompare );
-#endif
-
-/*!
- \brief Compares two strings.
-
- Compares two strings where difference in upper/lower case is
- not considered a difference in the character.
-
- This function exists to provide strcasecmp() functionality on
- platforms which do not otherwise support this function.
-
- \param psz1 first string to compare
- \param psz2 second string to compare
-
- \return int
-
- \retval <0 if psz1 is less than psz2
- \retval >0 if psz1 is greater than psz2
-
- \sa MYODBCCStrNCaseCmp
-*/
-#ifdef _UNIX_
- #define MYODBCCStrCaseCmp(A,B) strcasecmp(A,B)
-#else
-int MYODBCCStrCaseCmp( const char *psz1, const char *psz2 );
-#endif
-
-/*!
- \brief Compares two strings which may, or may not, be null terminated.
-
- This function has been created to support string comparison
- where the strings may not be null terminated such as in SQLTables().
-
- Handles null string pointers. A null string pointer is considered
- less than an empty string.
-
- \param pcLeft Left string (may be NULL).
- \param nLeftLen Left string len (not counting any NULL). May be SQL_NTS.
- \param pcRight Right string (may be NULL).
- \param nRightLen Right string len (not counting any NULL). May be SQL_NTS.
-
- \return MYODBC_C_BOOL
-
- \retval MYODBC_C_TRUE Strings are equal - although any null terminator is not
- counted in this comparison.
- \retval MYODBC_C_FALSE String do not match.
-
- \sa MYODBCCStrCmpWild
-*/
-MYODBC_C_BOOL MYODBCCStrCmpLiteral( SQLCHAR * pcLeft,
- SQLSMALLINT nLeftLen,
- SQLCHAR * pcRight,
- SQLSMALLINT nRightLen );
-
-/*!
- \brief Compares two strings which may, or may not, be null terminated and
- may contain wild card ('%' or '_').
-
- This function has been created to support string comparison
- where the strings may not be null terminated such as in SQLTables().
-
- Handles null string pointers. A null string pointer is considered
- less than an empty string.
-
- \todo Only supports "%" for wild card - others are considered as literal. Need
- to implement complete wild card for '%' and '_'.
-
- \param pcLeft Left string (may be NULL). The left string may contain
- wild cards '%' or '_'. These wild chars can be escaped
- using '\'.
- \param nLeftLen Left string len (not counting any NULL). May be SQL_NTS.
- \param pcRight Right string (may be NULL).
- \param nRightLen Right string len (not counting any NULL). May be SQL_NTS.
-
- \return MYODBC_C_BOOL
-
- \retval MYODBC_C_TRUE Strings are equal - although any null terminator is not
- counted in this comparison.
- \retval MYODBC_C_FALSE String do not match.
-
- \sa MYODBCCStrCmpLiteral
-*/
-MYODBC_C_BOOL MYODBCCStrCmpWild( SQLCHAR * pcLeft,
- SQLSMALLINT nLeftLen,
- SQLCHAR * pcRight,
- SQLSMALLINT nRightLen );
-
-/*!
- \brief Copies a string.
-
- Use when dest needs to be null terminated and src may, or may not, be
- null terminated.
-
- This function is said to copy strings 'in' because it is used to copy
- string data provided 'to' the driver and provided ' by' the application
- (or possibly system information).
-
- \param pszDest Destination buffer. Will always be null term when
- return is true. Will be null term when return is false
- as a result of trunaction.
- \param nDestMax Max chars we can put in dest. This must be > 0. If it is
- 1 then we just have room for the null terminator so we
- end up with an empty string.
- \param pcSrc Source string. This may, or may not, be null terminated.
- \param nSrcLen Max number of chars to copy from source. This can also
- be SQL_NTS (to indicate string is null terminated and we
- would like the whole string). Values < 1 and not SQL_NTS
- are invalid and will result in an empty string in pszDest
- and a ret val of false.
-
- \return MYODBC_C_TRUE Complete string copied.
- MYODBC_C_FALSE The pszDest contains a truncated string.
-
- \sa MYODBCCStrCopyOut
- SQLConnect
-*/
-MYODBC_C_BOOL MYODBCCStrCopyIn( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pcSrc,
- SQLINTEGER nSrcLen );
-
-/*!
- \brief Copies a string.
-
- Use when dest needs to be null terminated and caller needs
- strlen(src).
-
- This function is said to copy strings 'out' because it is used to copy
- string data provided 'by' the driver and provided 'to' the application.
-
- \param pszDest Destination buffer. Will always be null term when
- return is true. Will be null term when return is false
- as a result of trunaction.
- \param nDestMax Max chars we can put in dest. This must be > 0. If it is
- 1 then we just have room for the null terminator so we
- end up with an empty string.
- \param pszSrc Source buffer - a null terminated string. Passing a NULL
- pointer results in pszDest being an empty string.
- \param pnSrcLen The str len of pszSrc. This may be more than we copied.
- Pass NULL pointer if not important.
-
- \return MYODBC_C_TRUE Complete string copied.
- MYODBC_C_FALSE The pszDest contains a truncated string. Caller can check
- pnSrcLen to see how much space is needed in pszDest to
- copy all.
-
- \sa MYODBCCStrCopyOut2
- SQLGetDescField
-*/
-MYODBC_C_BOOL MYODBCCStrCopyOut( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pszSrc,
- SQLINTEGER * pnSrcLen );
-
-/*!
- \brief Copies a string.
-
- Use when dest need NOT be null terminated and caller needs
- strlen(src).
-
- \param pszDest Destination buffer. Will always be null term when
- return is true. Will NOT be null term when return is false
- as a result of trunaction. Truncation will occur even if
- the only character truncated is the null term.
- \param nDestMax Max chars we can put in dest. This must be > 0. If it is
- 1 then we just have room for the null terminator so we
- end up with an empty string.
- \param pszSrc Source buffer - a null terminated string. Passing a NULL
- pointer results in pszDest being an empty string.
- \param pnSrcLen The str len of pszSrc. This may be more than we copied.
- Pass NULL pointer if not important.
-
- \return MYODBC_C_TRUE Complete string copied.
- MYODBC_C_FALSE The pszDest contains a truncated string. Caller can check
- pnSrcLen to see how much space is needed in pszDest to
- copy all.
-
- \sa MYODBCCStrCopyOut2
- SQLGetDescField
-*/
-MYODBC_C_BOOL MYODBCCStrCopyOut1( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pszSrc,
- SQLINTEGER * pnSrcLen );
-
-/*!
- \brief Copies a string.
-
- When dest needs to be null terminated and pnStrLenOrIndPtr
- (as in strlen() or SQL_NULL_DATA) needed ie SQLGetData when
- char value.
-
- \param pszDest Destination buffer. Will always be null term when
- return is true. Will be null term when return is false
- as a result of trunaction.
- Exception; this is undefined if SQL_NULL_DATA.
- \param nDestMax Max chars we can put in dest. This must be > 0. If it
is
- 1 then we just have room for the null terminator so we
- end up with an empty string.
- \param pszSrc Source buffer - a null terminated string. Passing a NULL
- pointer results in pszDest being an empty string.
- \param pnStrLenOrIndPtr The str len of pszSrc. This may be more than we copied.
- Pass NULL pointer if not important.
-
- \return MYODBC_C_TRUE Complete string copied.
- MYODBC_C_FALSE The pszDest contains a truncated string. Caller can check
- pnSrcLen to see how much space is needed in pszDest to
- copy all.
-
- \sa MYODBCCStrCopyOut
- SQLGetData
-*/
-MYODBC_C_BOOL MYODBCCStrCopyOut2( SQLCHAR * pszDest,
- SQLINTEGER nDestMax,
- SQLCHAR * pszSrc,
- SQLINTEGER * pnStrLenOrIndPtr );
-
-/*!
- \brief Duplicates a string.
-
- Like standard strndup() but;
- - pcSrc may be NULL (in which case retval is NULL)
- - nSrcLen may be max chars to copy or SQL_NTS
-
- \param pcSrc Source string. This may, or may not, be null terminated but
- must be null terminated if nSrcLen == SQL_NTS..
- \param nSrcLen Max number of chars to copy from source. This can also
- be SQL_NTS (to indicate string is null terminated and we
- would like the whole string). Values < 1 and not SQL_NTS
- are invalid and will result in an empty string in pszDest.
-
- \return SQLCHAR* A null terminated duplicate of pcSrc else a NULL.
-
- \sa MYODBCCStrCopyIn
-*/
-SQLCHAR *MYODBCCStrDup( SQLCHAR * pcSrc,
- SQLINTEGER nSrcLen );
-
-/*!
- \brief Prints an error message to stderr and then exits.
-
- Our own assert() function. File name and line number
- will be pre-pended to message.
-
- Use this when you catch an error which you can not
- recover from or when its a serious 'programmer error'.
-
- \param a1 a message
-*/
-#define MYODBCCAssert(a1)\
-{\
- MYODBCCfprintf( stderr, _T"[ASSERT][%s][%d] %s\n", TEXT(__FILE__), __LINE__, a1 );\
- exit( 1 );\
-}
-
-/*!
- \brief Prints the last system error to stderr.
-
- \sa MYODBCDbgPrint
-*/
-#ifdef WIN32
-#define MYODBCCPrintLastError()\
-{\
- DWORD nError = GetLastError();\
- LPVOID pszError = NULL;\
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,\
- NULL,\
- nError,\
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\
- (LPTSTR)&pszError,\
- 0,\
- NULL );\
- MYODBCCfprintf( stderr, _T"[%s][%d] %d: %s\n", TEXT(__FILE__), __LINE__, nError,
pszError );\
- LocalFree( pszError );\
-}
-#else
-#define MYODBCCPrintLastError()\
-{\
- MYODBCCfprintf( stderr, _T"[%s][%d] %d: %s\n", TEXT(__FILE__), __LINE__, xxxx, xxxx
);\
-}
-#endif
-
-#endif
-
Modified: MYODBCDbg/MYODBCDbgLib/MYODBCDbg.cpp
===================================================================
--- MYODBCDbg/MYODBCDbgLib/MYODBCDbg.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDbg/MYODBCDbgLib/MYODBCDbg.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -259,7 +259,7 @@
*this << QString( "[RETURN ] %1:%2: %3 " )
.arg( pszFile )
.arg( nLine )
- .arg( pszFunction ) << getReturnString( nReturn ) << " "
<< stringMessage << endl;
+ .arg( pszFunction ) << MYODBCC::getReturnString( nReturn ) <<
" " << stringMessage << endl;
return nReturn;
}
@@ -284,946 +284,4 @@
}
}
-/*!
- \brief Returns a string version of a connection attribute.
-
- Returns a string version of a connection attribute. This is great for
- returning more readable debug output.
-
- \param nAttribute An connection attribute.
-
- \return A string constant describing nAttribute.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getConnectAttrString( SQLINTEGER nAttribute )
-{
- switch ( nAttribute )
- {
- case SQL_ATTR_ACCESS_MODE:
- return "SQL_ATTR_ACCESS_MODE";
- case SQL_ATTR_ASYNC_ENABLE:
- return "SQL_ATTR_ASYNC_ENABLE";
- case SQL_ATTR_AUTO_IPD:
- return "SQL_ATTR_AUTO_IPD";
- case SQL_ATTR_AUTOCOMMIT:
- return "SQL_ATTR_AUTOCOMMIT";
- case SQL_ATTR_CONNECTION_DEAD:
- return "SQL_ATTR_CONNECTION_DEAD";
- case SQL_ATTR_CONNECTION_TIMEOUT:
- return "SQL_ATTR_CONNECTION_TIMEOUT";
- case SQL_ATTR_CURRENT_CATALOG:
- return "SQL_ATTR_CURRENT_CATALOG";
- case SQL_ATTR_LOGIN_TIMEOUT:
- return "SQL_ATTR_LOGIN_TIMEOUT";
- case SQL_ATTR_METADATA_ID:
- return "SQL_ATTR_METADATA_ID";
- case SQL_ATTR_ODBC_CURSORS:
- return "SQL_ATTR_ODBC_CURSORS";
- case SQL_ATTR_PACKET_SIZE:
- return "SQL_ATTR_PACKET_SIZE";
- case SQL_ATTR_QUIET_MODE:
- return "SQL_ATTR_QUIET_MODE";
- case SQL_ATTR_TRACE:
- return "SQL_ATTR_TRACE";
- case SQL_ATTR_TRACEFILE:
- return "SQL_ATTR_TRACEFILE";
- case SQL_ATTR_TRANSLATE_LIB:
- return "SQL_ATTR_TRANSLATE_LIB";
- case SQL_ATTR_TRANSLATE_OPTION:
- return "SQL_ATTR_TRANSLATE_OPTION";
- case SQL_ATTR_TXN_ISOLATION:
- return "SQL_ATTR_TXN_ISOLATION";
- }
-
- return "unknown";
-}
-
-
-/*!
- \brief Returns a string version of a connection option.
-
- Returns a string version of a connection option (or statement attribute).
- This is great for returning more readable debug output.
-
- \param nOption A connection option.
-
- \return A string constant describing nOption.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getConnectOptionString( SQLUSMALLINT nOption )
-{
-
- switch ( nOption )
- {
- case SQL_ACCESS_MODE:
- return "SQL_ACCESS_MODE";
- case SQL_AUTOCOMMIT:
- return "SQL_AUTOCOMMIT";
- case SQL_CURRENT_QUALIFIER:
- return "SQL_CURRENT_QUALIFIER";
- case SQL_LOGIN_TIMEOUT:
- return "SQL_LOGIN_TIMEOUT";
- case SQL_ODBC_CURSORS:
- return "SQL_ODBC_CURSORS";
- case SQL_OPT_TRACE:
- return "SQL_OPT_TRACE";
- case SQL_OPT_TRACEFILE:
- return "SQL_OPT_TRACEFILE";
- case SQL_PACKET_SIZE:
- return "SQL_PACKET_SIZE";
- case SQL_QUIET_MODE:
- return "SQL_QUIET_MODE";
- case SQL_TRANSLATE_DLL:
- return "SQL_TRANSLATE_DLL";
- case SQL_TRANSLATE_OPTION:
- return "SQL_TRANSLATE_OPTION";
- case SQL_TXN_ISOLATION:
- return "SQL_TXN_ISOLATION";
- default:
- /* in 2.x stm attr can be set (as default) in dbc */
- return getStmtAttrString( (SQLINTEGER)nOption );
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a diag field identifier.
-
- Returns a string version of a diag field identifier. This is great for
- returning more readable debug output.
-
- \param nDiagField A diag field identifier.
-
- \return A string constant describing nDiagField.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getDiagFieldString( SQLSMALLINT nDiagField )
-{
- switch ( nDiagField )
- {
- case SQL_DIAG_CURSOR_ROW_COUNT:
- return "SQL_DIAG_CURSOR_ROW_COUNT";
- case SQL_DIAG_DYNAMIC_FUNCTION:
- return "SQL_DIAG_DYNAMIC_FUNCTION";
- case SQL_DIAG_DYNAMIC_FUNCTION_CODE:
- return "SQL_DIAG_DYNAMIC_FUNCTION_CODE";
- case SQL_DIAG_NUMBER:
- return "SQL_DIAG_NUMBER";
- case SQL_DIAG_RETURNCODE:
- return "SQL_DIAG_RETURNCODE";
- case SQL_DIAG_ROW_COUNT:
- return "SQL_DIAG_ROW_COUNT";
- case SQL_DIAG_CLASS_ORIGIN:
- return "SQL_DIAG_CLASS_ORIGIN";
- case SQL_DIAG_COLUMN_NUMBER:
- return "SQL_DIAG_COLUMN_NUMBER";
- case SQL_DIAG_CONNECTION_NAME:
- return "SQL_DIAG_CONNECTION_NAME";
- case SQL_DIAG_MESSAGE_TEXT:
- return "SQL_DIAG_MESSAGE_TEXT";
- case SQL_DIAG_NATIVE:
- return "SQL_DIAG_NATIVE";
- case SQL_DIAG_ROW_NUMBER:
- return "SQL_DIAG_ROW_NUMBER";
- case SQL_DIAG_SERVER_NAME:
- return "SQL_DIAG_SERVER_NAME";
- case SQL_DIAG_SQLSTATE:
- return "SQL_DIAG_SQLSTATE";
- case SQL_DIAG_SUBCLASS_ORIGIN:
- return "SQL_DIAG_SUBCLASS_ORIGIN";
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a environment attribute.
-
- Returns a string version of a environment attribute. This is great for
- returning more readable debug output.
-
- \param nAttribute An environment attribute.
-
- \return A string constant describing nAttribute.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getEnvAttrString( SQLINTEGER nAttribute )
-{
- switch ( nAttribute )
- {
- case SQL_ATTR_CONNECTION_POOLING:
- return "SQL_ATTR_CONNECTION_POOLING";
- case SQL_ATTR_CP_MATCH:
- return "SQL_ATTR_CP_MATCH";
- case SQL_ATTR_ODBC_VERSION:
- return "SQL_ATTR_ODBC_VERSION";
- case SQL_ATTR_OUTPUT_NTS:
- return "SQL_ATTR_OUTPUT_NTS";
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a function id.
-
- Returns a string version of a function id. This is great for
- returning more readable debug output.
-
- \param nFunction A function ID or SQL_API_ALL_FUNCTIONS, or
- SQL_API_ODBC3_ALL_FUNCTIONS.
-
- \return A string of the function ID.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getFunctionsString( SQLUSMALLINT nFunction )
-{
- switch ( nFunction )
- {
- case SQL_API_ALL_FUNCTIONS:
- return "SQL_API_ALL_FUNCTIONS";
- case SQL_API_SQLALLOCCONNECT:
- return "SQL_API_SQLALLOCCONNECT";
- case SQL_API_SQLALLOCENV:
- return "SQL_API_SQLALLOCENV";
- case SQL_API_SQLALLOCHANDLE:
- return "SQL_API_SQLALLOCHANDLE";
- case SQL_API_SQLALLOCSTMT:
- return "SQL_API_SQLALLOCSTMT";
- case SQL_API_SQLBINDCOL:
- return "SQL_API_SQLBINDCOL";
- case SQL_API_SQLCANCEL:
- return "SQL_API_SQLCANCEL";
- case SQL_API_SQLCLOSECURSOR:
- return "SQL_API_SQLCLOSECURSOR";
-/* Same value as SQL_API_SQLCOLATTRIBUTES...
- case SQL_API_SQLCOLATTRIBUTE:
- return "SQL_API_SQLCOLATTRIBUTE";
-*/
- case SQL_API_SQLCOLUMNS:
- return "SQL_API_SQLCOLUMNS";
- case SQL_API_SQLCONNECT:
- return "SQL_API_SQLCONNECT";
- case SQL_API_SQLCOPYDESC:
- return "SQL_API_SQLCOPYDESC";
- case SQL_API_SQLDATASOURCES:
- return "SQL_API_SQLDATASOURCES";
- case SQL_API_SQLDESCRIBECOL:
- return "SQL_API_SQLDESCRIBECOL";
- case SQL_API_SQLDISCONNECT:
- return "SQL_API_SQLDISCONNECT";
- case SQL_API_SQLENDTRAN:
- return "SQL_API_SQLENDTRAN";
- case SQL_API_SQLERROR:
- return "SQL_API_SQLERROR";
- case SQL_API_SQLEXECDIRECT:
- return "SQL_API_SQLEXECDIRECT";
- case SQL_API_SQLEXECUTE:
- return "SQL_API_SQLEXECUTE";
- case SQL_API_SQLFETCH:
- return "SQL_API_SQLFETCH";
- case SQL_API_SQLFETCHSCROLL:
- return "SQL_API_SQLFETCHSCROLL";
- case SQL_API_SQLFREECONNECT:
- return "SQL_API_SQLFREECONNECT";
- case SQL_API_SQLFREEENV:
- return "SQL_API_SQLFREEENV";
- case SQL_API_SQLFREEHANDLE:
- return "SQL_API_SQLFREEHANDLE";
- case SQL_API_SQLFREESTMT:
- return "SQL_API_SQLFREESTMT";
- case SQL_API_SQLGETCONNECTATTR:
- return "SQL_API_SQLGETCONNECTATTR";
- case SQL_API_SQLGETCONNECTOPTION:
- return "SQL_API_SQLGETCONNECTOPTION";
- case SQL_API_SQLGETCURSORNAME:
- return "SQL_API_SQLGETCURSORNAME";
- case SQL_API_SQLGETDATA:
- return "SQL_API_SQLGETDATA";
- case SQL_API_SQLGETDESCFIELD:
- return "SQL_API_SQLGETDESCFIELD";
- case SQL_API_SQLGETDESCREC:
- return "SQL_API_SQLGETDESCREC";
- case SQL_API_SQLGETDIAGFIELD:
- return "SQL_API_SQLGETDIAGFIELD";
- case SQL_API_SQLGETDIAGREC:
- return "SQL_API_SQLGETDIAGREC";
- case SQL_API_SQLGETENVATTR:
- return "SQL_API_SQLGETENVATTR";
- case SQL_API_SQLGETFUNCTIONS:
- return "SQL_API_SQLGETFUNCTIONS";
- case SQL_API_SQLGETINFO:
- return "SQL_API_SQLGETINFO";
- case SQL_API_SQLGETSTMTATTR:
- return "SQL_API_SQLGETSTMTATTR";
- case SQL_API_SQLGETSTMTOPTION:
- return "SQL_API_SQLGETSTMTOPTION";
- case SQL_API_SQLGETTYPEINFO:
- return "SQL_API_SQLGETTYPEINFO";
- case SQL_API_SQLNUMRESULTCOLS:
- return "SQL_API_SQLNUMRESULTCOLS";
- case SQL_API_SQLPARAMDATA:
- return "SQL_API_SQLPARAMDATA";
- case SQL_API_SQLPREPARE:
- return "SQL_API_SQLPREPARE";
- case SQL_API_SQLPUTDATA:
- return "SQL_API_SQLPUTDATA";
- case SQL_API_SQLROWCOUNT:
- return "SQL_API_SQLROWCOUNT";
- case SQL_API_SQLSETCONNECTATTR:
- return "SQL_API_SQLSETCONNECTATTR";
- case SQL_API_SQLSETCONNECTOPTION:
- return "SQL_API_SQLSETCONNECTOPTION";
- case SQL_API_SQLSETCURSORNAME:
- return "SQL_API_SQLSETCURSORNAME";
- case SQL_API_SQLSETDESCFIELD:
- return "SQL_API_SQLSETDESCFIELD";
- case SQL_API_SQLSETDESCREC:
- return "SQL_API_SQLSETDESCREC";
- case SQL_API_SQLSETENVATTR:
- return "SQL_API_SQLSETENVATTR";
- case SQL_API_SQLSETSTMTATTR:
- return "SQL_API_SQLSETSTMTATTR";
- case SQL_API_SQLSETSTMTOPTION:
- return "SQL_API_SQLSETSTMTOPTION";
- case SQL_API_SQLSPECIALCOLUMNS:
- return "SQL_API_SQLSPECIALCOLUMNS";
- case SQL_API_SQLSTATISTICS:
- return "SQL_API_SQLSTATISTICS";
- case SQL_API_SQLTABLES:
- return "SQL_API_SQLTABLES";
- case SQL_API_SQLTRANSACT:
- return "SQL_API_SQLTRANSACT";
- case SQL_API_SQLBULKOPERATIONS:
- return "SQL_API_SQLBULKOPERATIONS";
- case SQL_API_SQLBINDPARAMETER:
- return "SQL_API_SQLBINDPARAMETER";
- case SQL_API_SQLBROWSECONNECT:
- return "SQL_API_SQLBROWSECONNECT";
- case SQL_API_SQLCOLATTRIBUTES:
- return "SQL_API_SQLCOLATTRIBUTES";
- case SQL_API_SQLCOLUMNPRIVILEGES :
- return "SQL_API_SQLCOLUMNPRIVILEGES";
- case SQL_API_SQLDESCRIBEPARAM:
- return "SQL_API_SQLDESCRIBEPARAM";
- case SQL_API_SQLDRIVERCONNECT:
- return "SQL_API_SQLDRIVERCONNECT";
- case SQL_API_SQLDRIVERS:
- return "SQL_API_SQLDRIVERS";
- case SQL_API_SQLEXTENDEDFETCH:
- return "SQL_API_SQLEXTENDEDFETCH";
- case SQL_API_SQLFOREIGNKEYS:
- return "SQL_API_SQLFOREIGNKEYS";
- case SQL_API_SQLMORERESULTS:
- return "SQL_API_SQLMORERESULTS";
- case SQL_API_SQLNATIVESQL:
- return "SQL_API_SQLNATIVESQL";
- case SQL_API_SQLNUMPARAMS:
- return "SQL_API_SQLNUMPARAMS";
- case SQL_API_SQLPARAMOPTIONS:
- return "SQL_API_SQLPARAMOPTIONS";
- case SQL_API_SQLPRIMARYKEYS:
- return "SQL_API_SQLPRIMARYKEYS";
- case SQL_API_SQLPROCEDURECOLUMNS:
- return "SQL_API_SQLPROCEDURECOLUMNS";
- case SQL_API_SQLPROCEDURES:
- return "SQL_API_SQLPROCEDURES";
- case SQL_API_SQLSETPOS:
- return "SQL_API_SQLSETPOS";
- case SQL_API_SQLSETSCROLLOPTIONS:
- return "SQL_API_SQLSETSCROLLOPTIONS";
- case SQL_API_SQLTABLEPRIVILEGES:
- return "SQL_API_SQLTABLEPRIVILEGES";
- case SQL_API_ODBC3_ALL_FUNCTIONS:
- return "SQL_API_ODBC3_ALL_FUNCTIONS";
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a handle type identifier.
-
- Returns a string version of a handle type identifier. This is great for
- returning more readable debug output.
-
- \param nHandleType A handle type identifier.
-
- \return A string constant describing nHandleType.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getHandleTypeString( SQLSMALLINT nHandleType )
-{
- switch ( nHandleType )
- {
- case SQL_HANDLE_ENV:
- return "SQL_HANDLE_ENV";
- case SQL_HANDLE_DBC:
- return "SQL_HANDLE_DBC";
- case SQL_HANDLE_STMT:
- return "SQL_HANDLE_STMT";
- case SQL_HANDLE_DESC:
- return "SQL_HANDLE_DESC";
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a info type identifier.
-
- Returns a string version of a info type identifier. This is great for
- returning more readable debug output.
-
- \param nInfoType A info type identifier.
-
- \return A string constant describing nInfoType.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getInfoTypeString( SQLUSMALLINT nInfoType )
-{
- switch ( nInfoType )
- {
- case SQL_ACCESSIBLE_PROCEDURES:
- return "SQL_ACCESSIBLE_PROCEDURES";
- case SQL_ACCESSIBLE_TABLES:
- return "SQL_ACCESSIBLE_TABLES";
- case SQL_ACTIVE_ENVIRONMENTS:
- return "SQL_ACTIVE_ENVIRONMENTS";
- case SQL_AGGREGATE_FUNCTIONS:
- return "SQL_AGGREGATE_FUNCTIONS";
- case SQL_ALTER_DOMAIN:
- return "SQL_ALTER_DOMAIN";
- case SQL_ALTER_TABLE:
- return "SQL_ALTER_TABLE";
- case SQL_ASYNC_MODE:
- return "SQL_ASYNC_MODE";
- case SQL_BATCH_ROW_COUNT:
- return "SQL_BATCH_ROW_COUNT";
- case SQL_BATCH_SUPPORT:
- return "SQL_BATCH_SUPPORT";
- case SQL_BOOKMARK_PERSISTENCE:
- return "SQL_BOOKMARK_PERSISTENCE";
- case SQL_CATALOG_LOCATION:
- return "SQL_CATALOG_LOCATION";
- case SQL_CATALOG_NAME:
- return "SQL_CATALOG_NAME";
- case SQL_CATALOG_NAME_SEPARATOR:
- return "SQL_CATALOG_NAME_SEPARATOR";
- case SQL_CATALOG_TERM:
- return "SQL_CATALOG_TERM";
- case SQL_CATALOG_USAGE:
- return "SQL_CATALOG_USAGE";
- case SQL_COLLATION_SEQ:
- return "SQL_COLLATION_SEQ";
- case SQL_COLUMN_ALIAS:
- return "SQL_COLUMN_ALIAS";
- case SQL_CONCAT_NULL_BEHAVIOR:
- return "SQL_CONCAT_NULL_BEHAVIOR";
- case SQL_CONVERT_BIGINT:
- return "SQL_CONVERT_BIGINT";
- case SQL_CONVERT_BINARY:
- return "SQL_CONVERT_BINARY";
- case SQL_CONVERT_BIT:
- return "SQL_CONVERT_BIT";
- case SQL_CONVERT_CHAR:
- return "SQL_CONVERT_CHAR";
-#ifdef SQL_CONVERT_GUID
- case SQL_CONVERT_GUID:
- return "SQL_CONVERT_GUID";
-#endif
- case SQL_CONVERT_DATE:
- return "SQL_CONVERT_DATE";
- case SQL_CONVERT_DECIMAL:
- return "SQL_CONVERT_DECIMAL";
- case SQL_CONVERT_DOUBLE:
- return "SQL_CONVERT_DOUBLE";
- case SQL_CONVERT_FLOAT:
- return "SQL_CONVERT_FLOAT";
- case SQL_CONVERT_INTEGER:
- return "SQL_CONVERT_INTEGER";
- case SQL_CONVERT_INTERVAL_YEAR_MONTH:
- return "SQL_CONVERT_INTERVAL_YEAR_MONTH";
- case SQL_CONVERT_INTERVAL_DAY_TIME:
- return "SQL_CONVERT_INTERVAL_DAY_TIME";
- case SQL_CONVERT_LONGVARBINARY:
- return "SQL_CONVERT_LONGVARBINARY";
- case SQL_CONVERT_LONGVARCHAR:
- return "SQL_CONVERT_LONGVARCHAR";
- case SQL_CONVERT_NUMERIC:
- return "SQL_CONVERT_NUMERIC";
- case SQL_CONVERT_REAL:
- return "SQL_CONVERT_REAL";
- case SQL_CONVERT_SMALLINT:
- return "SQL_CONVERT_SMALLINT";
- case SQL_CONVERT_TIME:
- return "SQL_CONVERT_TIME";
- case SQL_CONVERT_TIMESTAMP:
- return "SQL_CONVERT_TIMESTAMP";
- case SQL_CONVERT_TINYINT:
- return "SQL_CONVERT_TINYINT";
- case SQL_CONVERT_VARBINARY:
- return "SQL_CONVERT_VARBINARY";
- case SQL_CONVERT_VARCHAR:
- return "SQL_CONVERT_VARCHAR";
- case SQL_CONVERT_FUNCTIONS:
- return "SQL_CONVERT_FUNCTIONS";
- case SQL_CORRELATION_NAME:
- return "SQL_CORRELATION_NAME";
- case SQL_CREATE_ASSERTION:
- return "SQL_CREATE_ASSERTION";
- case SQL_CREATE_CHARACTER_SET:
- return "SQL_CREATE_CHARACTER_SET";
- case SQL_CREATE_COLLATION:
- return "SQL_CREATE_COLLATION";
- case SQL_CREATE_DOMAIN:
- return "SQL_CREATE_DOMAIN";
- case SQL_CREATE_SCHEMA:
- return "SQL_CREATE_SCHEMA";
- case SQL_CREATE_TABLE:
- return "SQL_CREATE_TABLE";
- case SQL_CREATE_TRANSLATION:
- return "SQL_CREATE_TRANSLATION";
- case SQL_CREATE_VIEW:
- return "SQL_CREATE_VIEW";
- case SQL_CURSOR_COMMIT_BEHAVIOR:
- return "SQL_CURSOR_COMMIT_BEHAVIOR";
- case SQL_CURSOR_ROLLBACK_BEHAVIOR:
- return "SQL_CURSOR_ROLLBACK_BEHAVIOR";
- case SQL_CURSOR_SENSITIVITY:
- return "SQL_CURSOR_SENSITIVITY";
- case SQL_DATA_SOURCE_NAME:
- return "SQL_DATA_SOURCE_NAME";
- case SQL_DATA_SOURCE_READ_ONLY:
- return "SQL_DATA_SOURCE_READ_ONLY";
- case SQL_DATABASE_NAME:
- return "SQL_DATABASE_NAME";
- case SQL_DATETIME_LITERALS:
- return "SQL_DATETIME_LITERALS";
- case SQL_DBMS_NAME:
- return "SQL_DBMS_NAME";
- case SQL_DBMS_VER:
- return "SQL_DBMS_VER";
- case SQL_DDL_INDEX:
- return "SQL_DDL_INDEX";
- case SQL_DEFAULT_TXN_ISOLATION:
- return "SQL_DEFAULT_TXN_ISOLATION";
- case SQL_DESCRIBE_PARAMETER:
- return "SQL_DESCRIBE_PARAMETER";
- case SQL_DM_VER:
- return "SQL_DM_VER";
- case SQL_DRIVER_HDBC:
- return "SQL_DRIVER_HDBC";
- case SQL_DRIVER_HENV:
- return "SQL_DRIVER_HENV";
- case SQL_DRIVER_HDESC:
- return "SQL_DRIVER_HDESC";
- case SQL_DRIVER_HLIB:
- return "SQL_DRIVER_HLIB";
- case SQL_DRIVER_HSTMT:
- return "SQL_DRIVER_HSTMT";
- case SQL_DRIVER_NAME:
- return "SQL_DRIVER_NAME";
- case SQL_DRIVER_ODBC_VER:
- return "SQL_DRIVER_ODBC_VER";
- case SQL_DRIVER_VER:
- return "SQL_DRIVER_VER";
- case SQL_DROP_ASSERTION:
- return "SQL_DROP_ASSERTION";
- case SQL_DROP_CHARACTER_SET:
- return "SQL_DROP_CHARACTER_SET";
- case SQL_DROP_COLLATION:
- return "SQL_DROP_COLLATION";
- case SQL_DROP_DOMAIN:
- return "SQL_DROP_DOMAIN";
- case SQL_DROP_SCHEMA:
- return "SQL_DROP_SCHEMA";
- case SQL_DROP_TABLE:
- return "SQL_DROP_TABLE";
- case SQL_DROP_TRANSLATION:
- return "SQL_DROP_TRANSLATION";
- case SQL_DROP_VIEW:
- return "SQL_DROP_VIEW";
- case SQL_DYNAMIC_CURSOR_ATTRIBUTES1:
- return "SQL_DYNAMIC_CURSOR_ATTRIBUTES1";
- case SQL_DYNAMIC_CURSOR_ATTRIBUTES2:
- return "SQL_DYNAMIC_CURSOR_ATTRIBUTES2";
- case SQL_EXPRESSIONS_IN_ORDERBY:
- return "SQL_EXPRESSIONS_IN_ORDERBY";
- case SQL_FILE_USAGE:
- return "SQL_FILE_USAGE";
- case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1:
- return "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1";
- case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2:
- return "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2";
- case SQL_GETDATA_EXTENSIONS:
- return "SQL_GETDATA_EXTENSIONS";
- case SQL_GROUP_BY:
- return "SQL_GROUP_BY";
- case SQL_IDENTIFIER_CASE:
- return "SQL_IDENTIFIER_CASE";
- case SQL_IDENTIFIER_QUOTE_CHAR:
- return "SQL_IDENTIFIER_QUOTE_CHAR";
- case SQL_INDEX_KEYWORDS:
- return "SQL_INDEX_KEYWORDS";
- case SQL_INFO_SCHEMA_VIEWS:
- return "SQL_INFO_SCHEMA_VIEWS";
- case SQL_INSERT_STATEMENT:
- return "SQL_INSERT_STATEMENT";
- case SQL_INTEGRITY:
- return "SQL_INTEGRITY";
- case SQL_KEYSET_CURSOR_ATTRIBUTES1:
- return "SQL_KEYSET_CURSOR_ATTRIBUTES1";
- case SQL_KEYSET_CURSOR_ATTRIBUTES2:
- return "SQL_KEYSET_CURSOR_ATTRIBUTES2";
- case SQL_KEYWORDS:
- return "SQL_KEYWORDS";
- case SQL_LIKE_ESCAPE_CLAUSE:
- return "SQL_LIKE_ESCAPE_CLAUSE";
- case SQL_MAX_ASYNC_CONCURRENT_STATEMENTS:
- return "SQL_MAX_ASYNC_CONCURRENT_STATEMENTS";
- case SQL_MAX_BINARY_LITERAL_LEN:
- return "SQL_MAX_BINARY_LITERAL_LEN";
- case SQL_MAX_CATALOG_NAME_LEN:
- return "SQL_MAX_CATALOG_NAME_LEN";
- case SQL_MAX_CHAR_LITERAL_LEN:
- return "SQL_MAX_CHAR_LITERAL_LEN";
- case SQL_MAX_COLUMN_NAME_LEN:
- return "SQL_MAX_COLUMN_NAME_LEN";
- case SQL_MAX_COLUMNS_IN_GROUP_BY:
- return "SQL_MAX_COLUMNS_IN_GROUP_BY";
- case SQL_MAX_COLUMNS_IN_INDEX:
- return "SQL_MAX_COLUMNS_IN_INDEX";
- case SQL_MAX_COLUMNS_IN_ORDER_BY:
- return "SQL_MAX_COLUMNS_IN_ORDER_BY";
- case SQL_MAX_COLUMNS_IN_SELECT:
- return "SQL_MAX_COLUMNS_IN_SELECT";
- case SQL_MAX_COLUMNS_IN_TABLE:
- return "SQL_MAX_COLUMNS_IN_TABLE";
- case SQL_MAX_CONCURRENT_ACTIVITIES:
- return "SQL_MAX_CONCURRENT_ACTIVITIES";
- case SQL_MAX_CURSOR_NAME_LEN:
- return "SQL_MAX_CURSOR_NAME_LEN";
- case SQL_MAX_DRIVER_CONNECTIONS:
- return "SQL_MAX_DRIVER_CONNECTIONS";
- case SQL_MAX_IDENTIFIER_LEN:
- return "SQL_MAX_IDENTIFIER_LEN";
- case SQL_MAX_INDEX_SIZE:
- return "SQL_MAX_INDEX_SIZE";
- case SQL_MAX_PROCEDURE_NAME_LEN:
- return "SQL_MAX_PROCEDURE_NAME_LEN";
- case SQL_MAX_ROW_SIZE:
- return "SQL_MAX_ROW_SIZE";
- case SQL_MAX_ROW_SIZE_INCLUDES_LONG:
- return "SQL_MAX_ROW_SIZE_INCLUDES_LONG";
- case SQL_MAX_SCHEMA_NAME_LEN:
- return "SQL_MAX_SCHEMA_NAME_LEN";
- case SQL_MAX_STATEMENT_LEN:
- return "SQL_MAX_STATEMENT_LEN";
- case SQL_MAX_TABLE_NAME_LEN:
- return "SQL_MAX_TABLE_NAME_LEN";
- case SQL_MAX_TABLES_IN_SELECT:
- return "SQL_MAX_TABLES_IN_SELECT";
- case SQL_MAX_USER_NAME_LEN:
- return "SQL_MAX_USER_NAME_LEN";
- case SQL_MULT_RESULT_SETS:
- return "SQL_MULT_RESULT_SETS";
- case SQL_MULTIPLE_ACTIVE_TXN:
- return "SQL_MULTIPLE_ACTIVE_TXN";
- case SQL_NEED_LONG_DATA_LEN:
- return "SQL_NEED_LONG_DATA_LEN";
- case SQL_NON_NULLABLE_COLUMNS:
- return "SQL_NON_NULLABLE_COLUMNS";
- case SQL_NULL_COLLATION:
- return "SQL_NULL_COLLATION";
- case SQL_NUMERIC_FUNCTIONS:
- return "SQL_NUMERIC_FUNCTIONS";
- case SQL_ODBC_API_CONFORMANCE:
- return "SQL_ODBC_API_CONFORMANCE";
- case SQL_ODBC_INTERFACE_CONFORMANCE:
- return "SQL_ODBC_INTERFACE_CONFORMANCE";
- case SQL_ODBC_VER:
- return "SQL_ODBC_VER";
- case SQL_OJ_CAPABILITIES:
- return "SQL_OJ_CAPABILITIES";
- case SQL_ORDER_BY_COLUMNS_IN_SELECT:
- return "SQL_ORDER_BY_COLUMNS_IN_SELECT";
- case SQL_PARAM_ARRAY_ROW_COUNTS:
- return "SQL_PARAM_ARRAY_ROW_COUNTS";
- case SQL_PARAM_ARRAY_SELECTS:
- return "SQL_PARAM_ARRAY_SELECTS";
- case SQL_PROCEDURE_TERM:
- return "SQL_PROCEDURE_TERM";
- case SQL_PROCEDURES:
- return "SQL_PROCEDURES";
- case SQL_POS_OPERATIONS:
- return "SQL_POS_OPERATIONS";
- case SQL_QUOTED_IDENTIFIER_CASE:
- return "SQL_QUOTED_IDENTIFIER_CASE";
- case SQL_ROW_UPDATES:
- return "SQL_ROW_UPDATES";
- case SQL_SCHEMA_TERM:
- return "SQL_SCHEMA_TERM";
- case SQL_SCHEMA_USAGE:
- return "SQL_SCHEMA_USAGE";
- case SQL_SCROLL_OPTIONS:
- return "SQL_SCROLL_OPTIONS";
- case SQL_SEARCH_PATTERN_ESCAPE:
- return "SQL_SEARCH_PATTERN_ESCAPE";
- case SQL_SERVER_NAME:
- return "SQL_SERVER_NAME";
- case SQL_SPECIAL_CHARACTERS:
- return "SQL_SPECIAL_CHARACTERS";
- case SQL_SQL_CONFORMANCE:
- return "SQL_SQL_CONFORMANCE";
- case SQL_SQL92_DATETIME_FUNCTIONS:
- return "SQL_SQL92_DATETIME_FUNCTIONS";
- case SQL_SQL92_FOREIGN_KEY_DELETE_RULE:
- return "SQL_SQL92_FOREIGN_KEY_DELETE_RULE";
- case SQL_SQL92_FOREIGN_KEY_UPDATE_RULE:
- return "SQL_SQL92_FOREIGN_KEY_UPDATE_RULE";
- case SQL_SQL92_GRANT:
- return "SQL_SQL92_GRANT";
- case SQL_SQL92_NUMERIC_VALUE_FUNCTIONS:
- return "SQL_SQL92_NUMERIC_VALUE_FUNCTIONS";
- case SQL_SQL92_PREDICATES:
- return "SQL_SQL92_PREDICATES";
- case SQL_SQL92_RELATIONAL_JOIN_OPERATORS:
- return "SQL_SQL92_RELATIONAL_JOIN_OPERATORS";
- case SQL_SQL92_REVOKE:
- return "SQL_SQL92_REVOKE";
- case SQL_SQL92_ROW_VALUE_CONSTRUCTOR:
- return "SQL_SQL92_ROW_VALUE_CONSTRUCTOR";
- case SQL_SQL92_STRING_FUNCTIONS:
- return "SQL_SQL92_STRING_FUNCTIONS";
- case SQL_SQL92_VALUE_EXPRESSIONS:
- return "SQL_SQL92_VALUE_EXPRESSIONS";
- case SQL_STANDARD_CLI_CONFORMANCE:
- return "SQL_STANDARD_CLI_CONFORMANCE";
- case SQL_STATIC_CURSOR_ATTRIBUTES1:
- return "SQL_STATIC_CURSOR_ATTRIBUTES1";
- case SQL_STATIC_CURSOR_ATTRIBUTES2:
- return "SQL_STATIC_CURSOR_ATTRIBUTES2";
- case SQL_STRING_FUNCTIONS:
- return "SQL_STRING_FUNCTIONS";
- case SQL_SUBQUERIES:
- return "SQL_SUBQUERIES";
- case SQL_SYSTEM_FUNCTIONS:
- return "SQL_SYSTEM_FUNCTIONS";
- case SQL_TABLE_TERM:
- return "SQL_TABLE_TERM";
- case SQL_TIMEDATE_ADD_INTERVALS:
- return "SQL_TIMEDATE_ADD_INTERVALS";
- case SQL_TIMEDATE_DIFF_INTERVALS:
- return "SQL_TIMEDATE_DIFF_INTERVALS";
- case SQL_TIMEDATE_FUNCTIONS:
- return "SQL_TIMEDATE_FUNCTIONS";
- case SQL_TXN_CAPABLE:
- return "SQL_TXN_CAPABLE";
- case SQL_TXN_ISOLATION_OPTION:
- return "SQL_TXN_ISOLATION_OPTION";
- case SQL_UNION:
- return "SQL_UNION";
- case SQL_USER_NAME:
- return "SQL_USER_NAME";
- case SQL_XOPEN_CLI_YEAR:
- return "SQL_XOPEN_CLI_YEAR";
- }
-
- return "unknown";
-}
-
-
-/*!
- \brief Returns a string version of SQLRETURN.
-
- Returns a string version of SQLRETURN. This is great for
- returning more readable debug output.
-
- \param ret A SQLRETURN value.
-
- \return A string constant describing ret.
-
- \sa MYODBCDbgReturn
-*/
-QString MYODBCDbg::getReturnString( SQLRETURN nReturn )
-{
- switch ( nReturn )
- {
- case SQL_SUCCESS:
- return "SQL_SUCCESS";
- case SQL_SUCCESS_WITH_INFO:
- return "SQL_SUCCESS_WITH_INFO";
-#if (ODBCVER >= 0x0300)
- case SQL_NO_DATA:
- return "SQL_NO_DATA";
-#endif
- case SQL_ERROR:
- return "SQL_ERROR or SQL_NULL_DATA";
- case SQL_INVALID_HANDLE:
- return "SQL_INVALID_HANDLE or SQL_DATA_AT_EXEC";
- case SQL_STILL_EXECUTING:
- return "SQL_STILL_EXECUTING";
- case SQL_NEED_DATA:
- return "SQL_NEED_DATA";
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a statement attribute.
-
- Returns a string version of a statement attribute. This is great for
- returning more readable debug output.
-
- \param nAttribute An statement attribute.
-
- \return A string constant describing nAttribute.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getStmtAttrString( SQLINTEGER nAttribute )
-{
- switch ( nAttribute )
- {
- case SQL_ATTR_APP_PARAM_DESC:
- return "SQL_ATTR_APP_PARAM_DESC";
- case SQL_ATTR_APP_ROW_DESC:
- return "SQL_ATTR_APP_ROW_DESC";
- case SQL_ATTR_ASYNC_ENABLE:
- return "SQL_ATTR_ASYNC_ENABLE";
- case SQL_ATTR_CONCURRENCY:
- return "SQL_ATTR_CONCURRENCY";
- case SQL_ATTR_CURSOR_SCROLLABLE:
- return "SQL_ATTR_CURSOR_SCROLLABLE";
- case SQL_ATTR_CURSOR_SENSITIVITY:
- return "SQL_ATTR_CURSOR_SENSITIVITY";
- case SQL_ATTR_CURSOR_TYPE:
- return "SQL_ATTR_CURSOR_TYPE";
- case SQL_ATTR_ENABLE_AUTO_IPD:
- return "SQL_ATTR_ENABLE_AUTO_IPD";
- case SQL_ATTR_FETCH_BOOKMARK_PTR:
- return "SQL_ATTR_FETCH_BOOKMARK_PTR";
- case SQL_ATTR_IMP_PARAM_DESC:
- return "SQL_ATTR_IMP_PARAM_DESC";
- case SQL_ATTR_IMP_ROW_DESC:
- return "SQL_ATTR_IMP_ROW_DESC";
- case SQL_ATTR_KEYSET_SIZE:
- return "SQL_ATTR_KEYSET_SIZE";
- case SQL_ATTR_MAX_LENGTH:
- return "SQL_ATTR_MAX_LENGTH";
- case SQL_ATTR_MAX_ROWS:
- return "SQL_ATTR_MAX_ROWS";
- case SQL_ATTR_METADATA_ID:
- return "SQL_ATTR_METADATA_ID";
- case SQL_ATTR_NOSCAN:
- return "SQL_ATTR_NOSCAN";
- case SQL_ATTR_PARAM_BIND_OFFSET_PTR:
- return "SQL_ATTR_PARAM_BIND_OFFSET_PTR";
- case SQL_ATTR_PARAM_BIND_TYPE:
- return "SQL_ATTR_PARAM_BIND_TYPE";
- case SQL_ATTR_PARAM_OPERATION_PTR:
- return "SQL_ATTR_PARAM_OPERATION_PTR";
- case SQL_ATTR_PARAM_STATUS_PTR:
- return "SQL_ATTR_PARAM_STATUS_PTR";
- case SQL_ATTR_PARAMS_PROCESSED_PTR:
- return "SQL_ATTR_PARAMS_PROCESSED_PTR";
- case SQL_ATTR_PARAMSET_SIZE:
- return "SQL_ATTR_PARAMSET_SIZE";
- case SQL_ATTR_QUERY_TIMEOUT:
- return "SQL_ATTR_QUERY_TIMEOUT";
- case SQL_ATTR_RETRIEVE_DATA:
- return "SQL_ATTR_RETRIEVE_DATA";
- case SQL_ATTR_ROW_ARRAY_SIZE:
- return "SQL_ATTR_ROW_ARRAY_SIZE";
- case SQL_ATTR_ROW_BIND_OFFSET_PTR:
- return "SQL_ATTR_ROW_BIND_OFFSET_PTR";
- case SQL_ATTR_ROW_BIND_TYPE:
- return "SQL_ATTR_ROW_BIND_TYPE";
- case SQL_ATTR_ROW_NUMBER:
- return "SQL_ATTR_ROW_NUMBER";
- case SQL_ATTR_ROW_OPERATION_PTR:
- return "SQL_ATTR_ROW_OPERATION_PTR";
- case SQL_ATTR_ROW_STATUS_PTR:
- return "SQL_ATTR_ROW_STATUS_PTR";
- case SQL_ATTR_ROWS_FETCHED_PTR:
- return "SQL_ATTR_ROWS_FETCHED_PTR";
- case SQL_ATTR_SIMULATE_CURSOR:
- return "SQL_ATTR_SIMULATE_CURSOR";
- case SQL_ATTR_USE_BOOKMARKS:
- return "SQL_ATTR_USE_BOOKMARKS";
- }
-
- return "unknown";
-}
-
-/*!
- \brief Returns a string version of a statement option.
-
- Returns a string version of a statement option. This is great for
- returning more readable debug output.
-
- \param nOption An statement attribute.
-
- \return A string constant describing nOption.
-
- \sa MYODBCDbgPrint
- MYODBCDbgPrint2
-*/
-QString MYODBCDbg::getStmtOptionString( SQLUSMALLINT nOption )
-{
- switch ( nOption )
- {
- case SQL_ASYNC_ENABLE:
- return "SQL_ASYNC_ENABLE";
- case SQL_BIND_TYPE:
- return "SQL_BIND_TYPE";
- case SQL_CONCURRENCY:
- return "SQL_CONCURRENCY";
- case SQL_CURSOR_TYPE:
- return "SQL_CURSOR_TYPE";
- case SQL_GET_BOOKMARK:
- return "SQL_GET_BOOKMARK";
- case SQL_KEYSET_SIZE:
- return "SQL_KEYSET_SIZE";
- case SQL_MAX_LENGTH:
- return "SQL_MAX_LENGTH";
- case SQL_MAX_ROWS:
- return "SQL_MAX_ROWS";
- case SQL_NOSCAN:
- return "SQL_NOSCAN";
- case SQL_QUERY_TIMEOUT:
- return "SQL_QUERY_TIMEOUT";
- case SQL_RETRIEVE_DATA:
- return "SQL_RETRIEVE_DATA";
- case SQL_ROWSET_SIZE:
- return "SQL_ROWSET_SIZE";
- case SQL_ROW_NUMBER:
- return "SQL_ROW_NUMBER";
- case SQL_SIMULATE_CURSOR:
- return "SQL_SIMULATE_CURSOR";
- case SQL_USE_BOOKMARKS:
- return "SQL_USE_BOOKMARKS";
- }
-
- return "unknown";
-}
-
Modified: MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.cpp
===================================================================
--- MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -27,32 +27,53 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <QtTest/QtTest>
+#include <QString>
+#include <QFile>
#include <MYODBCDbg.h>
-typedef struct tTEST
-{
- char * name;
- int (*pfunc)();
-} TEST;
-
-QString stringOutput;
QString stringOutputExpected =\
" [ENTER ] \n\
-.\\MYODBCDbgTest.cpp:61: test1\n\
+.\\MYODBCDbgTest.cpp:82: slotCreateOutput\n\
[INFO ] \n\
-.\\MYODBCDbgTest.cpp:62: test1\n\
+.\\MYODBCDbgTest.cpp:83: slotCreateOutput\n\
[INFO ] Got here\n\
-.\\MYODBCDbgTest.cpp:63: test1\n\
+.\\MYODBCDbgTest.cpp:84: slotCreateOutput\n\
[INFO ] gpMYODBCDbg = 55\n\
-.\\MYODBCDbgTest.cpp:64: test1\n\
+.\\MYODBCDbgTest.cpp:85: slotCreateOutput\n\
[ERROR ] Ooops\n\
-.\\MYODBCDbgTest.cpp:65: test1\n\
+.\\MYODBCDbgTest.cpp:86: slotCreateOutput\n\
[WARNING] That smarts\n\
-.\\MYODBCDbgTest.cpp:67: test1\n\
+.\\MYODBCDbgTest.cpp:88: slotCreateOutput\n\
[RETURN ] SQL_SUCCESS\n";
+
+class MYODBCDbgTest : public QObject
+{
+ Q_OBJECT
+public:
+ MYODBCDbgTest();
+ ~MYODBCDbgTest();
+ QString stringOutput;
+
+private slots:
+ int slotCreateOutput();
+ void slotVerifyOutput();
+};
+
+MYODBCDbgTest::MYODBCDbgTest()
+{
+ MYODBCDbgInit( &stringOutput );
+}
+
+MYODBCDbgTest::~MYODBCDbgTest()
+{
+ MYODBCDbgFini();
+}
+
+
/* create some output */
-int test1()
+int MYODBCDbgTest::slotCreateOutput()
{
int n = 55;
@@ -68,46 +89,12 @@
}
/* verify output */
-int test2()
+void MYODBCDbgTest::slotVerifyOutput()
{
- if ( stringOutput != stringOutputExpected )
- return SQL_ERROR;
-
- return SQL_SUCCESS;
+ QCOMPARE( stringOutput, stringOutputExpected );
}
-/* \todo The main thing here is that we build and execute ok - but in future read output
file to ensure that it is what we expect */
-int main()
-{
- TEST tests[3]=
- {
- {"test1", test1},
- {"test2", test2},
- {NULL, NULL}
- };
- int n;
- int nReturn = 0;
- MYODBCDbgInit( stdout );
-// MYODBCDbgInit( &stringOutput );
+QTEST_MAIN( MYODBCDbgTest )
+#include "MYODBCDbgTest.moc"
- for ( n = 0; tests[n].name; n++ )
- {
- printf( "%-40s", tests[n].name );
- if ( tests[n].pfunc() == SQL_SUCCESS )
- printf( "[ OK ]\n" );
- else
- {
- printf( "[FAILED]\n" );
- nReturn = 1;
- goto testExit1;
- }
- }
-
-testExit1:
- MYODBCDbgFini();
-
- return nReturn;
-}
-
-
Modified: MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.pro
===================================================================
--- MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDbg/MYODBCDbgTest/MYODBCDbgTest.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -7,11 +7,12 @@
include( ../../common.pri )
include( ../../config.pri )
include( ../../defines.pri )
-CONFIG += console
+CONFIG += qtestlib
INCLUDEPATH += ../../MYODBCC/include
INCLUDEPATH += ../include
LIBS += -L../../lib
LIBS += -lMYODBCDbg
+LIBS += -lMYODBCC
# #########################################################
# FILES
Modified: MYODBCDbg/include/MYODBCDbg.h
===================================================================
--- MYODBCDbg/include/MYODBCDbg.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDbg/include/MYODBCDbg.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -54,17 +54,6 @@
virtual void doNestLevel();
- static QString getConnectAttrString( SQLINTEGER nAttribute );
- static QString getConnectOptionString( SQLUSMALLINT nOption );
- static QString getDiagFieldString( SQLSMALLINT nDiagField );
- static QString getEnvAttrString( SQLINTEGER nAttribute );
- static QString getFunctionsString( SQLUSMALLINT nFunction );
- static QString getHandleTypeString( SQLSMALLINT nHandleType );
- static QString getInfoTypeString( SQLUSMALLINT nInfoType );
- static QString getReturnString( SQLRETURN nReturn );
- static QString getStmtAttrString( SQLINTEGER nAttribute );
- static QString getStmtOptionString( SQLUSMALLINT nOption );
-
protected:
int nNestLevel;
};
Modified: MYODBCDes/MYODBCDesLib/MYODBCDes.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDes.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDes/MYODBCDesLib/MYODBCDes.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -375,6 +375,15 @@
MYODBCDbgReturn3( "%p", pnRowsProcessedPtr );
}
+MYODBCDesRec *MYODBCDes::getRec( unsigned int nRec )
+{
+ MYODBCDbgEnter();
+
+ Q_ASSERT( nRec >= vectorRecords.count() );
+
+ MYODBCDbgReturn3( "%p", vectorRecords[nRec] );
+}
+
SQLHANDLE MYODBCDes::getOwner()
{
MYODBCDbgEnter();
@@ -423,6 +432,31 @@
MYODBCDbgReturn2();
}
+int MYODBCDes::doTruncateUnboundRecords()
+{
+ MYODBCDbgEnter();
+
+ int nRecordsDeleted = 0;
+
+ /* process from eof to bof, delete records which are unbound, stop at first bound
record */
+ QMutableVectorIterator<MYODBCDesRec*> i( vectorRecords );
+ i.toBack();
+ while ( i.hasPrevious() )
+ {
+ MYODBCDesRec *pdesrec = i.previous();
+
+ /* do not delete bound records */
+ if ( pdesrec->isBound() )
+ break;
+
+ i.remove();
+ delete pdesrec;
+ nRecordsDeleted++;
+ }
+
+ MYODBCDbgReturn3( "%d", nRecordsDeleted );
+}
+
MYODBCDes &MYODBCDes::operator=( MYODBCDes &des )
{
des.doClear();
Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -538,14 +538,14 @@
break;
case SQL_DESC_BASE_COLUMN_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getBaseColumnName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getBaseColumnName().utf16() );
*pnStringLengthPtr = getBaseColumnName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
break;
case SQL_DESC_BASE_TABLE_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getBaseTableName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getBaseTableName().utf16() );
*pnStringLengthPtr = getBaseTableName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -556,7 +556,7 @@
break;
case SQL_DESC_CATALOG_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getCatalogName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getCatalogName().utf16() );
*pnStringLengthPtr = getCatalogName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -599,7 +599,7 @@
break;
case SQL_DESC_LABEL:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLabel().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLabel().utf16() );
*pnStringLengthPtr = getLabel().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -610,28 +610,28 @@
break;
case SQL_DESC_LITERAL_PREFIX:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLiteralPrefix().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLiteralPrefix().utf16() );
*pnStringLengthPtr = getLiteralPrefix().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
break;
case SQL_DESC_LITERAL_SUFFIX:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLiteralSuffix().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLiteralSuffix().utf16() );
*pnStringLengthPtr = getLiteralSuffix().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
break;
case SQL_DESC_LOCAL_TYPE_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLocalTypeName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getLocalTypeName().utf16() );
*pnStringLengthPtr = getLocalTypeName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
break;
case SQL_DESC_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getName().utf16() );
*pnStringLengthPtr = getName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -666,7 +666,7 @@
break;
case SQL_DESC_SCHEMA_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getSchemaName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getSchemaName().utf16() );
*pnStringLengthPtr = getSchemaName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -677,7 +677,7 @@
break;
case SQL_DESC_TABLE_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getTableName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getTableName().utf16() );
*pnStringLengthPtr = getTableName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -688,7 +688,7 @@
break;
case SQL_DESC_TYPE_NAME:
- MYODBCCstrncpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getTypeName().utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pValuePtr, nBufferLength / sizeof(SQLWCHAR),
getTypeName().utf16() );
*pnStringLengthPtr = getTypeName().length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
@@ -967,6 +967,13 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
+bool MYODBCDesRec::isBound()
+{
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn3( "%d", ( pDataPtr ? true : false ) );
+}
+
MYODBCDesRec &MYODBCDesRec::operator=( MYODBCDesRec &desrec )
{
desrec.nAutoUniqueValue = nAutoUniqueValue;
Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -405,9 +405,7 @@
{
MYODBCDbgEnter();
- SQLRETURN nReturn = setConciseTypeC( nConciseType );
-
- MYODBCDbgReturn( nReturn );
+ MYODBCDbgReturn( setConciseTypeC( nConciseType ) );
}
SQLRETURN MYODBCDesRecARD::setDefault( SQLSMALLINT nConciseType )
Modified: MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro
===================================================================
--- MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -18,6 +18,7 @@
LIBS += -lMYODBCDes
LIBS += -lMYODBCDia
LIBS += -lMYODBCDbg
+LIBS += -lMYODBCC
# #########################################################
# FILES
Modified: MYODBCDes/include/MYODBCDes.h
===================================================================
--- MYODBCDes/include/MYODBCDes.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDes/include/MYODBCDes.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -98,13 +98,15 @@
virtual SQLUINTEGER getBindType();
virtual SQLSMALLINT getCount();
virtual SQLUINTEGER * getRowsProcessedPtr();
+ MYODBCDesRec * getRec( unsigned int nRec );
SQLHANDLE getOwner();
MYODBCDia * getDia();
/* do'ers */
- virtual MYODBCDesRec *doAppend() = 0; /*!< Append descriptor record. Use
this to avoid mismatched record types. */
- virtual SQLRETURN doAppend( SQLSMALLINT nConciseType, const QString &stringName,
SQLSMALLINT nNullable = SQL_NULLABLE, SQLSMALLINT nUnsigned = SQL_TRUE );
- virtual void doClear();
+ virtual MYODBCDesRec * doAppend() = 0; /*!< Append descriptor record.
Use this to avoid mismatched record types. */
+ virtual SQLRETURN doAppend( SQLSMALLINT nConciseType, const QString
&stringName, SQLSMALLINT nNullable = SQL_NULLABLE, SQLSMALLINT nUnsigned = SQL_TRUE
);
+ virtual void doClear();
+ virtual int doTruncateUnboundRecords();
/* operators */
virtual MYODBCDes &operator=( MYODBCDes &des );
Modified: MYODBCDes/include/MYODBCDesRec.h
===================================================================
--- MYODBCDes/include/MYODBCDesRec.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDes/include/MYODBCDesRec.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -118,6 +118,9 @@
/* do'rs */
virtual SQLRETURN doUnbind();
+ /* is'rs */
+ virtual bool isBound();
+
/* operators */
virtual MYODBCDesRec &operator=( MYODBCDesRec &des );
Modified: MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -170,7 +170,7 @@
if ( nBufferLength < 1 || stringDynamicFunction.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringDynamicFunction.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringDynamicFunction.utf16() );
*pnStringLengthPtr = stringDynamicFunction.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
Modified: MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -283,7 +283,7 @@
if ( nBufferLength < 1 || stringClassOrigin.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringClassOrigin.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringClassOrigin.utf16() );
*pnStringLengthPtr = stringClassOrigin.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
@@ -301,7 +301,7 @@
if ( nBufferLength < 1 || stringConnectionName.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringConnectionName.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringConnectionName.utf16() );
*pnStringLengthPtr = stringConnectionName.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
@@ -315,7 +315,7 @@
if ( nBufferLength < 1 || stringMessageText.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringMessageText.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringMessageText.utf16() );
*pnStringLengthPtr = stringMessageText.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
@@ -337,7 +337,7 @@
if ( nBufferLength < 1 || stringServerName.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringServerName.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringServerName.utf16() );
*pnStringLengthPtr = stringServerName.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
@@ -351,7 +351,7 @@
if ( nBufferLength < 1 || stringSQLState.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringSQLState.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringSQLState.utf16() );
*pnStringLengthPtr = stringSQLState.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
@@ -365,7 +365,7 @@
if ( nBufferLength < 1 || stringSubClassOrigin.isNull() )
MYODBCDbgReturn( SQL_ERROR );
- MYODBCCstrncpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringSubClassOrigin.utf16(), _TRUNCATE );
+ MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringSubClassOrigin.utf16() );
*pnStringLengthPtr = stringSubClassOrigin.length() * sizeof(SQLWCHAR);
if ( *pnStringLengthPtr > nBufferLength )
Modified: MYODBCDia/MYODBCDiaTest/MYODBCDiaTest.pro
===================================================================
--- MYODBCDia/MYODBCDiaTest/MYODBCDiaTest.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDia/MYODBCDiaTest/MYODBCDiaTest.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -13,7 +13,9 @@
INCLUDEPATH += ../../MYODBCDbg/include
INCLUDEPATH += ../include
LIBS += -L../../lib
-LIBS += -lMYODBCDia -lMYODBCDbg
+LIBS += -lMYODBCDia
+LIBS += -lMYODBCDbg
+LIBS += -lMYODBCC
# #########################################################
# FILES
Modified: MYODBCDia/include/MYODBCDia.h
===================================================================
--- MYODBCDia/include/MYODBCDia.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCDia/include/MYODBCDia.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -92,7 +92,7 @@
QString getConnectionName();
QString getServerName();
- SQLRETURN doAppend( MYODBC_DIA_ID nState, SQLINTEGER nNative, const QString
&stringMessage );
+ SQLRETURN doAppend( MYODBC_DIA_ID nState, SQLINTEGER nNative = 0, const QString
&stringMessage = QString::null );
SQLRETURN doAppend( MYODBC_DIA_ID nState, SQLINTEGER nNative, const QString
&stringMessage, SQLINTEGER nRowNumber, SQLINTEGER nColumnNumber );
void doClear();
SQLRETURN doDelete( SQLSMALLINT nRecNumber );
Modified: MYODBCIns/MYODBCInsLib/MYODBCIns.cpp
===================================================================
--- MYODBCIns/MYODBCInsLib/MYODBCIns.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/MYODBCInsLib/MYODBCIns.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -30,7 +30,9 @@
RETCODE MYODBCIns::setError( const QString &stringMessage, DWORD nErrorCode )
{
- return SQLPostInstallerError( nErrorCode, stringMessage.utf16() );
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn( SQLPostInstallerError( nErrorCode, stringMessage.utf16() ) );
}
@@ -50,6 +52,8 @@
*/
QStringList MYODBCIns::getDriverNames()
{
+ MYODBCDbgEnter();
+
SQLWCHAR szBuffer[50000];
int nChars = 0;
int nChar = 0;
@@ -59,8 +63,8 @@
nChars = ( SQLGetInstalledDrivers( szBuffer, sizeof(szBuffer) / sizeof(SQLWCHAR),
NULL ) ? 1 : 0 );
if ( nChars < 1 )
{
- MYODBCCfprintf( stderr, L"[%s][%d][INFO] Call returned no data. Could be an error
or just no data to return.\n", TEXT(__FILE__), __LINE__ );
- return stringlistFriendlyNames;
+ MYODBCDbgInfo( "Call returned no data. Could be an error or just no data to
return.", "" );
+ MYODBCDbgReturn3( "%s", stringlistFriendlyNames );
}
/*! \warning assumes that we are *not* using wide char :o */
@@ -81,11 +85,13 @@
}
}
- return stringlistFriendlyNames;
+ MYODBCDbgReturn3( "%s", stringlistFriendlyNames );
}
QStringList MYODBCIns::getDataSourceNames( MYODBC_INS_DATASOURCE_SCOPE nScope )
{
+ MYODBCDbgEnter();
+
SQLWCHAR szBuffer[50000];
int nChars = 0;
int nChar = 0;
@@ -94,7 +100,7 @@
UWORD nScopeToRestore = ODBC_BOTH_DSN;
if ( !SQLGetConfigMode( &nScopeToRestore ) )
- return stringlistFriendlyNames;
+ MYODBCDbgReturn3( "%s", stringlistFriendlyNames );
SQLSetConfigMode( (UWORD)nScope );
@@ -123,11 +129,13 @@
getDataSourceNamesExit1:
SQLSetConfigMode( nScopeToRestore );
- return stringlistFriendlyNames;
+ MYODBCDbgReturn3( "%s", stringlistFriendlyNames );
}
QString MYODBCIns::getDefaultInstallLocation()
{
+ MYODBCDbgEnter();
+
QString stringDefaultInstallLocation;
SQLWCHAR szPathOut[1024];
WORD nPathOutLength = 0;
@@ -135,16 +143,18 @@
SQLWCHAR * pszAttributes = MYODBCInsDriver::getAttributesNullDelim( "bogusname",
"bogusdriver", "bogussetup" );
BOOL bRetCode = SQLInstallDriverEx( pszAttributes, NULL, szPathOut,
sizeof(szPathOut) / sizeof(SQLWCHAR), &nPathOutLength, ODBC_INSTALL_INQUIRY,
&nUsageCount );
- MYODBCCFree( pszAttributes );
+ MYODBCC::doFree( pszAttributes );
if ( bRetCode )
stringDefaultInstallLocation = QString::fromUtf16( szPathOut );
- return stringDefaultInstallLocation;
+ MYODBCDbgReturn3( "%s", stringDefaultInstallLocation );
}
RETCODE MYODBCIns::getError( WORD nError, DWORD *pnErrorCode, QString &stringMessage
)
{
+ MYODBCDbgEnter();
+
SQLWCHAR szMessage[32000];
WORD nMessageLen;
@@ -153,11 +163,13 @@
if ( SQL_SUCCEEDED(nRetCode) )
stringMessage = QString::fromUtf16( szMessage );
- return nRetCode;
+ MYODBCDbgReturn( nRetCode );
}
QString MYODBCIns::getError( WORD nError )
{
+ MYODBCDbgEnter();
+
DWORD nErrorCode = 0;
QString stringMessage;
QString stringMessageEnhanced;
@@ -166,16 +178,18 @@
if ( SQL_SUCCEEDED(nRetCode) )
{
stringMessageEnhanced = QString( "[%1][%2] %3" )
- .arg( getErrorString( nErrorCode ) )
+ .arg( MYODBCC::getInstallerErrorString( nErrorCode ) )
.arg( nErrorCode )
.arg( stringMessage );
}
- return stringMessageEnhanced;
+ MYODBCDbgReturn3( "%s", stringMessageEnhanced );
}
QStringList MYODBCIns::getErrors()
{
+ MYODBCDbgEnter();
+
QStringList stringlistErrors;
/* 8 because this is max according to MS ver of ODBC spec */
@@ -187,75 +201,23 @@
stringlistErrors += stringError;
}
- return stringlistErrors;
+ MYODBCDbgReturn3( "%s", stringlistErrors );
}
-QString MYODBCIns::getErrorString( WORD nError )
-{
- switch ( nError )
- {
- case ODBC_ERROR_GENERAL_ERR:
- return "ODBC_ERROR_GENERAL_ERR";
- case ODBC_ERROR_INVALID_BUFF_LEN:
- return "ODBC_ERROR_INVALID_BUFF_LEN";
- case ODBC_ERROR_INVALID_HWND:
- return "ODBC_ERROR_INVALID_HWND";
- case ODBC_ERROR_INVALID_STR:
- return "ODBC_ERROR_INVALID_STR";
- case ODBC_ERROR_INVALID_REQUEST_TYPE:
- return "ODBC_ERROR_INVALID_REQUEST_TYPE";
- case ODBC_ERROR_COMPONENT_NOT_FOUND:
- return "ODBC_ERROR_COMPONENT_NOT_FOUND";
- case ODBC_ERROR_INVALID_NAME:
- return "ODBC_ERROR_INVALID_NAME";
- case ODBC_ERROR_INVALID_KEYWORD_VALUE:
- return "ODBC_ERROR_INVALID_KEYWORD_VALUE";
- case ODBC_ERROR_INVALID_DSN:
- return "ODBC_ERROR_INVALID_DSN";
- case ODBC_ERROR_INVALID_INF:
- return "ODBC_ERROR_INVALID_INF";
- case ODBC_ERROR_REQUEST_FAILED:
- return "ODBC_ERROR_REQUEST_FAILED";
- case ODBC_ERROR_INVALID_PATH:
- return "ODBC_ERROR_INVALID_PATH";
- case ODBC_ERROR_LOAD_LIB_FAILED:
- return "ODBC_ERROR_LOAD_LIB_FAILED";
- case ODBC_ERROR_INVALID_PARAM_SEQUENCE:
- return "ODBC_ERROR_INVALID_PARAM_SEQUENCE";
- case ODBC_ERROR_INVALID_LOG_FILE:
- return "ODBC_ERROR_INVALID_LOG_FILE";
- case ODBC_ERROR_USER_CANCELED:
- return "ODBC_ERROR_USER_CANCELED";
- case ODBC_ERROR_USAGE_UPDATE_FAILED:
- return "ODBC_ERROR_USAGE_UPDATE_FAILED";
- case ODBC_ERROR_CREATE_DSN_FAILED:
- return "ODBC_ERROR_CREATE_DSN_FAILED";
- case ODBC_ERROR_WRITING_SYSINFO_FAILED:
- return "ODBC_ERROR_WRITING_SYSINFO_FAILED";
- case ODBC_ERROR_REMOVE_DSN_FAILED:
- return "ODBC_ERROR_REMOVE_DSN_FAILED";
- case ODBC_ERROR_OUT_OF_MEM:
- return "ODBC_ERROR_OUT_OF_MEM";
- case ODBC_ERROR_OUTPUT_STRING_TRUNCATED:
- return "ODBC_ERROR_OUTPUT_STRING_TRUNCATED";
- }
-
- return "unknown";
-}
-
-
bool MYODBCIns::isExistsDataSourceName( const QString &stringDataSourceName,
MYODBC_INS_DATASOURCE_SCOPE nScope )
{
+ MYODBCDbgEnter();
+
SQLWCHAR szSectionNames[SQL_MAX_DSN_LENGTH * MYODBC_INS_MAX_DSN_NAMES];
SQLWCHAR * pszSectionName;
bool bReturn = false;
UWORD nScopeToRestore = ODBC_BOTH_DSN;
if ( !SQLGetConfigMode( &nScopeToRestore ) )
- return bReturn;
+ MYODBCDbgReturn3( "%d", bReturn );
if ( stringDataSourceName.isEmpty() )
- return bReturn;
+ MYODBCDbgReturn3( "%d", bReturn );
SQLSetConfigMode( (UWORD)nScope );
@@ -298,13 +260,13 @@
bReturn = true;
goto isExistsDataSourceNameExit1;
}
- pszSectionName += MYODBCCstrlen( pszSectionName ) + 1;
+ pszSectionName += MYODBCC::getStrLen( pszSectionName, SQL_MAX_DSN_LENGTH *
MYODBC_INS_MAX_DSN_NAMES ) + 1;
}
isExistsDataSourceNameExit1:
SQLSetConfigMode( nScopeToRestore );
- return bReturn;
+ MYODBCDbgReturn3( "%d", bReturn );
}
Modified: MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp
===================================================================
--- MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/MYODBCInsLib/MYODBCInsDataSource.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -32,6 +32,8 @@
MYODBCInsDataSource::MYODBCInsDataSource( MYODBC_INS_DATASOURCE_MODE nMode )
{
+ MYODBCDbgEnter();
+
UWORD n = MYODBC_INS_DATASOURCE_SCOPE_BOTH;
this->nMode = nMode;
@@ -42,160 +44,218 @@
bool MYODBCInsDataSource::setDriverFileName( const QString &stringDriverFileName )
{
+ MYODBCDbgEnter();
+
this->stringDriverFileName = stringDriverFileName;
return true;
}
bool MYODBCInsDataSource::setDSN( const QString &stringDSN )
{
+ MYODBCDbgEnter();
+
this->stringDSN = stringDSN;
return true;
}
bool MYODBCInsDataSource::setDRIVER( const QString &stringDRIVER )
{
+ MYODBCDbgEnter();
+
this->stringDRIVER = stringDRIVER;
return true;
}
bool MYODBCInsDataSource::setDESCRIPTION( const QString &stringDESCRIPTION )
{
+ MYODBCDbgEnter();
+
this->stringDESCRIPTION = stringDESCRIPTION;
return true;
}
bool MYODBCInsDataSource::setSERVER( const QString &stringSERVER )
{
+ MYODBCDbgEnter();
+
this->stringSERVER = stringSERVER;
return true;
}
bool MYODBCInsDataSource::setUSER( const QString &stringUSER )
{
+ MYODBCDbgEnter();
+
this->stringUSER = stringUSER;
return true;
}
bool MYODBCInsDataSource::setPASSWORD( const QString &stringPASSWORD )
{
+ MYODBCDbgEnter();
+
this->stringPASSWORD = stringPASSWORD;
return true;
}
bool MYODBCInsDataSource::setDATABASE( const QString &stringDATABASE )
{
+ MYODBCDbgEnter();
+
this->stringDATABASE = stringDATABASE;
return true;
}
bool MYODBCInsDataSource::setPORT( const QString &stringPORT )
{
+ MYODBCDbgEnter();
+
this->stringPORT = stringPORT;
return true;
}
bool MYODBCInsDataSource::setSOCKET( const QString &stringSOCKET )
{
+ MYODBCDbgEnter();
+
this->stringSOCKET = stringSOCKET;
return true;
}
bool MYODBCInsDataSource::setSTMT( const QString &stringSTMT )
{
+ MYODBCDbgEnter();
+
this->stringSTMT = stringSTMT;
return true;
}
bool MYODBCInsDataSource::setOPTION( const QString &stringOPTION )
{
+ MYODBCDbgEnter();
+
this->stringOPTION = stringOPTION;
return true;
}
bool MYODBCInsDataSource::setMode( MYODBC_INS_DATASOURCE_MODE nMode )
{
+ MYODBCDbgEnter();
+
this->nMode = nMode;
return true;
}
bool MYODBCInsDataSource::setScope( MYODBC_INS_DATASOURCE_SCOPE nScope )
{
+ MYODBCDbgEnter();
+
this->nScope = nScope;
return true;
}
QString MYODBCInsDataSource::getDriverFileName()
{
+ MYODBCDbgEnter();
+
return stringDriverFileName;
}
QString MYODBCInsDataSource::getDSN()
{
+ MYODBCDbgEnter();
+
return stringDSN;
}
QString MYODBCInsDataSource::getDRIVER()
{
+ MYODBCDbgEnter();
+
return stringDRIVER;
}
QString MYODBCInsDataSource::getDESCRIPTION()
{
+ MYODBCDbgEnter();
+
return stringDESCRIPTION;
}
QString MYODBCInsDataSource::getSERVER()
{
+ MYODBCDbgEnter();
+
return stringSERVER;
}
QString MYODBCInsDataSource::getUSER()
{
+ MYODBCDbgEnter();
+
return stringUSER;
}
QString MYODBCInsDataSource::getPASSWORD()
{
+ MYODBCDbgEnter();
+
return stringPASSWORD;
}
QString MYODBCInsDataSource::getDATABASE()
{
+ MYODBCDbgEnter();
+
return stringDATABASE;
}
QString MYODBCInsDataSource::getPORT()
{
+ MYODBCDbgEnter();
+
return stringPORT;
}
QString MYODBCInsDataSource::getSOCKET()
{
+ MYODBCDbgEnter();
+
return stringSOCKET;
}
QString MYODBCInsDataSource::getSTMT()
{
+ MYODBCDbgEnter();
+
return stringSTMT;
}
QString MYODBCInsDataSource::getOPTION()
{
+ MYODBCDbgEnter();
+
return stringOPTION;
}
MYODBC_INS_DATASOURCE_MODE MYODBCInsDataSource::getMode()
{
+ MYODBCDbgEnter();
+
return nMode;
}
MYODBC_INS_DATASOURCE_SCOPE MYODBCInsDataSource::getScope()
{
+ MYODBCDbgEnter();
+
return nScope;
}
bool MYODBCInsDataSource::doRead( const QString &stringDataSourceName,
MYODBC_INS_DATASOURCE_SCOPE nScope )
{
+ MYODBCDbgEnter();
+
SQLWCHAR szEntryNames[SQL_MAX_DSN_LENGTH * MYODBC_INS_MAX_DSN_NAMES];
SQLWCHAR * pszEntryName;
SQLWCHAR szValue[4096];
@@ -217,7 +277,7 @@
#if defined(WIN32)
{
- int nLen = MYODBCCstrlen( szEntryNames );
+ int nLen = MYODBCC::getStrLen( szEntryNames, SQL_MAX_DSN_LENGTH *
MYODBC_INS_MAX_DSN_NAMES );
/*!
\note XP
@@ -337,13 +397,13 @@
else
{
/* What the ? */
- MYODBCCfprintf( stderr, L"\n[%s][%d][ERROR] Unknown attribute (%s).\n",
TEXT(__FILE__), __LINE__, pszEntryName );
+ MYODBCDbgError( "Unknown attribute (%s).", pszEntryName );
}
}
else
- MYODBCCfprintf( stderr, L"\n[%s][%d][WARNING] Failed to get value for
attribute (%s).\n", TEXT(__FILE__), __LINE__, pszEntryName );
+ MYODBCDbgWarning( "Failed to get value for attribute (%s).", pszEntryName );
- pszEntryName += MYODBCCstrlen( pszEntryName ) + 1;
+ pszEntryName += MYODBCC::getStrLen( pszEntryName, SQL_MAX_DSN_LENGTH *
MYODBC_INS_MAX_DSN_NAMES ) + 1;
} /* while */
@@ -367,7 +427,7 @@
break;
}
}
- pszEntryName += MYODBCCstrlen( pszEntryName ) + 1;
+ pszEntryName += MYODBCC::getStrLen( pszEntryName, SQL_MAX_DSN_LENGTH *
MYODBC_INS_MAX_DSN_NAMES ) + 1;
}
}
@@ -390,16 +450,22 @@
bool MYODBCInsDataSource::doRead( const QString &stringDataSourceName )
{
+ MYODBCDbgEnter();
+
return doRead( stringDataSourceName, nScope );
}
bool MYODBCInsDataSource::doRead()
{
+ MYODBCDbgEnter();
+
return doRead( stringDSN, nScope );
}
bool MYODBCInsDataSource::doWrite( MYODBC_INS_DATASOURCE_SCOPE nScope )
{
+ MYODBCDbgEnter();
+
bool bReturn = false;
UWORD nScopeToRestore = ODBC_BOTH_DSN;
@@ -460,11 +526,15 @@
bool MYODBCInsDataSource::doWrite()
{
+ MYODBCDbgEnter();
+
return doWrite( nScope );
}
void MYODBCInsDataSource::doClear()
{
+ MYODBCDbgEnter();
+
/* do not change the nMode nor nScope */
stringDATABASE = QString::null;
stringDESCRIPTION = QString::null;
@@ -482,6 +552,8 @@
bool MYODBCInsDataSource::doDelete( const QString &stringDataSourceName )
{
+ MYODBCDbgEnter();
+
return SQLRemoveDSNFromIni( stringDataSourceName.utf16() );
}
Modified: MYODBCIns/MYODBCInsLib/MYODBCInsDriver.cpp
===================================================================
--- MYODBCIns/MYODBCInsLib/MYODBCInsDriver.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/MYODBCInsLib/MYODBCInsDriver.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -31,74 +31,97 @@
bool MYODBCInsDriver::setFriendlyName( const QString &stringFriendlyName )
{
+ MYODBCDbgEnter();
+
this->stringFriendlyName = stringFriendlyName;
- return true;
+
+ MYODBCDbgReturn3( "%d", true );
}
bool MYODBCInsDriver::setDRIVER( const QString &stringDriverFileName )
{
+ MYODBCDbgEnter();
+
stringDRIVER = stringDriverFileName;
- return true;
+
+ MYODBCDbgReturn3( "%d", true );
}
bool MYODBCInsDriver::setSETUP( const QString &stringSetupFileName )
{
+ MYODBCDbgEnter();
+
stringSETUP = stringSetupFileName;
- return true;
+
+ MYODBCDbgReturn3( "%d", true );
}
QString MYODBCInsDriver::getFriendlyName()
{
- return stringFriendlyName;
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn3( "%s", stringFriendlyName );
}
QString MYODBCInsDriver::getDRIVER()
{
- return stringDRIVER;
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn3( "%s", stringDRIVER );
}
QString MYODBCInsDriver::getSETUP()
{
- return stringSETUP;
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn3( "%s", stringSETUP );
}
SQLWCHAR *MYODBCInsDriver::getAttributesNullDelim( const QString &stringFriendlyName,
const QString &stringDRIVER, const QString &stringSETUP )
{
+ MYODBCDbgEnter();
+
int nBuffer = (stringFriendlyName.length() + stringDRIVER.length() +
stringSETUP.length() + 20) * sizeof(SQLWCHAR);
- SQLWCHAR * pszBuffer = (SQLWCHAR*)MYODBCCMalloc( nBuffer );
+ SQLWCHAR * pszBuffer = (SQLWCHAR*)MYODBCC::getMem( nBuffer );
SQLWCHAR * pcInsertPos = pszBuffer;
/* friendly name */
- MYODBCCMemCpy( pcInsertPos, stringFriendlyName.utf16(), (stringFriendlyName.length()
+ 1) * sizeof(SQLWCHAR) );
+ MYODBCC::doMemCpy( pcInsertPos, stringFriendlyName.utf16(),
(stringFriendlyName.length() + 1) * sizeof(SQLWCHAR) );
pcInsertPos += stringFriendlyName.length() + 1;
/* DRIVER */
- MYODBCCMemCpy( pcInsertPos, L"DRIVER=", 7 * sizeof(SQLWCHAR) );
+ MYODBCC::doMemCpy( pcInsertPos, L"DRIVER=", 7 * sizeof(SQLWCHAR) );
pcInsertPos += 7;
- MYODBCCMemCpy( pcInsertPos, stringDRIVER.utf16(), (stringDRIVER.length() + 1) *
sizeof(SQLWCHAR) );
+ MYODBCC::doMemCpy( pcInsertPos, stringDRIVER.utf16(), (stringDRIVER.length() + 1) *
sizeof(SQLWCHAR) );
pcInsertPos += stringDRIVER.length() + 1;
/* SETUP */
- MYODBCCMemCpy( pcInsertPos, L"SETUP=", 6 * sizeof(SQLWCHAR) );
+ MYODBCC::doMemCpy( pcInsertPos, L"SETUP=", 6 * sizeof(SQLWCHAR) );
pcInsertPos += 6;
- MYODBCCMemCpy( pcInsertPos, stringSETUP.utf16(), stringSETUP.length() *
sizeof(SQLWCHAR) );
+ MYODBCC::doMemCpy( pcInsertPos, stringSETUP.utf16(), stringSETUP.length() *
sizeof(SQLWCHAR) );
pcInsertPos += stringSETUP.length() + 1;
/* we have terminated keyword/value pairs with null now extra null to terminate the
whole thing */
*pcInsertPos = '\0';
- return pszBuffer;
+ MYODBCDbgReturn3( "%s", pszBuffer );
}
SQLWCHAR *MYODBCInsDriver::getAttributesNullDelim()
{
- return getAttributesNullDelim( stringFriendlyName, stringDRIVER, stringSETUP );
+ MYODBCDbgEnter();
+
+ SQLWCHAR *psz = getAttributesNullDelim( stringFriendlyName, stringDRIVER, stringSETUP
);
+
+ MYODBCDbgReturn3( "%s", psz );
}
bool MYODBCInsDriver::doRead( const QString &stringFriendlyName )
{
+ MYODBCDbgEnter();
+
SQLWCHAR szEntryNames[SQL_MAX_DSN_LENGTH * MYODBC_INS_MAX_DSN_NAMES];
SQLWCHAR * pszEntryName;
SQLWCHAR szValue[4096];
@@ -106,16 +129,15 @@
if ( stringFriendlyName.isEmpty() )
{
MYODBCIns::setError( "invalid data source name" );
- return false;
+ MYODBCDbgReturn3( "%d", false );
}
*szEntryNames = '\0';
int nChars = SQLGetPrivateProfileString( stringFriendlyName.utf16(), NULL, L"",
szEntryNames, sizeof(szEntryNames) / sizeof(SQLWCHAR), L"ODBCINST.INI" );
if ( nChars < 1 )
{
- if ( MYODBCIns::setError( "data source name not found" ) != SQL_SUCCESS )
- MYODBCCfprintf( stderr, L"[PAH][%s][%d]\n", TEXT(__FILE__), __LINE__ );
- return false;
+ MYODBCIns::setError( "data source name not found" );
+ MYODBCDbgReturn3( "%d", false );
}
/* we avoid a doClear() here because we want to 'merge' the data - not replace it */
@@ -149,35 +171,45 @@
/* What the ? */
}
}
- pszEntryName += MYODBCCstrlen( pszEntryName ) + 1;
+ pszEntryName += MYODBCC::getStrLen( pszEntryName, SQL_MAX_DSN_LENGTH *
MYODBC_INS_MAX_DSN_NAMES ) + 1;
} /* while */
- return true;
+ MYODBCDbgReturn3( "%d", true );
}
bool MYODBCInsDriver::doWrite()
{
+ MYODBCDbgEnter();
+
SQLWCHAR szPathOut[1024];
WORD nPathOutLength = 0;
DWORD nUsageCount = 0;
SQLWCHAR * pszAttributes = getAttributesNullDelim();
BOOL bRetCode = SQLInstallDriverEx( pszAttributes, NULL, szPathOut,
sizeof(szPathOut) / sizeof(SQLWCHAR), &nPathOutLength, ODBC_INSTALL_COMPLETE,
&nUsageCount );
- MYODBCCFree( pszAttributes );
+ MYODBCC::doFree( pszAttributes );
- return bRetCode;
+ MYODBCDbgReturn3( "%d", bRetCode );
}
void MYODBCInsDriver::doClear()
{
+ MYODBCDbgEnter();
+
stringFriendlyName = QString::null;
stringDRIVER = QString::null;
stringSETUP = QString::null;
+
+ MYODBCDbgReturn2();
}
bool MYODBCInsDriver::doDelete( const QString &stringDriverName, bool
bRemoveDataSourceNames, LPDWORD pnUsageCount )
{
- return SQLRemoveDriver( stringDriverName.utf16(), bRemoveDataSourceNames,
pnUsageCount );
+ MYODBCDbgEnter();
+
+ bool b = SQLRemoveDriver( stringDriverName.utf16(), bRemoveDataSourceNames,
pnUsageCount );
+
+ MYODBCDbgReturn3( "%d", b );
}
MYODBCInsDriver MYODBCInsDriver::operator=( MYODBCInsDriver rval )
Modified: MYODBCIns/MYODBCInsLib/MYODBCInsDriverConnect.cpp
===================================================================
--- MYODBCIns/MYODBCInsLib/MYODBCInsDriverConnect.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/MYODBCInsLib/MYODBCInsDriverConnect.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -31,12 +31,18 @@
MYODBCInsDriverConnect::MYODBCInsDriverConnect( MYODBC_INS_DRIVERCONNECT_METHOD
nConnectMethod, MYODBC_INS_DRIVERCONNECT_PROMPT nPrompt )
: MYODBCInsDataSource( MYODBC_INS_DATASOURCE_MODE_CONNECT )
{
+ MYODBCDbgEnter();
+
this->nConnectMethod = nConnectMethod;
this->nPrompt = nPrompt;
+
+ MYODBCDbgReturn2();
}
bool MYODBCInsDriverConnect::setConnectString( const QString &stringConnectString )
{
+ MYODBCDbgEnter();
+
MYODBC_INS_ATTR_PARSE_STATE nState = MYODBC_INS_ATTR_PARSE_STATE_NAME_START;
int nAnchorChar = 0;
int nScanChar = 0;
@@ -44,7 +50,7 @@
/* short circuit if we have not been given stuff to parse */
if ( stringConnectString.isEmpty() )
- return false;
+ MYODBCDbgReturn3( "%d", false );
/* scan the input */
while ( 1 )
@@ -183,8 +189,8 @@
}
break;
default:
- MYODBCCfprintf( stderr, L"[%s][%d][ERROR] Unhandled state.\n",
TEXT(__FILE__), __LINE__ );
- return false;
+ MYODBCDbgError( "Unhandled state %d", nState );
+ MYODBCDbgReturn3( "%d", false );
}
/* ';' is used to terminate a name/value pair */
@@ -199,23 +205,31 @@
} /* while scan */
- return true;
+ MYODBCDbgReturn3( "%d", true );
}
bool MYODBCInsDriverConnect::setConnectMethod( MYODBC_INS_DRIVERCONNECT_METHOD
nConnectMethod )
{
+ MYODBCDbgEnter();
+
this->nConnectMethod = nConnectMethod;
- return true;
+
+ MYODBCDbgReturn3( "%d", true );
}
bool MYODBCInsDriverConnect::setPrompt( MYODBC_INS_DRIVERCONNECT_PROMPT nPrompt )
{
+ MYODBCDbgEnter();
+
this->nPrompt = nPrompt;
- return true;
+
+ MYODBCDbgReturn3( "%d", true );
}
QString MYODBCInsDriverConnect::getConnectString()
{
+ MYODBCDbgEnter();
+
QString stringConnect;
if ( !stringDATABASE.isNull() )
@@ -304,17 +318,21 @@
stringConnect += stringUSER;
}
- return stringConnect;
+ MYODBCDbgReturn3( "%s", stringConnect );
}
MYODBC_INS_DRIVERCONNECT_METHOD MYODBCInsDriverConnect::getConnectMethod()
{
- return nConnectMethod;
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn3( "%d", nConnectMethod );
}
MYODBC_INS_DRIVERCONNECT_PROMPT MYODBCInsDriverConnect::getPrompt()
{
- return nPrompt;
+ MYODBCDbgEnter();
+
+ MYODBCDbgReturn3( "%d", nPrompt );
}
Modified: MYODBCIns/MYODBCInsTest/MYODBCInsTest.cpp
===================================================================
--- MYODBCIns/MYODBCInsTest/MYODBCInsTest.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/MYODBCInsTest/MYODBCInsTest.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,11 +1,8 @@
+#include <QtTest/QtTest>
+#include <QString>
+#include <QFile>
#include <MYODBCIns.h>
-typedef struct tTEST
-{
- char * name;
- int (*pfunc)();
-} TEST;
-
#define FILE_SEP "\\"
#define TEST_DRIVERNAME "mytestDRIVER"
@@ -25,9 +22,46 @@
/* store some output here so we can check results in later funcs */
QString stringOutput;
-/* create new DRIVER */
-int test1()
+class MYODBCInsTest : public QObject
{
+ Q_OBJECT
+public:
+ MYODBCInsTest();
+ ~MYODBCInsTest();
+ QFile fileDebugOut;
+
+private slots:
+ void slotRegisterDriver();
+ void slotVerifyRegisterDriver();
+ void slotCreateDataSourceName();
+ void slotVerifyCreateDataSourceName();
+ void slotDeleteDataSourceName();
+ void slotVerifyDeleteDataSourceName();
+ void slotDeregisterDriver();
+ void slotVerifyDeregisterDriver();
+};
+
+MYODBCInsTest::MYODBCInsTest()
+{
+ fileDebugOut.setFileName( "MYODBCInsTest.txt" );
+ if ( fileDebugOut.open( QFile::WriteOnly | QFile::Truncate ) )
+ {
+ MYODBCDbgInit( &fileDebugOut );
+ }
+ else
+ {
+ MYODBCDbgInit( stdout );
+ }
+}
+
+MYODBCInsTest::~MYODBCInsTest()
+{
+ MYODBCDbgFini();
+ fileDebugOut.close();
+}
+
+void MYODBCInsTest::slotRegisterDriver()
+{
MYODBCInsDriver driver;
driver.setFriendlyName( TEST_DRIVERNAME );
@@ -45,17 +79,14 @@
{
MYODBCDbgError( "%1", stringlist.join( "\n" ) );
}
- return 0;
+ QFAIL( "Failed to register driver" );
}
QTextStream textstream( &stringOutput );
textstream << driver;
-
- return 1;
}
-/* verify new DRIVER */
-int test2()
+void MYODBCInsTest::slotVerifyRegisterDriver()
{
MYODBCInsDriver driver;
QString stringDefaultInstallLocation =
MYODBCIns::getDefaultInstallLocation();
@@ -71,7 +102,7 @@
{
MYODBCDbgError( "%1", stringlist.join( "\n" ) );
}
- return 0;
+ QFAIL( "Failed to verify that driver was registered." );
}
QString stringResult;
@@ -86,14 +117,11 @@
MYODBCDbgError( "Have prepended %1 to file names but driver information is not
the same...", stringDefaultInstallLocation );
MYODBCDbgError( "\nWrote:\n%1", stringOutput );
MYODBCDbgError( "\nRead :\n%1", stringResult );
- return 0;
+ QFAIL( "Failed to verify that driver was registered." );
}
-
- return 1;
}
-/* create new DSN */
-int test3()
+void MYODBCInsTest::slotCreateDataSourceName()
{
/* its an error if it already exists... */
QStringList stringlistDataSourceNames = MYODBCIns::getDataSourceNames(
MYODBC_INS_DATASOURCE_SCOPE_USER );
@@ -101,7 +129,7 @@
if ( stringlistDataSourceNames.contains( TEST_DSN ) )
{
MYODBCDbgError( "%1 already exists.", TEST_DSN );
- return 0;
+ QFAIL( "Failed to create DSN." );
}
MYODBCInsDataSource datasource( MYODBC_INS_DATASOURCE_MODE_DSN_ADD );
@@ -130,18 +158,15 @@
{
MYODBCDbgError( "%1", stringlist.join( "\n" ) );
}
- return 0;
+ QFAIL( "Failed to create DSN." );
}
stringOutput = QString::null;
QTextStream textstream( &stringOutput );
textstream << datasource;
-
- return 1;
}
-/* verify new DSN */
-int test4()
+void MYODBCInsTest::slotVerifyCreateDataSourceName()
{
MYODBCInsDataSource datasource( MYODBC_INS_DATASOURCE_MODE_DSN_EDIT );
QString stringDefaultInstallLocation =
MYODBCIns::getDefaultInstallLocation();
@@ -158,7 +183,7 @@
{
MYODBCDbgError( "%1", stringlist.join( "\n" ) );
}
- return 0;
+ QFAIL( "Failed to verify DSN." );
}
QString stringResult;
@@ -181,14 +206,11 @@
MYODBCDbgError( "Have prepended %1 to file name but data source information is
not the same...", stringDefaultInstallLocation );
MYODBCDbgError( "\nWrote:\n%1", stringOutput );
MYODBCDbgError( "\nRead :\n%1", stringResult );
- return 0;
+ QFAIL( "Failed to verify DSN." );
}
-
- return 1;
}
-/* delete DSN */
-int test5()
+void MYODBCInsTest::slotDeleteDataSourceName()
{
if ( !MYODBCInsDataSource::doDelete( TEST_DSN ) )
{
@@ -201,28 +223,22 @@
{
MYODBCDbgError( "%1", stringlist.join( "\n" ) );
}
- return 0;
+ QFAIL( "Failed to delete DSN." );
}
-
- return 1;
}
-/* verify delete DSN */
-int test6()
+void MYODBCInsTest::slotVerifyDeleteDataSourceName()
{
QStringList stringlistDataSourceNames = MYODBCIns::getDataSourceNames(
MYODBC_INS_DATASOURCE_SCOPE_USER );
if ( stringlistDataSourceNames.contains( TEST_DSN ) )
{
MYODBCDbgError( "Failed to delete %1.", TEST_DSN );
- return 0;
+ QFAIL( "Failed to verify delete DSN." );
}
-
- return 1;
}
-/* delete DRIVER */
-int test7()
+void MYODBCInsTest::slotDeregisterDriver()
{
DWORD nUsage = 0;
@@ -237,62 +253,26 @@
{
MYODBCDbgError( "%1", stringlist.join( "\n" ) );
}
- return 0;
+ QFAIL( "Failed to deregister driver." );
}
if ( nUsage != 0 )
MYODBCDbgWarning( "Usage count should be 0 but is %1.", nUsage );
-
- return 1;
}
-/* verify delete DRIVER */
-int test8()
+void MYODBCInsTest::slotVerifyDeregisterDriver()
{
QStringList stringlistDriverNames = MYODBCIns::getDriverNames();
if ( stringlistDriverNames.contains( TEST_DRIVERNAME ) )
{
MYODBCDbgError( "Failed to delete %1.", TEST_DRIVERNAME );
- return 0;
+ QFAIL( "Failed to verify deregister driver." );
}
-
- return 1;
}
-int main()
-{
- TEST tests[9]=
- {
- {"test1", test1},
- {"test2", test2},
- {"test3", test3},
- {"test4", test4},
- {"test5", test5},
- {"test6", test6},
- {"test7", test7},
- {"test8", test8},
- {NULL, NULL}
- };
- int n;
- MYODBCDbgInit( stderr );
+QTEST_MAIN( MYODBCInsTest )
+#include "MYODBCInsTest.moc"
- for ( n = 0; tests[n].name; n++ )
- {
- printf( "%-40s", tests[n].name );
- if ( tests[n].pfunc() )
- printf( "[ OK ]\n" );
- else
- {
- printf( "[FAILED]\n" );
- exit( 1 );
- }
- }
- MYODBCDbgFini();
-
- return 0;
-}
-
-
Modified: MYODBCIns/MYODBCInsTest/MYODBCInsTest.pro
===================================================================
--- MYODBCIns/MYODBCInsTest/MYODBCInsTest.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/MYODBCInsTest/MYODBCInsTest.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -8,12 +8,14 @@
include( ../../config.pri )
include( ../../defines.pri )
include( ../../odbc.pri )
-CONFIG += console
+CONFIG += qtestlib
INCLUDEPATH += ../../MYODBCC/include
INCLUDEPATH += ../../MYODBCDbg/include
INCLUDEPATH += ../include
LIBS += -L../../lib
-LIBS += -lMYODBCIns -lMYODBCDbg
+LIBS += -lMYODBCIns
+LIBS += -lMYODBCDbg
+LIBS += -lMYODBCC
win32 {
LIBS += kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib
Modified: MYODBCIns/include/MYODBCIns.h
===================================================================
--- MYODBCIns/include/MYODBCIns.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCIns/include/MYODBCIns.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -16,7 +16,6 @@
static RETCODE getError( WORD nError, DWORD *pnErrorCode, QString &stringMessage
);
static QString getError( WORD nError );
static QStringList getErrors();
- static QString getErrorString( WORD nError );
static bool isExistsDataSourceName( const QString &stringDataSourceName,
MYODBC_INS_DATASOURCE_SCOPE nScope );
Modified: MYODBCRes/MYODBCResLib/MYODBCRes.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCRes.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResLib/MYODBCRes.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -62,6 +62,58 @@
MYODBCDbgReturn2();
}
+SQLRETURN MYODBCRes::doBindCol( SQLUSMALLINT nColumnNumber, SQLSMALLINT nTargetType,
SQLPOINTER pTargetValuePtr, SQLINTEGER nBufferLength, SQLLEN *pnStrLenOrInd )
+{
+ MYODBCDbgEnter();
+
+ MYODBCDes *pdes = getAppRowDesc();
+
+ if ( nColumnNumber > getImpRowDesc()->getCount() )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_07009 ) );
+
+ /* bind */
+ if ( pTargetValuePtr )
+ {
+ if ( nBufferLength < 0 )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY090 ) );
+
+ if ( nBufferLength == 0 && nTargetType == SQL_C_CHAR )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY090 ) );
+
+ /* ensure that we have enough records */
+ pdes->setCount( nColumnNumber );
+ MYODBCDesRec *pdesrec = pdes->getRec( nColumnNumber );
+
+ if ( MYODBCC::isIntervalConciseTypeC( nTargetType ) )
+ {
+ pdesrec->setDatetimeIntervalPrecision( 2 ); /* 2 is as per spec */
+ pdesrec->setPrecision( 6 ); /* 6 is as per spec */
+ }
+
+ if ( nTargetType == SQL_C_NUMERIC )
+ {
+ pdesrec->setScale( 0 ); /* 0 is as per spec */
+ pdesrec->setPrecision( 6 ); /* 6 is drv defined */
+ }
+
+ pdesrec->setDataPtr( pTargetValuePtr );
+ pdesrec->setLength( nBufferLength );
+ pdesrec->setIndicatorPtr( pnStrLenOrInd );
+ pdesrec->setConciseType( nTargetType );
+ }
+ /* unbind */
+ else
+ {
+ MYODBCDesRec *pdesrec = pdes->getRec( nColumnNumber );
+ if ( !pdesrec )
+ MYODBCDbgReturn( SQL_SUCCESS );
+ pdesrec->doUnbind();
+ pdes->doTruncateUnboundRecords();
+ }
+
+ MYODBCDbgReturn( SQL_SUCCESS );
+}
+
MYODBCDes * MYODBCRes::getAppParamDesc()
{
MYODBCDbgEnter();
Modified: MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -21,10 +21,15 @@
{
MYODBCDbgEnter();
- Q_ASSERT( !isValidRow() );
- Q_ASSERT( !isValidColumn( nColumn ) );
+ if ( !isValidRow() )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
+
+ if ( !isValidColumn( nColumn ) )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid column." )
);
+
// can not write this column (and it does not really exist anyway as bookmark is row
num)
- Q_ASSERT( nColumn == 0 );
+ if ( nColumn == 0 )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid column.
Bookmark column is read-only." ) );
listResults[ nRow - 1 ].replace( nColumn - 1, variantData );
@@ -35,7 +40,11 @@
{
MYODBCDbgEnter();
- Q_ASSERT( !isValidRow( nRow ) );
+ if ( !isValidRow( nRow ) )
+ {
+ nRow = 0;
+ MYODBCDbgReturn( SQL_NO_DATA );
+ }
this->nRow = nRow;
@@ -57,9 +66,12 @@
{
MYODBCDbgEnter();
- Q_ASSERT( !isValidRow() );
- Q_ASSERT( !isValidColumn( nColumn ) );
+ if ( !isValidRow() )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
+ if ( !isValidColumn( nColumn ) )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid column." )
);
+
if ( nColumn == 0 )
variantData = nRow; // bookmark is row num - obvious limitations apply
else
@@ -90,14 +102,18 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
-SQLRETURN MYODBCResDriver::doAppend()
+SQLRETURN MYODBCResDriver::doAppend( int nToAppend )
{
MYODBCDbgEnter();
- /* allocate row - no bookmark column allocated */
- listResults.append( QVector<QVariant>( getImpRowDesc()->getCount() - 1 ) );
- nRow = listResults.count();
+ SQLSMALLINT nColumns = getImpRowDesc()->getCount() - 1;
+ for ( int nAppended = 0; nAppended < nToAppend; nAppended++ )
+ {
+ listResults.append( QVector<QVariant>( nColumns ) );
+ nRow = listResults.count();
+ }
+
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -210,21 +226,6 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
-SQLRETURN MYODBCResDriver::doSeek( qlonglong nRow )
-{
- MYODBCDbgEnter();
-
- if ( !isValidRow( nRow ) )
- {
- nRow = 0;
- MYODBCDbgReturn( SQL_NO_DATA );
- }
-
- this->nRow = nRow;
-
- MYODBCDbgReturn( SQL_SUCCESS );
-}
-
SQLRETURN MYODBCResDriver::doSkip( qlonglong nRows )
{
MYODBCDbgEnter();
@@ -456,6 +457,8 @@
doAppendTypeInfoBit();
doAppendTypeInfoTinyInt();
doAppendTypeInfoBigInt();
+ doAppendTypeInfoBinary();
+ doAppendTypeInfoVarBinary();
doAppendTypeInfoLongVarBinary();
doAppendTypeInfoLongVarChar();
doAppendTypeInfoChar();
@@ -511,15 +514,35 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
+SQLRETURN MYODBCResDriver::doAppendTypeInfoBinary()
+{
+ MYODBCDbgEnter();
+
+ /* SQL_BINARY= -2 */
+ doAppendTypeInfo( "binary", SQL_BINARY, 255, "'", "'", "length", SQL_NULLABLE, 0,
SQL_SEARCHABLE, 0, 0, 0, "binary", QVariant(), QVariant(), SQL_BINARY, QVariant(),
QVariant(), QVariant() );
+
+ MYODBCDbgReturn( SQL_SUCCESS );
+}
+
+SQLRETURN MYODBCResDriver::doAppendTypeInfoVarBinary()
+{
+ MYODBCDbgEnter();
+
+ /* SQL_VARBINARY= -3 */
+ doAppendTypeInfo( "varbinary", SQL_VARBINARY, 255, "'", "'", "length", SQL_NULLABLE,
0, SQL_SEARCHABLE, 0, 0, 0, "varbinary", QVariant(), QVariant(), SQL_VARBINARY,
QVariant(), QVariant(), QVariant() );
+
+ MYODBCDbgReturn( SQL_SUCCESS );
+}
+
SQLRETURN MYODBCResDriver::doAppendTypeInfoLongVarBinary()
{
MYODBCDbgEnter();
- /* SQL_LONGVARBINARY= -3 */
+ /* SQL_LONGVARBINARY= -4 */
doAppendTypeInfo( "long varbinary", SQL_LONGVARBINARY, 16777215, "0x", QVariant(),
QVariant(), SQL_NULLABLE, 0, SQL_SEARCHABLE, 0, 0, 0, "mediumblob", QVariant(),
QVariant(), SQL_LONGVARBINARY, QVariant(), QVariant(), QVariant() );
doAppendTypeInfo( "blob", SQL_LONGVARBINARY, 65535, "'", "'", QVariant(),
SQL_NULLABLE, 0, SQL_SEARCHABLE, 0, 0, 0, "binary large object (0-65535)", QVariant(),
QVariant(), SQL_LONGVARBINARY, QVariant(), QVariant(), QVariant() );
doAppendTypeInfo( "longblob", SQL_LONGVARBINARY, 2147483647, "'", "'", QVariant(),
SQL_NULLABLE, 0, SQL_SEARCHABLE, 0, 0, 0, "binary large object, use mediumblob instead",
QVariant(), QVariant(), SQL_LONGVARBINARY, QVariant(), QVariant(), QVariant() );
- doAppendTypeInfo( "tinyblob", SQL_VARBINARY, 255, "'", "'", QVariant(), SQL_NULLABLE,
0, SQL_SEARCHABLE, 0, 0, 0, "binary large object (0-255)", QVariant(), QVariant(),
SQL_VARBINARY, QVariant(), QVariant(), QVariant() );
+ doAppendTypeInfo( "tinyblob", SQL_LONGVARBINARY, 255, "'", "'", QVariant(),
SQL_NULLABLE, 0, SQL_SEARCHABLE, 0, 0, 0, "binary large object (0-255)", QVariant(),
QVariant(), SQL_LONGVARBINARY, QVariant(), QVariant(), QVariant() );
doAppendTypeInfo( "mediumblob", SQL_LONGVARBINARY, 16777215, "'", "'", QVariant(),
SQL_NULLABLE, 0, SQL_SEARCHABLE, 0, 0, 0, "binary large object", QVariant(), QVariant(),
SQL_LONGVARBINARY, QVariant(), QVariant(), QVariant() );
MYODBCDbgReturn( SQL_SUCCESS );
@@ -671,7 +694,7 @@
MYODBCDbgEnter();
/* SQL_VARCHAR= 12 */
- doAppendTypeInfo( "varchar", SQL_VARCHAR, 255, "'", "'", "max length", SQL_NULLABLE,
0, SQL_SEARCHABLE, 0, 0, 0, "varchar", QVariant(), QVariant(), SQL_VARCHAR, QVariant(),
QVariant(), QVariant() );
+ doAppendTypeInfo( "varchar", SQL_VARCHAR, 255, "'", "'", "length", SQL_NULLABLE, 0,
SQL_SEARCHABLE, 0, 0, 0, "varchar", QVariant(), QVariant(), SQL_VARCHAR, QVariant(),
QVariant(), QVariant() );
MYODBCDbgReturn( SQL_SUCCESS );
}
Modified: MYODBCRes/MYODBCResLib/MYODBCResLib.pro
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResLib.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResLib/MYODBCResLib.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -39,11 +39,11 @@
HEADERS = \
../include/MYODBCRes.h \
../include/MYODBCResDriver.h \
-# ../include/MYODBCResServer.h \
+ ../include/MYODBCResServer.h \
MYODBCResInternal.h
SOURCES = \
MYODBCRes.cpp \
- MYODBCResDriver.cpp
-# MYODBCResServer.cpp
+ MYODBCResDriver.cpp \
+ MYODBCResServer.cpp
Modified: MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResServer.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResLib/MYODBCResServer.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,5 +1,43 @@
#include "MYODBCResInternal.h"
+/*!
+ \brief Result-set based upon a server-side prepared statement (MYSQL_STMT).
+
+ This result-set utilizes the unique features of MySQL prepared statements.
This
+ includes such things as;
+
+ - server-side prepared statements
+ - binary protocol
+ - chunking large data values to/from server
+
+ There are pros and cons to using MySQL prepared statements - see the
+ manual for details.
+
+ Here are some not-so-obvious limitations in using MySQL prepared statements
+ to support the ODBC specification;
+
+ - The use of MYSQL_BIND to bind columns means the client-lib and/or server
will
+ convert the data to the desired target type. This could save the driver some
+ work; however, MySQL does not understand all of the needed ODBC types. For
example;
+ SQL_NUMERIC_STRUCT, SQL_TIMESTAMP_STRUCT etc. For this reason it is not
always possible
+ to bind application buffers from the ARD directly to the MYSQL_BIND data
buffer and rely
+ upon the MySQL data conversion.
+ - The ODBC specification requires binding/unbinding at anytime. MySQL has
limitations which
+ means we can not use mysql_stmt_bind_result().
+ - Data chunking column data is only available with mysql_stmt_fetch_column()
- limiting
+ our possible use of mysql_stmt_bind_result().
+ - Random access of rows is not supported with unbuffered result-sets. This is
fine for
+ forward only cursors but mysql_stmt_store_result() must be called otherwise.
+ - The number of rows in a result-set os often (but not always) needed in ODBC
and is only
+ available with buffered results.
+
+ \param patt Reference to statement attributes.
+ pmysql Reference to our mysql connection.
+
+ \sa MYODBCRes
+ MYODBCResClient
+ MYODBCResDriver
+*/
MYODBCResServer::MYODBCResServer( MYODBCAttStatement *patt, MYSQL *pmysql )
: MYODBCRes( patt, pmysql )
{
@@ -14,12 +52,25 @@
{
MYODBCDbgEnter();
- mysql_stmt_close( pstm );
+ doFini();
MYODBCDbgReturn2();
}
-SQLRETURN MYODBCResServer::setData( uint nColumn, const QVariant &variantData )
+/*!
+ \brief Sets a column value in a result-set.
+
+ This is not implemented as of yet. This exists in part for completeness but
also
+ because it may be used as part of positioned update.
+
+ \param nColumn The column to set. This is 1-based with 0 being reserved for the
read-only bookmark.
+ variantData The value to use to set the column.
+
+ \return SQLRETURN
+
+ \sa getData
+*/
+SQLRETURN MYODBCResServer::setData( uint nColumn, const QVariant & )
{
MYODBCDbgEnter();
@@ -38,26 +89,54 @@
MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "setData not supported
here at this time." ) );
}
+/*!
+ \brief Makes nRow the current row of the result-set.
+
+ This is used to set the current row to any valid row position. If the
+ row is not valid - the current row will be before the 1st row and
+ SQL_NO_DATA will be returned.
+
+ \param nRow The desired row in the result-set. This is 1-based however;
+ 0 can be used to make the current row - the row before the 1st
+ row.
+
+ \return SQLRETURN
+
+ \sa getRow
+ getRows
+ doNext
+ doPrev
+ doFirst
+ doLast
+ doSkip
+*/
SQLRETURN MYODBCResServer::setRow( qulonglong nRow )
{
MYODBCDbgEnter();
- if ( !isValidRow() )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
-
- if ( bBuffered )
+ if ( !isValidRow( nRow ) )
{
- if ( !isValidRow() )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." )
);
-
- mysql_stmt_data_seek( pstm, nRow );
-
- MYODBCDbgReturn( SQL_SUCCESS );
+ nRow = 0;
+ MYODBCDbgReturn( SQL_NO_DATA );
}
+ mysql_stmt_data_seek( pstm, nRow - 1 );
+ MYODBCDbgReturn( SQL_SUCCESS );
}
+/*!
+ \brief Used to get the number of columns in the result-set.
+
+ This simply dives into the IRD descriptor and return SQL_DESC_COUNT. This
+ is 1-based but 0 is used for bookmarks.
+
+ \param pnColumns Pointer to be used to return the number of columns.
+
+ \return SQLRETURN
+
+ \sa getRows
+*/
SQLRETURN MYODBCResServer::getColumns( uint *pnColumns )
{
MYODBCDbgEnter();
@@ -72,6 +151,20 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
+/*!
+ \brief Use this to get a column value.
+
+ This will get the value of a column at the current row in the result-set.
This
+ assumes that all of the bound column buffers have been loaded with column
data
+ reflecting the current row.
+
+ \param pnColumns Pointer to be used to return the number of columns.
+
+ \return SQLRETURN
+
+ \sa doGetData
+ doBindCol
+*/
SQLRETURN MYODBCResServer::getData( uint nColumn, QVariant &variantData )
{
MYODBCDbgEnter();
@@ -83,13 +176,79 @@
MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid column." )
);
if ( nColumn == 0 )
- variantData = nRow; // bookmark is row num - obvious limitations apply
+ variantData = nRow; // bookmark - using nRow has limitations
else
- variantData = xxxx;
+ {
+ MYSQL_BIND *pbind = pbindColumn[nColumn - 1];
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "getData not supported
here yet - use SELECT with bound columns." ) );
+ if ( pbindColumns->is_null )
+ variantData = QVariant();
+ else
+ {
+ switch ( pbind->buffer_type )
+ {
+ case MYSQL_TYPE_BIT:
+ variantData.setValue( *((int*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_TINY:
+ variantData.setValue( *((char*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_SHORT:
+ variantData.setValue( *((short int*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_LONG:
+ variantData.setValue( *((int*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_LONGLONG:
+ variantData.setValue( *((long long int*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_FLOAT:
+ variantData.setValue( *((float*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_DOUBLE:
+ variantData.setValue( *((double*)pbind->buffer) );
+ break;
+ case MYSQL_TYPE_NULL:
+ variantData = QVariant();
+ break;
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_TIMESTAMP:
+ {
+ MYSQL_TIME *pdatetime = (MYSQL_TIME *)pbind->buffer;
+
+ variantData.setValue( QDateTime( QDate( pdatetime->year,
pdatetime->month, pdatetime->day ),
+ QTime( pdatetime->hour,
pdatetime->minute, pdatetime->second, pdatetime->second_part ) ) );
+ }
+ break;
+ case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_TINY_BLOB:
+ case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ case MYSQL_TYPE_LONG_BLOB:
+ variantData.setValue( QByteArray( pbind->buffer,
pbind->length_value ) );
+ break;
+ default:
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid
column bind data type." ) );
+ }
+ }
+ }
+
+ MYODBCDbgReturn( SQL_SUCCESS );
}
+/*!
+ \brief Use this to get current row number.
+
+ This will get the current row number in the result-set.
+
+ \param pnRow Pointer to be used to return the row number.
+
+ \return SQLRETURN
+
+ \sa setRow
+*/
SQLRETURN MYODBCResServer::getRow( qulonglong *pnRow )
{
MYODBCDbgEnter();
@@ -104,6 +263,18 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
+/*!
+ \brief Use this to get the number of rows in the result-set.
+
+ This will get the number of rows in the result-set. nRow is
+ 1-based so nRows is a valid row.
+
+ \param pnRows Pointer to be used to return the number of rows.
+
+ \return SQLRETURN
+
+ \sa setColumns
+*/
SQLRETURN MYODBCResServer::getRows( qulonglong *pnRows )
{
MYODBCDbgEnter();
@@ -118,6 +289,16 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
+/*!
+ \brief Use this to append a new, blank, row.
+
+ This is not implemented yet.
+
+ \return SQLRETURN
+
+ \sa doDelete
+ doInsert
+*/
SQLRETURN MYODBCResServer::doAppend()
{
MYODBCDbgEnter();
@@ -125,23 +306,40 @@
MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "doAppend not supported
here at this time." ) );
}
+/*!
+ \brief Use this to reset the result-set start state.
+
+ This will clear the result-set (if any) and the prepare.
+
+ \return SQLRETURN
+
+ \sa doDelete
+ doInsert
+*/
SQLRETURN MYODBCResServer::doClear()
{
MYODBCDbgEnter();
- getImpRowDesc()->doClear();
- mysql_stmt_close( pstm );
+ doFini();
doInit();
MYODBCDbgReturn( SQL_SUCCESS );
}
+/*!
+ \brief Use this to delete the current row.
+
+ This is not implemented yet.
+
+ \return SQLRETURN
+
+ \sa doAppend
+ doInsert
+*/
SQLRETURN MYODBCResServer::doDelete()
{
MYODBCDbgEnter();
- Q_ASSERT( !isValidRow() );
-
MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "doDelete not supported
here at this time." ) );
}
@@ -150,19 +348,20 @@
MYODBCDbgEnter();
if ( !pstmt )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010, 0, NULL ) );
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010 ) );
if ( stringStatement.isEmpty() )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010, 0, NULL ) );
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010 ) );
if ( mysql_stmt_execute( pstm ) )
MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm
), mysql_stmt_error( pstm ) ) );
- if ( bBuffered )
- {
- if ( mysql_stmt_store_result( pstm ) )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno(
pstm ), mysql_stmt_error( pstm ) ) );
- }
+ /*!
+ \todo Add buffered/unbuffered option - for now just use buffered as it enables
more features.
+ Currently; many assumptions based upon us using buffered.
+ */
+ if ( mysql_stmt_store_result( pstm ) )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm
), mysql_stmt_error( pstm ) ) );
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -171,13 +370,17 @@
{
MYODBCDbgEnter();
- if ( !listResults.count() )
+ if ( stringStatement.isEmpty() )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010, 0, "No statement
prepared." ) );
+
+ if ( !isValidRow( 1 ) )
{
nRow = 0;
MYODBCDbgReturn( SQL_NO_DATA );
}
nRow = 1;
+ mysql_stmt_data_seek( pstm, nRow - 1 );
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -186,15 +389,7 @@
{
MYODBCDbgEnter();
- if ( nRow == 0 )
- {
- listResults.insert( nRow, QVector<QVariant>( getImpRowDesc()->getCount()
- 1 ) );
- doFirst();
- }
- else
- listResults.insert( nRow - 1, QVector<QVariant>(
getImpRowDesc()->getCount() - 1 ) );
-
- MYODBCDbgReturn( SQL_SUCCESS );
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "doInsert not supported
here at this time." ) );
}
SQLRETURN MYODBCResServer::doLast()
@@ -204,11 +399,17 @@
if ( stringStatement.isEmpty() )
MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010, 0, "No statement
prepared." ) );
-++++
- nRow = listResults.count();
- if ( !isValidRow() )
+ qulonglong nRows = 0;
+ getRows( &nRows );
+ if ( nRows == 0 )
+ {
+ nRow = 0;
MYODBCDbgReturn( SQL_NO_DATA );
+ }
+ nRow = nRows;
+ mysql_stmt_data_seek( pstm, nRow - 1 );
+
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -221,8 +422,13 @@
nRow++;
if ( !isValidRow() )
+ {
+ nRow = 0;
MYODBCDbgReturn( SQL_NO_DATA );
+ }
+ mysql_stmt_data_seek( pstm, nRow - 1 );
+
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -231,7 +437,7 @@
MYODBCDbgEnter();
if ( !pstmt )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010, 0, NULL ) );
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY010 ) );
/* not prepared */
this->stringStatement = QString::null;
@@ -241,6 +447,7 @@
/* now we are prepared */
this->stringStatement = stringStatement;
+ nRow = 0;
/* store FIELD info in the IRD and bind all columns (opt latter bit later) */
MYODBCResStoreMetaData( pRes );
@@ -257,22 +464,12 @@
nRow--;
if ( !isValidRow() )
- MYODBCDbgReturn( SQL_NO_DATA );
-
- MYODBCDbgReturn( SQL_SUCCESS );
-}
-
-SQLRETURN MYODBCResServer::doSeek( qlonglong nRow )
-{
- MYODBCDbgEnter();
-
- if ( !isValidRow( nRow ) )
{
nRow = 0;
MYODBCDbgReturn( SQL_NO_DATA );
}
- this->nRow = nRow;
+ mysql_stmt_data_seek( pstm, nRow - 1 );
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -281,7 +478,8 @@
{
MYODBCDbgEnter();
- Q_ASSERT( nRows == 0 );
+ if ( nRows == 0 )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_01000, 0, "doSkip 0 records is
meaningless." ) );
if ( !isValidRow( nRow + nRows ) )
{
@@ -290,6 +488,7 @@
}
nRow += nRows;
+ mysql_stmt_data_seek( pstm, nRow - 1 );
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -308,18 +507,83 @@
bool MYODBCResServer::isValidRow( qulonglong nRow )
{
SQLRETURN nReturn;
- qulonglong nRowActual;
+ qulonglong nRows;
MYODBCDbgEnter();
- nReturn = getRow( &nRowActual );
+ nReturn = getRows( &nRows );
if ( !SQL_SUCCEEDED( nReturn ) )
MYODBCDbgReturn3( "%d", false );
- MYODBCDbgReturn3( "%d", ( nRow > 0 && nRow <= nRowActual ) );
+ MYODBCDbgReturn3( "%d", ( nRow > 0 && nRow <= nRows ) );
}
+doRefreshRowData()
+{
+ uint nOffset = 0;
+ int nResult;
+ nResult = mysql_stmt_fetch_column( pstm, &bind, nColumn, nOffset );
+ switch ( nResult )
+ {
+ case 0:
+ {
+
+ variantData = xxxx;
+ }
+ break;
+ case CR_INVALID_PARAMETER_NO:
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0,
"CR_INVALID_PARAMETER_NO" ) );
+ case CR_NO_DATA:
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "CR_NO_DATA" )
);
+ default:
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Unknown error
from mysql_stmt_fetch_column()." ) );
+ }
+}
+
+SQLRETURN MYODBCResServer::doInitBindCol( MYODBC_BIND_COL *pbind, uint nColumn,
SQLSMALLINT nTargetType, SQLPOINTER pTarget, SQLINTEGER nTargetSize, SQLINTEGER
*pnStrLenInd )
+{
+}
+
+SQLRETURN MYODBCResServer::doFiniBindCol( MYODBC_BIND_COL *pbind )
+{
+}
+
+SQLRETURN MYODBCResServer::getData( MYODBC_BIND_COL *pbind )
+{
+ /* bookmark */
+ if ( pbind->nColumn == 0 )
+ {
+ /* nothing special to do here as fetch will have updated the bookmark for us */
+ MYSQL_ROW_OFFSET n = mysql_stmt_row_tell();
+ pbind->bind.buffer = &n;
+ }
+ else
+ {
+ mysql_stmt_fetch_column( pstm, &pbind->bind, pbind->nColumn, 0 );
+ }
+
+ doConvert( pbind );
+}
+
+SQLRETURN MYODBCResServer::doBind( MYSQL_BIND *pbind, uint nColumn )
+{
+ MYODBCDbgEnter();
+
+ MYODBCDesRec *pdesrec = getImpRowDesc()->getRec( nColumn );
+
+ if ( !pdesrec )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid column
requested." ) );
+
+ pbind.buffer_type = pField->type;
+ pbind.buffer_length = pField->max_length + 1;
+
+ /* we could use a data ptr if column is bound by app */
+ pbind.buffer = MYODBCC::getMem( pField->max_length + 1 );
+
+ MYODBCDbgReturn( SQL_SUCCESS );
+}
+
SQLRETURN MYODBCResServer::doLoadMetaData()
{
MYSQL_RES *pMetaData;
@@ -385,8 +649,11 @@
MYODBCDbgEnter();
if ( !pField )
- MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Failed to store
field descriptor information." ) );
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid field
structure. Failed to store field descriptor information." ) );
+ if ( nField >= pdes->vectorRecords.count() )
+ MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Field index out of
range. Failed to store field descriptor information." ) );
+
/*
WARNING!!!
@@ -411,41 +678,43 @@
cases the values set here are replaced depending upon the type -
but only sometimes.
*/
- getImpRowDesc()->setAutoUniqueValue( nField, (pField->flags &&
AUTO_INCREMENT_FLAG) ? SQL_TRUE : SQL_FALSE ) );
- getImpRowDesc()->setBaseColumnName( nField, (pField->org_name ?
pField->org_name : "") );
- getImpRowDesc()->setBaseTableName( nField, (pField->org_table ?
pField->org_table : "") );
- getImpRowDesc()->setCaseSensitive( nField, (pField->flags & BINARY_FLAG ?
SQL_FALSE : SQL_TRUE) );
- getImpRowDesc()->setCatalogName( nField, (pField->catalog ? pField->catalog
: "") );
-/* getImpRowDesc()->setconcise_type; - type specific */
-/* getImpRowDesc()->setdata_ptr; - N/A */
-/* getImpRowDesc()->setdatetime_interval_code; - type specific */
- getImpRowDesc()->setDatetimeIntervalPrecision( nField, 10 ); /* this is a
conservative guess - not sure what precision we get when we diff 2 times */
- getImpRowDesc()->setDisplaySize( nField, pField->max_length ); /* - also type
specific */
- getImpRowDesc()->setFixedPrecScale( nField, SQL_FALSE ); /* - also type
specific */
-/* getImpRowDesc()->setindicator_ptr; - N/A */
- getImpRowDesc()->setLabel( nField, pField->name );
-/* getImpRowDesc()->setlength; - type specific */
-/* getImpRowDesc()->setliteral_prefix; - type specific */
-/* getImpRowDesc()->setliteral_suffix; - type specific */
- getImpRowDesc()->setLocalTypeName( nField, "" );
- getImpRowDesc()->setName( nField pField->name );
- getImpRowDesc()->setNullable( nField, ((pField->flags && NOT_NULL_FLAG)
? SQL_NO_NULLS : SQL_NULLABLE) );
-/* getImpRowDesc()->setnum_prec_radix; - type specific */
-/* getImpRowDesc()->setoctet_length; - type specific */
-/* getImpRowDesc()->setoctet_length_ptr; - N/A */
-/* getImpRowDesc()->setparamter_type; - N/A */
-/* getImpRowDesc()->setprecision; - type specific */
- getImpRowDesc()->setRowver( nField, SQL_FALSE ); /* - also type
specific */
- getImpRowDesc()->setScale( nField, pField->decimals );
- getImpRowDesc()->setSchemaName( nField, pField->db );
- getImpRowDesc()->setSearchable( nField, SQL_PRED_SEARCHABLE );
- getImpRowDesc()->setTableName( nField, pField->table );
-/* getImpRowDesc()->settype; - type specific */
-/* getImpRowDesc()->settype_name; - type specific */
- getImpRowDesc()->setUnnamed( nField, SQL_NAMED );
- getImpRowDesc()->setUnsigned( nField, (pField->flags & UNSIGNED_FLAG ?
SQL_TRUE : SQL_FALSE) );
- getImpRowDesc()->setUpdatable( nField, (pField->table &&
pField->table[0] ? SQL_ATTR_READWRITE_UNKNOWN : SQL_ATTR_READONLY) );
+ MYODBCDesRec *pdesrec = getImpRowDesc()->getRec( nField );
+ pdesrec->setAutoUniqueValue( (pField->flags && AUTO_INCREMENT_FLAG) ?
SQL_TRUE : SQL_FALSE ) );
+ pdesrec->setBaseColumnName( (pField->org_name ? pField->org_name : "") );
+ pdesrec->setBaseTableName( (pField->org_table ? pField->org_table : "") );
+ pdesrec->setCaseSensitive( (pField->flags & BINARY_FLAG ? SQL_FALSE :
SQL_TRUE) );
+ pdesrec->setCatalogName( (pField->catalog ? pField->catalog : "") );
+/* pdesrec->setconcise_type; - type specific */
+/* pdesrec->setdata_ptr; - N/A */
+/* pdesrec->setdatetime_interval_code; - type specific */
+ pdesrec->setDatetimeIntervalPrecision( 10 ); /* this is a conservative guess
- not sure what precision we get when we diff 2 times */
+ pdesrec->setDisplaySize( pField->max_length ); /* - also type specific */
+ pdesrec->setFixedPrecScale( SQL_FALSE ); /* - also type specific */
+/* pdesrec->setindicator_ptr; - N/A */
+ pdesrec->setLabel( pField->name );
+/* pdesrec->setlength; - type specific */
+/* pdesrec->setliteral_prefix; - type specific */
+/* pdesrec->setliteral_suffix; - type specific */
+ pdesrec->setLocalTypeName( "" );
+ pdesrec->setName( nField pField->name );
+ pdesrec->setNullable( ((pField->flags && NOT_NULL_FLAG) ? SQL_NO_NULLS
: SQL_NULLABLE) );
+/* pdesrec->setnum_prec_radix; - type specific */
+/* pdesrec->setoctet_length; - type specific */
+/* pdesrec->setoctet_length_ptr; - N/A */
+/* pdesrec->setparamter_type; - N/A */
+/* pdesrec->setprecision; - type specific */
+ pdesrec->setRowver( SQL_FALSE ); /* - also type specific */
+ pdesrec->setScale( pField->decimals );
+ pdesrec->setSchemaName( pField->db );
+ pdesrec->setSearchable( SQL_PRED_SEARCHABLE );
+ pdesrec->setTableName( pField->table );
+/* pdesrec->settype; - type specific */
+/* pdesrec->settype_name; - type specific */
+ pdesrec->setUnnamed( SQL_NAMED );
+ pdesrec->setUnsigned( (pField->flags & UNSIGNED_FLAG ? SQL_TRUE :
SQL_FALSE) );
+ pdesrec->setUpdatable( (pField->table && pField->table[0] ?
SQL_ATTR_READWRITE_UNKNOWN : SQL_ATTR_READONLY) );
+
/*
set type specific values here
@@ -462,306 +731,306 @@
switch ( pField->type )
{
case MYSQL_TYPE_BLOB:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
if ( pField->flags & BINARY_FLAG )
{
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setTypeName( nField, "blob" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARBINARY );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setTypeName( "blob" );
+ pdesrec->setConciseType( SQL_LONGVARBINARY );
}
else
{
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setTypeName( nField, "text" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARCHAR );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setTypeName( "text" );
+ pdesrec->setConciseType( SQL_LONGVARCHAR );
}
break;
case MYSQL_TYPE_DATE:
- getImpRowDesc()->setDisplaySize( nField, 10 );
- getImpRowDesc()->setLength( nField, 10 );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setPrecision( nField, 10 );
- getImpRowDesc()->setTypeName( nField, "date" );
- getImpRowDesc()->setConciseType( nField, SQL_TYPE_DATE );
+ pdesrec->setDisplaySize( 10 );
+ pdesrec->setLength( 10 );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setPrecision( 10 );
+ pdesrec->setTypeName( "date" );
+ pdesrec->setConciseType( SQL_TYPE_DATE );
break;
case MYSQL_TYPE_DATETIME:
- getImpRowDesc()->setDisplaySize( nField, 19 );
- getImpRowDesc()->setLength( nField, 19 );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setPrecision( nField, 19 );
- getImpRowDesc()->setTypeName( nField, "datetime" );
- getImpRowDesc()->setConciseType( nField, SQL_TYPE_TIMESTAMP );
+ pdesrec->setDisplaySize( 19 );
+ pdesrec->setLength( 19 );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setPrecision( 19 );
+ pdesrec->setTypeName( "datetime" );
+ pdesrec->setConciseType( SQL_TYPE_TIMESTAMP );
break;
case MYSQL_TYPE_DECIMAL:
- getImpRowDesc()->setDisplaySize( nField, max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals ) );
- getImpRowDesc()->setFixedPrecScale( nField, pField->decimals ? SQL_TRUE
: SQL_FALSE );
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 10 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)max(
pField->length, pField->max_length ) - test( !( pField->flags &
UNSIGNED_FLAG ) ) - test( pField->decimals ) );
- getImpRowDesc()->setTypeName( nField, "decimal" );
- getImpRowDesc()->setConciseType( nField, SQL_DECIMAL );
+ pdesrec->setDisplaySize( max( pField->length, pField->max_length ) -
test( !( pField->flags & UNSIGNED_FLAG ) ) - test( pField->decimals ) );
+ pdesrec->setFixedPrecScale( pField->decimals ? SQL_TRUE : SQL_FALSE );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 10 );
+ pdesrec->setPrecision( (SQLSMALLINT)max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals ) );
+ pdesrec->setTypeName( "decimal" );
+ pdesrec->setConciseType( SQL_DECIMAL );
break;
case MYSQL_TYPE_DOUBLE:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "double unsigned" );
+ pdesrec->setTypeName( "double unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "double" );
- getImpRowDesc()->setConciseType( nField, SQL_DOUBLE );
+ pdesrec->setTypeName( "double" );
+ pdesrec->setConciseType( SQL_DOUBLE );
break;
case MYSQL_TYPE_ENUM:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setTypeName( nField, "enum" );
- getImpRowDesc()->setConciseType( nField, SQL_CHAR );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setTypeName( "enum" );
+ pdesrec->setConciseType( SQL_CHAR );
break;
case MYSQL_TYPE_FLOAT:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "float unsigned" );
+ pdesrec->setTypeName( "float unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "float" );
- getImpRowDesc()->setConciseType( nField, SQL_REAL );
+ pdesrec->setTypeName( "float" );
+ pdesrec->setConciseType( SQL_REAL );
break;
case MYSQL_TYPE_GEOMETRY:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setTypeName( nField, "blob" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARBINARY );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setTypeName( "blob" );
+ pdesrec->setConciseType( SQL_LONGVARBINARY );
break;
case MYSQL_TYPE_INT24:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "mediumint unsigned" );
+ pdesrec->setTypeName( "mediumint unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "mediumint" );
- getImpRowDesc()->setConciseType( nField, SQL_INTEGER );
+ pdesrec->setTypeName( "mediumint" );
+ pdesrec->setConciseType( SQL_INTEGER );
break;
case MYSQL_TYPE_LONG:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "integer unsigned" );
+ pdesrec->setTypeName( "integer unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "integer" );
- getImpRowDesc()->setConciseType( nField, SQL_TINYINT );
+ pdesrec->setTypeName( "integer" );
+ pdesrec->setConciseType( SQL_TINYINT );
break;
case MYSQL_TYPE_LONG_BLOB:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
if (pField->flags & BINARY_FLAG)
{
- getImpRowDesc()->setTypeName( nField, "longblob" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARBINARY );
+ pdesrec->setTypeName( "longblob" );
+ pdesrec->setConciseType( SQL_LONGVARBINARY );
}
else
{
- getImpRowDesc()->setTypeName( nField, "longtext" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARCHAR );
+ pdesrec->setTypeName( "longtext" );
+ pdesrec->setConciseType( SQL_LONGVARCHAR );
}
break;
case MYSQL_TYPE_LONGLONG:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
if ( pField->flags & UNSIGNED_FLAG )
{
- getImpRowDesc()->setPrecision( nField, 20 );
- getImpRowDesc()->setTypeName( nField, "bigint unsigned" );
+ pdesrec->setPrecision( 20 );
+ pdesrec->setTypeName( "bigint unsigned" );
}
else
{
- getImpRowDesc()->setPrecision( nField, 19 );
- getImpRowDesc()->setTypeName( nField, "bigint" );
+ pdesrec->setPrecision( 19 );
+ pdesrec->setTypeName( "bigint" );
}
- getImpRowDesc()->setConciseType( nField, SQL_BIGINT );
+ pdesrec->setConciseType( SQL_BIGINT );
break;
case MYSQL_TYPE_MEDIUM_BLOB:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
if ( pField->flags & BINARY_FLAG )
{
- getImpRowDesc()->setTypeName( nField, "mediumblob" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARBINARY );
+ pdesrec->setTypeName( "mediumblob" );
+ pdesrec->setConciseType( SQL_LONGVARBINARY );
}
else
{
- getImpRowDesc()->setTypeName( nField, "mediumtext" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARCHAR );
+ pdesrec->setTypeName( "mediumtext" );
+ pdesrec->setConciseType( SQL_LONGVARCHAR );
}
break;
case MYSQL_TYPE_NEWDATE:
- getImpRowDesc()->setDisplaySize( nField, 10 );
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setPrecision( nField, 10 );
- getImpRowDesc()->setTypeName( nField, "date" );
- getImpRowDesc()->setConciseType( nField, SQL_TYPE_DATE );
+ pdesrec->setDisplaySize( 10 );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setPrecision( 10 );
+ pdesrec->setTypeName( "date" );
+ pdesrec->setConciseType( SQL_TYPE_DATE );
break;
case MYSQL_TYPE_NULL:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setTypeName( nField, "null" );
- getImpRowDesc()->setConciseType( nField, SQL_VARCHAR );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setTypeName( "null" );
+ pdesrec->setConciseType( SQL_VARCHAR );
break;
case MYSQL_TYPE_SHORT:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "smallint unsigned" );
+ pdesrec->setTypeName( "smallint unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "smallint" );
- getImpRowDesc()->setConciseType( nField, SQL_SMALLINT );
+ pdesrec->setTypeName( "smallint" );
+ pdesrec->setConciseType( SQL_SMALLINT );
break;
case MYSQL_TYPE_TIME:
- getImpRowDesc()->setDisplaySize( nField, 8 );
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setPrecision( nField, 8 );
- getImpRowDesc()->setTypeName( nField, "time" );
- getImpRowDesc()->setConciseType( nField, SQL_TYPE_TIME );
+ pdesrec->setDisplaySize( 8 );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setPrecision( 8 );
+ pdesrec->setTypeName( "time" );
+ pdesrec->setConciseType( SQL_TYPE_TIME );
break;
case MYSQL_TYPE_TIMESTAMP:
- getImpRowDesc()->setDisplaySize( nField, 19 );
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setPrecision( nField, 19 );
- getImpRowDesc()->setRowver( nField, SQL_TRUE );
- getImpRowDesc()->setTypeName( nField, "timestamp" );
- getImpRowDesc()->setConciseType( nField, SQL_TYPE_TIMESTAMP );
+ pdesrec->setDisplaySize( 19 );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setPrecision( 19 );
+ pdesrec->setRowver( SQL_TRUE );
+ pdesrec->setTypeName( "timestamp" );
+ pdesrec->setConciseType( SQL_TYPE_TIMESTAMP );
break;
case MYSQL_TYPE_SET:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setTypeName( nField, "set" );
- getImpRowDesc()->setConciseType( nField, SQL_CHAR );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setTypeName( "set" );
+ pdesrec->setConciseType( SQL_CHAR );
break;
case MYSQL_TYPE_STRING:
- getImpRowDesc()->setDisplaySize( nField, pField->length ?
pField->length : 255 );
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setTypeName( nField, "char" );
- getImpRowDesc()->setConciseType( nField, SQL_CHAR );
+ pdesrec->setDisplaySize( pField->length ? pField->length : 255 );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setTypeName( "char" );
+ pdesrec->setConciseType( SQL_CHAR );
break;
case MYSQL_TYPE_TINY:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 2 );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 2 );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
if ( pField->flags & NUM_FLAG )
{
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "tinyint unsigned" );
+ pdesrec->setTypeName( "tinyint unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "tinyint" );
- getImpRowDesc()->setConciseType( nField, SQL_TINYINT );
+ pdesrec->setTypeName( "tinyint" );
+ pdesrec->setConciseType( SQL_TINYINT );
}
else
{
if ( pField->flags & UNSIGNED_FLAG )
- getImpRowDesc()->setTypeName( nField, "char unsigned" );
+ pdesrec->setTypeName( "char unsigned" );
else
- getImpRowDesc()->setTypeName( nField, "char" );
- getImpRowDesc()->setConciseType( nField, SQL_CHAR );
+ pdesrec->setTypeName( "char" );
+ pdesrec->setConciseType( SQL_CHAR );
}
break;
case MYSQL_TYPE_TINY_BLOB:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "" );
- getImpRowDesc()->setLiteralSuffix( nField, "" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "" );
+ pdesrec->setLiteralSuffix( "" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
if ( pField->flags & BINARY_FLAG )
{
- getImpRowDesc()->setTypeName( nField, "tinyblob" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARBINARY );
+ pdesrec->setTypeName( "tinyblob" );
+ pdesrec->setConciseType( SQL_LONGVARBINARY );
}
else
{
- getImpRowDesc()->setTypeName( nField, "tinytext" );
- getImpRowDesc()->setConciseType( nField, SQL_LONGVARCHAR );
+ pdesrec->setTypeName( "tinytext" );
+ pdesrec->setConciseType( SQL_LONGVARCHAR );
}
break;
case MYSQL_TYPE_VAR_STRING:
- getImpRowDesc()->setDisplaySize( nField, pField->length ?
pField->length : 255 );
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setTypeName( nField, "varchar" );
- getImpRowDesc()->setConciseType( nField, SQL_VARCHAR );
+ pdesrec->setDisplaySize( pField->length ? pField->length : 255 );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setTypeName( "varchar" );
+ pdesrec->setConciseType( SQL_VARCHAR );
break;
case MYSQL_TYPE_YEAR:
- getImpRowDesc()->setLength( nField, pField->max_length );
- getImpRowDesc()->setLiteralPrefix( nField, "\"'" );
- getImpRowDesc()->setLiteralSuffix( nField, "\"'" );
- getImpRowDesc()->setNumPrecRadix( nField, 0 );
- getImpRowDesc()->setOctetLength( nField, pField->max_length );
- getImpRowDesc()->setPrecision( nField, (SQLSMALLINT)pField->max_length
);
- getImpRowDesc()->setTypeName( nField, "year" );
- getImpRowDesc()->setConciseType( nField, SQL_SMALLINT );
+ pdesrec->setLength( pField->max_length );
+ pdesrec->setLiteralPrefix( "\"'" );
+ pdesrec->setLiteralSuffix( "\"'" );
+ pdesrec->setNumPrecRadix( 0 );
+ pdesrec->setOctetLength( pField->max_length );
+ pdesrec->setPrecision( (SQLSMALLINT)pField->max_length );
+ pdesrec->setTypeName( "year" );
+ pdesrec->setConciseType( SQL_SMALLINT );
break;
default:
{
@@ -772,14 +1041,18 @@
MYODBCDbgReturn( SQL_SUCCESS );
}
-
void MYODBCResServer::doInit()
{
pstm = mysql_stmt_init( pmysql );
nRow = 0;
pbindColumns = NULL;
stringStatement = QString::null;
- bBuffered = true;
Q_ASSERT( !pstm );
}
+void MYODBCResServer::doFini()
+{
+ getImpRowDesc()->doClear();
+ mysql_stmt_close( pstm );
+}
+
Modified: MYODBCRes/MYODBCResTest/MYODBCResTest.cpp
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.cpp 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.cpp 2006-02-13 17:22:45 UTC (rev 56)
@@ -48,44 +48,45 @@
/* imitates a SQLStatistics call */
void MYODBCResTest::driver()
{
- MYODBCDia * pdia = new MYODBCDia();
- MYODBCDes * pdes = new MYODBCDesIRD( (SQLHANDLE)1 );
- MYODBCRes * pres = new MYODBCResDriver( pdia, pdes, (MYSQL *)1 );
- uint nColumns = 0;
- qulonglong nRows = 0;
- qulonglong nRow = 0;
- QVariant variantData;
+ MYODBCDia * pdia = new MYODBCDia();
+ MYODBCAttStatement *patt = new MYODBCAttStatement( (SQLHANDLE)1, pdia );
+ MYODBCRes * pres = new MYODBCResDriver( patt, (MYSQL *)1 );
+ MYODBCDes * pdes = patt->getImpRowDesc();
+ uint nColumns = 0;
+ qulonglong nRows = 0;
+ qulonglong nRow = 0;
+ QVariant variantData;
/* its a driver resultset so we must set the IRD manually */
pdes->setCount( 13 );
- pdes->setName( 0, "bookmark" );
- pdes->setType( 0, SQL_INTEGER );
- pdes->setName( 1, "TABLE_CAT" );
- pdes->setType( 1, SQL_VARCHAR );
- pdes->setName( 2, "TABLE_SCHEM" );
- pdes->setType( 2, SQL_VARCHAR );
- pdes->setName( 3, "TABLE_NAME" );
- pdes->setType( 3, SQL_VARCHAR );
- pdes->setName( 4, "NON_UNIQUE" );
- pdes->setType( 4, SQL_SMALLINT );
- pdes->setName( 5, "INDEX_QUALIFIER" );
- pdes->setType( 5, SQL_VARCHAR );
- pdes->setName( 6, "INDEX_NAME" );
- pdes->setType( 6, SQL_VARCHAR );
- pdes->setName( 7, "TYPE" );
- pdes->setType( 7, SQL_SMALLINT );
- pdes->setName( 8, "ORDINAL_POSITION" );
- pdes->setType( 8, SQL_SMALLINT );
- pdes->setName( 9, "COLUMN_NAME" );
- pdes->setType( 9, SQL_VARCHAR );
- pdes->setName( 10, "ASC_OR_DESC" );
- pdes->setType( 10, SQL_CHAR );
- pdes->setName( 11, "CARDINALITY" );
- pdes->setType( 11, SQL_INTEGER );
- pdes->setName( 12, "PAGES" );
- pdes->setType( 12, SQL_INTEGER );
- pdes->setName( 13, "FILTER_CONDITION" );
- pdes->setType( 13, SQL_VARCHAR );
+ pdes->vectorRecords[0]->setName( "bookmark" );
+ pdes->vectorRecords[0]->setType( SQL_INTEGER );
+ pdes->vectorRecords[1]->setName( "TABLE_CAT" );
+ pdes->vectorRecords[1]->setType( SQL_VARCHAR );
+ pdes->vectorRecords[2]->setName( "TABLE_SCHEM" );
+ pdes->vectorRecords[2]->setType( SQL_VARCHAR );
+ pdes->vectorRecords[3]->setName( "TABLE_NAME" );
+ pdes->vectorRecords[3]->setType( SQL_VARCHAR );
+ pdes->vectorRecords[4]->setName( "NON_UNIQUE" );
+ pdes->vectorRecords[4]->setType( SQL_SMALLINT );
+ pdes->vectorRecords[5]->setName( "INDEX_QUALIFIER" );
+ pdes->vectorRecords[5]->setType( SQL_VARCHAR );
+ pdes->vectorRecords[6]->setName( "INDEX_NAME" );
+ pdes->vectorRecords[6]->setType( SQL_VARCHAR );
+ pdes->vectorRecords[7]->setName( "TYPE" );
+ pdes->vectorRecords[7]->setType( SQL_SMALLINT );
+ pdes->vectorRecords[8]->setName( "ORDINAL_POSITION" );
+ pdes->vectorRecords[8]->setType( SQL_SMALLINT );
+ pdes->vectorRecords[9]->setName( "COLUMN_NAME" );
+ pdes->vectorRecords[9]->setType( SQL_VARCHAR );
+ pdes->vectorRecords[10]->setName( "ASC_OR_DESC" );
+ pdes->vectorRecords[10]->setType( SQL_CHAR );
+ pdes->vectorRecords[11]->setName( "CARDINALITY" );
+ pdes->vectorRecords[11]->setType( SQL_INTEGER );
+ pdes->vectorRecords[12]->setName( "PAGES" );
+ pdes->vectorRecords[12]->setType( SQL_INTEGER );
+ pdes->vectorRecords[13]->setName( "FILTER_CONDITION" );
+ pdes->vectorRecords[13]->setType( SQL_VARCHAR );
pres->getColumns( &nColumns );
QCOMPARE( (int)nColumns, 13 );
@@ -131,6 +132,12 @@
pres->doNext();
pres->getData( 1, variantData );
QCOMPARE( 2, variantData.toInt() );
+ pres->getData( 4, variantData );
+ QCOMPARE( SQL_FALSE, variantData.toInt() );
+ pres->getData( 5, variantData );
+ QCOMPARE( true, variantData.isNull() );
+ pres->getData( 9, variantData );
+ QCOMPARE( QString( "MyColumnName" ), variantData.toString() );
pres->doNext();
pres->getData( 1, variantData );
@@ -186,7 +193,7 @@
/* fini */
delete pres;
- delete pdes;
+ delete patt;
delete pdia;
}
Modified: MYODBCRes/MYODBCResTest/MYODBCResTest.pro
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -12,13 +12,16 @@
INCLUDEPATH += ../../MYODBCC/include
INCLUDEPATH += ../../MYODBCDbg/include
INCLUDEPATH += ../../MYODBCDia/include
+INCLUDEPATH += ../../MYODBCAtt/include
INCLUDEPATH += ../../MYODBCDes/include
INCLUDEPATH += ../include
LIBS += -L../../lib
LIBS += -lMYODBCRes
LIBS += -lMYODBCDes
+LIBS += -lMYODBCAtt
LIBS += -lMYODBCDia
LIBS += -lMYODBCDbg
+LIBS += -lMYODBCC
include( ../../mysql.pri )
Modified: MYODBCRes/MYODBCResTest/MYODBCResTest.vpj
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.vpj 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.vpj 2006-02-13 17:22:45 UTC (rev 56)
@@ -185,6 +185,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="missing.c"/>
+ <F N="MYODBCResTest.cpp"/>
</Folder>
<Folder
Name="Header Files"
Modified: MYODBCRes/include/MYODBCRes.h
===================================================================
--- MYODBCRes/include/MYODBCRes.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/include/MYODBCRes.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -44,7 +44,10 @@
virtual SQLRETURN getRow( qulonglong *pnRow ) = 0;
virtual SQLRETURN getRows( qulonglong *pnRows ) = 0;
- virtual SQLRETURN doAppend() = 0;
+ /* odbc */
+ virtual SQLRETURN doBindCol( SQLUSMALLINT nColumnNumber, SQLSMALLINT nTargetType,
SQLPOINTER pTargetValuePtr, SQLINTEGER nBufferLength, SQLLEN *pnStrLenOrInd );
+
+ virtual SQLRETURN doAppend( int nToAppend = 1 ) = 0;
virtual SQLRETURN doClear() = 0;
virtual SQLRETURN doDelete() = 0;
virtual SQLRETURN doExecute() = 0;
@@ -54,7 +57,6 @@
virtual SQLRETURN doNext() = 0;
virtual SQLRETURN doPrepare( const QString &stringStatement ) = 0;
virtual SQLRETURN doPrev() = 0;
- virtual SQLRETURN doSeek( qlonglong nRow ) = 0;
virtual SQLRETURN doSkip( qlonglong nRows ) = 0;
virtual bool isValidColumn( uint nColumn );
@@ -66,9 +68,9 @@
MYSQL * pmysql; /*!< parent of MYSQL_RES or MYSQL_STMT */
virtual MYODBCDes * getAppParamDesc(); /*!< SQL_ATTR_APP_PARAM_DESC
*/
- virtual MYODBCDes * getAppRowDesc(); /*!< SQL_ATTR_APP_ROW_DESC
*/
+ virtual MYODBCDes * getAppRowDesc(); /*!< SQL_ATTR_APP_ROW_DESC
(bound columns) */
virtual MYODBCDes * getImpParamDesc(); /*!< SQL_ATTR_IMP_PARAM_DESC
*/
- virtual MYODBCDes * getImpRowDesc(); /*!< SQL_ATTR_IMP_ROW_DESC
*/
+ virtual MYODBCDes * getImpRowDesc(); /*!< SQL_ATTR_IMP_ROW_DESC
(result columns) */
virtual MYODBCDia * getDia();
virtual MYODBCAttStatement *getAtt();
};
Modified: MYODBCRes/include/MYODBCResDriver.h
===================================================================
--- MYODBCRes/include/MYODBCResDriver.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/include/MYODBCResDriver.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -17,7 +17,7 @@
SQLRETURN getRow( qulonglong *pnRow );
SQLRETURN getRows( qulonglong *pnRows );
- SQLRETURN doAppend();
+ SQLRETURN doAppend( int nToAppend = 1 );
SQLRETURN doClear();
SQLRETURN doDelete();
SQLRETURN doExecute();
@@ -27,7 +27,6 @@
SQLRETURN doNext();
SQLRETURN doPrepare( const QString &stringStatement );
SQLRETURN doPrev();
- SQLRETURN doSeek( qlonglong nRow );
SQLRETURN doSkip( qlonglong nRows );
SQLRETURN doGetTypeInfo( SQLSMALLINT nDataType ); /*<! \sa SQLGetTypeInfo */
Modified: MYODBCRes/include/MYODBCResServer.h
===================================================================
--- MYODBCRes/include/MYODBCResServer.h 2006-02-06 05:09:37 UTC (rev 55)
+++ MYODBCRes/include/MYODBCResServer.h 2006-02-13 17:22:45 UTC (rev 56)
@@ -3,6 +3,26 @@
#include "MYODBCRes.h"
+/*
+ MYSQL_BIND has some limitations for us so we wrap it with some
+ extra stuff.
+*/
+typedef struct tMYODBC_BIND_COL
+{
+ SQLUSMALLINT nColumn; /* as provided by app (from ARD or direct from
SQLGetData) */
+ SQLPOINTER pTarget; /* as provided by app (from ARD or direct from
SQLGetData) */
+ bool bConvertRequired; /* we had to allocate pbind->buffer so we can
convert data to type not understood by mysql */
+
+ MYSQL_BIND bind; /* mysql bind we pass to
mysql_stmt_fetch_column() */
+
+ /* only used for SQLGetData */
+ SQLSMALLINT nTargetType; /* as provided by app via SQLGetData
*/
+ SQLINTEGER nTargetSize; /* as provided by app via SQLGetData
*/
+ SQLINTEGER * pnStrLenInd; /* as provided by app via SQLGetData
*/
+
+} MYODBC_BIND_COL;
+
+
class MYODBCResServer : public MYODBCRes
{
public:
@@ -17,7 +37,7 @@
SQLRETURN getRow( qulonglong *pnRow );
SQLRETURN getRows( qulonglong *pnRows );
- SQLRETURN doAppend();
+ SQLRETURN doAppend( int nToAppend = 1 );
SQLRETURN doClear();
SQLRETURN doDelete();
SQLRETURN doExecute();
@@ -27,26 +47,29 @@
SQLRETURN doNext();
SQLRETURN doPrepare( const QString &stringStatement );
SQLRETURN doPrev();
- SQLRETURN doSeek( qlonglong nRow );
SQLRETURN doSkip( qlonglong nRows );
bool isValidRow();
bool isValidRow( qulonglong nRow );
protected:
- MYSQL_STMT *pstm; /* MySQL prepared statement
*/
- MYSQL_BIND *pbindColumns; /* we bind all/any columns of resultset here
*/
- qulonglong nRow; /* current row (1 - based, 0 is BOF/EOF)
*/
- QString stringStatement; /* SQL statement as provided to doPrepare()
*/
- bool bBuffered; /* true if we pull complete resultset to client
*/
- bool bForwardOnly; /* we will not */
+ MYSQL_STMT * pstm; /* MySQL prepared statement
*/
+ MYSQL_BIND * pbindColumns; /* binds for every col in res - loaded witb call
to mysql_stmt_fetch_column() as needed */
+ qulonglong nRow; /* Current row. This is 1-based but a 0 is valid
(means before first row and after last row). */
+ QString stringStatement; /* SQL statement as provided to doPrepare()
*/
-
+ /* prepare MYSQL_BIND for a call to mysql_stmt_fetch_column() - used by SQLColBind
and SQLGetData */
+ SQLRETURN doInitBindCol( MYODBC_BIND_COL *pbind, uint nColumn, SQLSMALLINT
nTargetType, SQLPOINTER pTarget, SQLINTEGER nTargetSize, SQLINTEGER *pnStrLenInd );
+ /* for some types we have had to use our own data buffer. for example mysql knows
nothing about SQL_NUMERIC_STRUCT - this is freed in here */
+ SQLRETURN doFiniBindCol( MYODBC_BIND_COL *pbind );
+ /* this calls mysql_stmt_fetch_column() to get column data; does any translations
needed ie for SQL_NUMERIC_STRUCT - bound target buffers are updated */
+ SQLRETURN getData( MYODBC_BIND_COL *pbind );
SQLRETURN doLoadMetaData(); /* load resultset meta data (IRD)
*/
SQLRETURN doLoadMetaDataField( unsigned int nField, MYSQL_FIELD *pField ); /* load
resultset column meta data (IRD) */
void doInit();
+ void doFini();
};
#endif
Modified: PostBuildTest.bat
===================================================================
--- PostBuildTest.bat 2006-02-06 05:09:37 UTC (rev 55)
+++ PostBuildTest.bat 2006-02-13 17:22:45 UTC (rev 56)
@@ -1,32 +1,13 @@
ECHO OFF
ECHO BEGIN: Post build test...
cd bin
-ECHO C...
-MYODBCCTest
-ECHO .
-ECHO Array...
-MYODBCArrayTest
-ECHO .
-ECHO List...
-MYODBCListTest
-ECHO .
-ECHO Installer...
+MYODBCDbgTest
MYODBCInsTest
-ECHO .
-ECHO Setup...
-MYODBCSetupTest
-ECHO .
-ECHO Diagnostics...
MYODBCDiaTest
-ECHO .
-ECHO Descriptors...
MYODBCDesTest
-ECHO .
-ECHO Results...
-MYODBCResTest
-ECHO .
-ECHO Driver...
-MYODBCDrvTest
+MYODBCAttTest
+REM MYODBCResTest
+REM MYODBCDrvTest
cd ..
ECHO .
ECHO END: Post build test.
Modified: defines.pri
===================================================================
--- defines.pri 2006-02-06 05:09:37 UTC (rev 55)
+++ defines.pri 2006-02-13 17:22:45 UTC (rev 56)
@@ -10,20 +10,24 @@
#
# #########################################################
+DEFINES += MYODBC_VENDOR=\"MySQL\"
+DEFINES += MYODBC_NAME=\"MyODBC\"
+DEFINES += MYODBC_DRIVER_VER=\"05.00.0002\"
+
# #########################################################
# Set this to the majour version number.
# #########################################################
-DEFINES += MYODBC_VER_MAJOUR=5
+# DEFINES += MYODBC_VER_MAJOUR=5
# #########################################################
# Set this to the minor version number.
# #########################################################
-DEFINES += MYODBC_VER_MINOR=00
+# DEFINES += MYODBC_VER_MINOR=00
# #########################################################
# Set this to the release number.
# #########################################################
-DEFINES += MYODBC_VER_RELEASE=1
+# DEFINES += MYODBC_VER_RELEASE=1
# #########################################################
# Use this to remove some sanity checks which may only be
Modified: root.pro
===================================================================
--- root.pro 2006-02-06 05:09:37 UTC (rev 55)
+++ root.pro 2006-02-13 17:22:45 UTC (rev 56)
@@ -44,10 +44,10 @@
# #########################################################
TEMPLATE = subdirs
SUBDIRS = \
-# MYODBCC \
+ MYODBCC \
MYODBCDbg \
# MYODBCRtti (nothing to build here) \
- MYODBCTst \
+# MYODBCTst \
MYODBCIns \
# MYODBCSetup \
MYODBCDia \
| Thread |
|---|
| • Connector/ODBC 5 commit: r56 - / MYODBCAtt MYODBCAtt/MYODBCAttLib MYODBCAtt/MYODBCAttTest MYODBCC MYODBCC/MYODBCCLib MYODBCC/include MYODBCDbg/MYODBCD... | pharvey | 13 Feb |