MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:pharvey Date:May 19 2006 5:41pm
Subject:Connector/ODBC 5 commit: r261 - MYODBCC/MYODBCCLib MYODBCC/include MYSQLPlus/MYSQLPlusLib
View as plain text  
Modified:
   MYODBCC/MYODBCCLib/MYODBCC.cpp
   MYODBCC/include/MYODBCC.h
   MYSQLPlus/MYSQLPlusLib/MConnection.cpp
   MYSQLPlus/MYSQLPlusLib/MDiagnosticRecord.cpp
   MYSQLPlus/MYSQLPlusLib/MResult.cpp
   MYSQLPlus/MYSQLPlusLib/MResultStmt.cpp
Log:


Modified: MYODBCC/MYODBCCLib/MYODBCC.cpp
===================================================================
--- MYODBCC/MYODBCCLib/MYODBCC.cpp	2006-05-19 15:39:39 UTC (rev 260)
+++ MYODBCC/MYODBCCLib/MYODBCC.cpp	2006-05-19 17:41:04 UTC (rev 261)
@@ -1382,24 +1382,7 @@
 {
     return memcpy( pDest, pSrc, nBytes );
 }
-
-/*
-#if defined(_WIN32) && _MSC_VER >= 1400
-    BOOLEAN MYODBCC::doStrNCpy( SQLWCHAR *pszDest, size_t nSizeInWords, const SQLWCHAR
*pszSrc, size_t nChars )
-    {
-        if ( wcsncpy_s( pszDest, nSizeInWords, pszSrc, nChars ) )
-            return false;
-        return true;
-    }
-#else
-    BOOLEAN MYODBCC::doStrNCpy( SQLWCHAR *pszDest, size_t nMaxChars, const SQLWCHAR
*pszSrc )
-    {
-        wcsncpy( pszDest, pszSrc, nChars );
-        return true;
-    }
-#endif
-*/
-
+ 
 /*!
     \brief      Copies a C string.
 

Modified: MYODBCC/include/MYODBCC.h
===================================================================
--- MYODBCC/include/MYODBCC.h	2006-05-19 15:39:39 UTC (rev 260)
+++ MYODBCC/include/MYODBCC.h	2006-05-19 17:41:04 UTC (rev 261)
@@ -242,23 +242,11 @@
     static QString getIntervalCodeString( SQLSMALLINT nCode );
     static QString getInstallerErrorString( RETCODE nRetCode );
 
-    static void *   doMemCpy( void *pDest, const void *pSrc, size_t nBytes );
-
-/*
-#if defined(_WIN32) && _MSC_VER >= 1400
-    static BOOLEAN  doStrNCpy( SQLWCHAR *pszDest, size_t nSizeInWords, const SQLWCHAR
*pszSrc, size_t nChars = _TRUNCATE );
-#else
-    static BOOLEAN  doStrNCpy( SQLWCHAR *pszDest, size_t nSizeInWords, const SQLWCHAR
*pszSrc );
-#endif
-*/
-
-    static BOOLEAN doStringCopyIn( SQLWCHAR *pszDest, SQLINTEGER nDestMaxChars, SQLWCHAR
*pszSrc, SQLINTEGER nSrcChars );
-    static BOOLEAN doStringCopyIn( SQLWCHAR *pszDest, SQLINTEGER nDestMaxChars, SQLWCHAR
*pszSrc, SQLINTEGER nSrcChars );
+    static void *  doMemCpy( void *pDest, const void *pSrc, size_t nBytes );
     static BOOLEAN doStringCopyOut( SQLCHAR *pszDest, SQLINTEGER nDestMaxChars, SQLCHAR
*pszSrc );
     static BOOLEAN doStringCopyOut( SQLWCHAR *pszDest, SQLINTEGER nDestMaxChars, SQLWCHAR
*pszSrc );
+    static void    doFree( void *p );
 
-    static void     doFree( void *p );
-
     static BOOLEAN isConnectAttr( SQLINTEGER nAttribute );
     static BOOLEAN isConnectOption( SQLUSMALLINT nOption );
     static BOOLEAN isDiagField( SQLSMALLINT nDiagField );

Modified: MYSQLPlus/MYSQLPlusLib/MConnection.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MConnection.cpp	2006-05-19 15:39:39 UTC (rev 260)
+++ MYSQLPlus/MYSQLPlusLib/MConnection.cpp	2006-05-19 17:41:04 UTC (rev 261)
@@ -311,7 +311,7 @@
                     MYODBCDbgReturn( SQL_NO_DATA );
                     *pnLen = 0;
                 }
-                else if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pValue, nBufferLength /
sizeof(SQLWCHAR), getCurrentCatalog().utf16() ) )
+                else if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pValue, nBufferLength /
sizeof(SQLWCHAR), (SQLWCHAR*)getCurrentCatalog().utf16() ) )
                     MYODBCDbgReturn( pDiagnostic->doAppend( MDiagnostic::DIA_HY000, 0,
tr("doStringCopyOut() failed.") ) );
             }
 
@@ -376,7 +376,7 @@
                     MYODBCDbgReturn( SQL_NO_DATA );
                     *pnLen = 0;
                 }
-                else if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pValue, nBufferLength /
sizeof(SQLWCHAR), getTracefile().utf16() ) )
+                else if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pValue, nBufferLength /
sizeof(SQLWCHAR), (SQLWCHAR*)getTracefile().utf16() ) )
                     MYODBCDbgReturn( pDiagnostic->doAppend( MDiagnostic::DIA_HY000, 0,
tr("doStringCopyOut() failed.") ) );
             }
 
@@ -405,7 +405,7 @@
                     MYODBCDbgReturn( SQL_NO_DATA );
                     *pnLen = 0;
                 }
-                else if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pValue, nBufferLength /
sizeof(SQLWCHAR), getTranslateLib().utf16() ) )
+                else if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pValue, nBufferLength /
sizeof(SQLWCHAR), (SQLWCHAR*)getTranslateLib().utf16() ) )
                     MYODBCDbgReturn( pDiagnostic->doAppend( MDiagnostic::DIA_HY000, 0,
tr("doStringCopyOut() failed.") ) );
             }
 

Modified: MYSQLPlus/MYSQLPlusLib/MDiagnosticRecord.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MDiagnosticRecord.cpp	2006-05-19 15:39:39 UTC (rev 260)
+++ MYSQLPlus/MYSQLPlusLib/MDiagnosticRecord.cpp	2006-05-19 17:41:04 UTC (rev 261)
@@ -196,7 +196,7 @@
                     MYODBCDbgReturn( SQL_ERROR );
 
                 *pnStringLengthPtr = stringServerName.length() * sizeof(SQLWCHAR);
-                if ( !MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringServerName.utf16() ) )
+                if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), (SQLWCHAR*)stringServerName.utf16() ) )
                     MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
             }
             break;
@@ -207,10 +207,8 @@
                 if ( nBufferLength < 1 || stringSQLState.isNull() )
                     MYODBCDbgReturn( SQL_ERROR );
 
-                MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringSQLState.utf16() );
                 *pnStringLengthPtr = stringSQLState.length() * sizeof(SQLWCHAR);
-
-                if ( *pnStringLengthPtr > nBufferLength )
+                if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), (SQLWCHAR*)stringSQLState.utf16() ) )
                     MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
             }
             break;
@@ -221,10 +219,8 @@
                 if ( nBufferLength < 1 || stringSubClassOrigin.isNull() )
                     MYODBCDbgReturn( SQL_ERROR );
 
-                MYODBCC::doStrNCpy( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), stringSubClassOrigin.utf16() );
                 *pnStringLengthPtr = stringSubClassOrigin.length() * sizeof(SQLWCHAR);
-
-                if ( *pnStringLengthPtr > nBufferLength )
+                if ( !MYODBCC::doStringCopyOut( (SQLWCHAR*)pDiagInfoPtr, nBufferLength /
sizeof(SQLWCHAR), (SQLWCHAR*)stringSubClassOrigin.utf16() ) )
                     MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
             }
             break;

Modified: MYSQLPlus/MYSQLPlusLib/MResult.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MResult.cpp	2006-05-19 15:39:39 UTC (rev 260)
+++ MYSQLPlus/MYSQLPlusLib/MResult.cpp	2006-05-19 17:41:04 UTC (rev 261)
@@ -145,7 +145,7 @@
     \retval SQL_NO_DATA
     \retval SQL_ERROR
 */
-SQLRETURN MResult::getData( SQLUSMALLINT nColumnNumber, SQLSMALLINT nTargetType,
SQLPOINTER pTargetValue, SQLINTEGER nBufferLength, SQLINTEGER *pnLength, SQLINTEGER
*pnIndicator )
+SQLRETURN MResult::getData( SQLUSMALLINT nColumnNumber, SQLSMALLINT nTargetType,
SQLPOINTER pTarget, SQLINTEGER nBufferLength, SQLINTEGER *pnLength, SQLINTEGER
*pnIndicator )
 {
     MYODBCDbgEnter();
 
@@ -160,8 +160,12 @@
             \internal
             \note
 
-            We assume that none of the cached items in resultGetData has changed by other
means!!
+            We assume that none of the cached items in resultGetData has changed by other
means!! Exceptions 
+            are below (ie pTarget can change).
         */
+        resultGetData.nBytesMax             = nBufferLength;
+        resultGetData.pnIndicator           = pnIndicator;
+        resultGetData.pTarget               = pTarget;
     }
     else
     {
@@ -174,6 +178,7 @@
         resultGetData.pDescriptorRecordIRD  =
(MDescriptorRecordIRD*)getImpRowDesc()->getRecord( nColumnNumber );
         resultGetData.pnBytesRemaining      = pnLength;
         resultGetData.pnIndicator           = pnIndicator;
+        resultGetData.pTarget               = pTarget;
 
         /* get our col data from current row (as variant) */
         SQLRETURN nReturn = getData( nColumnNumber, resultGetData.variantData );
@@ -316,7 +321,7 @@
             MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_HY003 ) );
     }
 
-    MYODBCDbgReturn( nReturn );
+    MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_HY000 ) );
 }
 
 BOOLEAN MResult::isBuffered()
@@ -484,28 +489,28 @@
             break;
 
         case SQL_TINYINT:
-            if ( pDescriptorRecord->getUnsigned() == SQL_TRUE )
+            if ( resultGetData.pDescriptorRecordIRD->getUnsigned() == SQL_TRUE )
                 resultGetData.nTargetTypeAdjusted = SQL_C_STINYINT;
             else
                 resultGetData.nTargetTypeAdjusted = SQL_C_UTINYINT;
             break;
 
         case SQL_SMALLINT:
-            if ( pDescriptorRecord->getUnsigned() == SQL_TRUE )
+            if ( resultGetData.pDescriptorRecordIRD->getUnsigned() == SQL_TRUE )
                 resultGetData.nTargetTypeAdjusted = SQL_C_SSHORT;
             else
                 resultGetData.nTargetTypeAdjusted = SQL_C_USHORT;
             break;
 
         case SQL_INTEGER:
-            if ( pDescriptorRecord->getUnsigned() == SQL_TRUE )
+            if ( resultGetData.pDescriptorRecordIRD->getUnsigned() == SQL_TRUE )
                 resultGetData.nTargetTypeAdjusted = SQL_C_SLONG;
             else
                 resultGetData.nTargetTypeAdjusted = SQL_C_ULONG;
             break;
 
         case SQL_BIGINT:
-            if ( pDescriptorRecord->getUnsigned() == SQL_TRUE )
+            if ( resultGetData.pDescriptorRecordIRD->getUnsigned() == SQL_TRUE )
                 resultGetData.nTargetTypeAdjusted = SQL_C_SBIGINT;
             else
                 resultGetData.nTargetTypeAdjusted = SQL_C_UBIGINT;
@@ -676,7 +681,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromNumericSQL()
+SQLRETURN MResult::fromNumericSQL()
 {
     MYODBCDbgEnter();
 
@@ -729,7 +734,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromBitSQL()
+SQLRETURN MResult::fromBitSQL()
 {
     MYODBCDbgEnter();
 
@@ -770,7 +775,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromBinarySQL()
+SQLRETURN MResult::fromBinarySQL()
 {
     MYODBCDbgEnter();
 
@@ -797,7 +802,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromDateSQL()
+SQLRETURN MResult::fromDateSQL()
 {
     MYODBCDbgEnter();
 
@@ -825,7 +830,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromGuidSQL()
+SQLRETURN MResult::fromGuidSQL()
 {
     MYODBCDbgEnter();
 
@@ -852,7 +857,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromTimeSQL()
+SQLRETURN MResult::fromTimeSQL()
 {
     MYODBCDbgEnter();
 
@@ -880,7 +885,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromTimeStampSQL()
+SQLRETURN MResult::fromTimeStampSQL()
 {
     MYODBCDbgEnter();
 
@@ -909,7 +914,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromIntervalYearMonthSQL()
+SQLRETURN MResult::fromIntervalYearMonthSQL()
 {
     MYODBCDbgEnter();
 
@@ -946,7 +951,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN fromIntervalDayTimeSQL()
+SQLRETURN MResult::fromIntervalDayTimeSQL()
 {
     MYODBCDbgEnter();
 
@@ -1022,9 +1027,9 @@
     QString stringData = resultGetData.variantData.toString();
     if ( resultGetData.pTarget && resultGetData.nBytesMax )
     {
-        if ( MYODBCC::doStringCopyOut( (SQLCHAR*)resultGetData.pTarget,
resultGetData.nBytesMax, stringData.toAscii().data() ) )
+        if ( MYODBCC::doStringCopyOut( (SQLCHAR*)resultGetData.pTarget,
resultGetData.nBytesMax, (SQLCHAR*)stringData.toAscii().data() ) )
         {
-            variantData.clear();
+            resultGetData.variantData.clear();
             if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
         }
         else
@@ -1074,13 +1079,13 @@
     {
         if ( MYODBCC::doStringCopyOut( (SQLWCHAR*)resultGetData.pTarget,
resultGetData.nBytesMax / sizeof(SQLWCHAR), stringData.utf16() ) )
         {
-            variantData.clear();
+            resultGetData.variantData.clear();
             if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
         }
         else
         {
             if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining =
stringData.length() * sizeof(SQLWCHAR) - resultGetData.nBytesMax;
-            variantData.setValue( stringData.mid( (resultGetData.nBytesMax - 1) /
sizeof(SQLWCHAR) ) );
+            resultGetData.variantData.setValue( stringData.mid( (resultGetData.nBytesMax
- 1) / sizeof(SQLWCHAR) ) );
             MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_01004 ) );
         }
     }
@@ -1107,13 +1112,15 @@
         +--------------+
     */
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<short int>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    if ( resultGetData.pTargetValue && resultGetData.nBytesMax )
-        *((short int*)(resultGetData.pTarget)) = (short
int)resultGetData.variantData.toInt();
+    *((short int *)(resultGetData.pTarget)) = (short
int)resultGetData.variantData.toInt();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1123,12 +1130,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<unsigned short int>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *resultGetData.pTarget = (unsigned short int)resultGetData.variantData.toUInt();
+    *((unsigned short int *)resultGetData.pTarget) = (unsigned short
int)resultGetData.variantData.toUInt();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1138,12 +1148,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<long int>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *resultGetData.pTarget = (long int)resultGetData.variantData.toLongLong();
+    *((long int *)resultGetData.pTarget) = (long
int)resultGetData.variantData.toLongLong();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1153,12 +1166,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<unsigned long int>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *pTarget = (unsigned long int)resultGetData.variantData.toULongLong();
+    *((unsigned long int *)resultGetData.pTarget) = (unsigned long
int)resultGetData.variantData.toULongLong();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1168,12 +1184,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<float>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *resultGetData.pTarget = (float)resultGetData.variantData.toDouble();
+    *((float *)resultGetData.pTarget) = (float)resultGetData.variantData.toDouble();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1183,12 +1202,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<double>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *resultGetData.pTarget = (double)resultGetData.variantData.toDouble();
+    *((double *)resultGetData.pTarget) = (double)resultGetData.variantData.toDouble();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1198,12 +1220,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<char>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *resultGetData.pTarget = resultGetData.variantData.toInt();
+    *((char *)resultGetData.pTarget) = resultGetData.variantData.toInt();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1213,12 +1238,15 @@
 {
     MYODBCDbgEnter();
 
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
+
     if ( !resultGetData.variantData.canConvert<unsigned char>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *resultGetData.pTarget = resultGetData.variantData.toInt();
+    *((unsigned char *)resultGetData.pTarget) = resultGetData.variantData.toInt();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1228,14 +1256,15 @@
 {
     MYODBCDbgEnter();
 
-    qint64 *pnInt64 = (qint64*)resultGetData.pTarget;
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
 
     if ( !resultGetData.variantData.canConvert<qint64>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *pnInt64 = (qint64)resultGetData.variantData.toLongLong();
+    *((qint64 *)resultGetData.pTarget) = (qint64)resultGetData.variantData.toLongLong();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1245,14 +1274,15 @@
 {
     MYODBCDbgEnter();
 
-    quint64 *pnUInt64 = (quint64*)resultGetData.pTarget;
+    if ( !resultGetData.pTarget )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_22003 ) );
 
     if ( !resultGetData.variantData.canConvert<quint64>() ) 
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006 ) );
 
-    *pnUInt64 = (quint64)resultGetData.variantData.toLongLong();
+    *((quint64 *)resultGetData.pTarget) =
(quint64)resultGetData.variantData.toLongLong();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1270,15 +1300,15 @@
     if ( resultGetData.pTarget && resultGetData.nBytesMax )
     {
         MYODBCC::doMemCpy( resultGetData.pTarget, bytearray.constData(), min(
resultGetData.nBytesMax, bytearray.size() ) );
-        if ( bytearray.size() <= resultGetData.nBytesMax )
+        if ( bytearray.size() < resultGetData.nBytesMax )
         {
-            variantData.clear();
+            resultGetData.variantData.clear();
             if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
         }
         else
         {
             if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining =
bytearray.size() - resultGetData.nBytesMax;
-            variantData.setValue( bytearray.mid( resultGetData.nBytesMax - 1 ) );
+            resultGetData.variantData.setValue( bytearray.mid( resultGetData.nBytesMax -
1 ) );
             MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_01004 ) );
         }
     }
@@ -1305,7 +1335,7 @@
     pDateTarget->month  = d.month();
     pDateTarget->year   = d.year();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1325,7 +1355,7 @@
     pTimeTarget->minute = t.minute();
     pTimeTarget->second = t.second();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1349,7 +1379,7 @@
     pTimeStampTarget->second     = t.time().second();
     pTimeStampTarget->year       = t.date().year();
 
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -1410,7 +1440,7 @@
     if ( !resultGetData.variantData.canConvert<QString>() )
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::DIA_07006, 0,
tr("Variant (data conversion hub) could not convert to a string.") ) );
 
-    QString stringData = resultGetData.variantData.toString().stripWhiteSpace();
+    QString stringData = resultGetData.variantData.toString().trimmed();
 
     /*!
         \internal ODBC RULE
@@ -1484,7 +1514,7 @@
     /*! \todo pack into 16 byte buffer */
 
     /* set length */
-    variantData.clear();
+    resultGetData.variantData.clear();
     if ( resultGetData.pnBytesRemaining ) *resultGetData.pnBytesRemaining = 0;
 
     if ( bFractionalTruncation )

Modified: MYSQLPlus/MYSQLPlusLib/MResultStmt.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MResultStmt.cpp	2006-05-19 15:39:39 UTC (rev 260)
+++ MYSQLPlus/MYSQLPlusLib/MResultStmt.cpp	2006-05-19 17:41:04 UTC (rev 261)
@@ -1124,7 +1124,9 @@
 
             if ( pDescriptorRecord->getDataPtr() )
             {
-                SQLRETURN nReturn = getData( nColumn, pDescriptor );
+++++++++++
+                // virtual SQLRETURN getData( SQLUSMALLINT nColumn, SQLSMALLINT
nTargetType, SQLPOINTER pTargetValue, SQLINTEGER nBufferLength, SQLINTEGER *pnLength,
SQLINTEGER *pnIndicator );
+                SQLRETURN nReturn = getData( nColumn, pDescriptor->get );
                 if ( nReturn != SQL_SUCCESS )
                     MYODBCDbgReturn( nReturn );
             }

Thread
Connector/ODBC 5 commit: r261 - MYODBCC/MYODBCCLib MYODBCC/include MYSQLPlus/MYSQLPlusLibpharvey19 May