List:Commits« Previous MessageNext Message »
From:pharvey Date:January 19 2006 7:51pm
Subject:Connector/ODBC 5 commit: r43 - MYODBCDes/MYODBCDesLib MYODBCDes/include MYODBCRes/MYODBCResLib MYODBCRes/include
View as plain text  
Removed:
   MYODBCRes/MYODBCResLib/MYODBCResAlloc.c
   MYODBCRes/MYODBCResLib/MYODBCResAppend.c
   MYODBCRes/MYODBCResLib/MYODBCResClear.c
   MYODBCRes/MYODBCResLib/MYODBCResConvert.c
   MYODBCRes/MYODBCResLib/MYODBCResDelete.c
   MYODBCRes/MYODBCResLib/MYODBCResExecute.c
   MYODBCRes/MYODBCResLib/MYODBCResFirst.c
   MYODBCRes/MYODBCResLib/MYODBCResFree.c
   MYODBCRes/MYODBCResLib/MYODBCResGet.c
   MYODBCRes/MYODBCResLib/MYODBCResGetAffected.c
   MYODBCRes/MYODBCResLib/MYODBCResGetColDef.c
   MYODBCRes/MYODBCResLib/MYODBCResGetCount.c
   MYODBCRes/MYODBCResLib/MYODBCResGetPos.c
   MYODBCRes/MYODBCResLib/MYODBCResGetPtr.c
   MYODBCRes/MYODBCResLib/MYODBCResInsert.c
   MYODBCRes/MYODBCResLib/MYODBCResIsEOR.c
   MYODBCRes/MYODBCResLib/MYODBCResLast.c
   MYODBCRes/MYODBCResLib/MYODBCResNext.c
   MYODBCRes/MYODBCResLib/MYODBCResPrepare.c
   MYODBCRes/MYODBCResLib/MYODBCResPrev.c
   MYODBCRes/MYODBCResLib/MYODBCResSet.c
   MYODBCRes/MYODBCResLib/MYODBCResSetColDef.c
   MYODBCRes/MYODBCResLib/MYODBCResSetPos.c
   MYODBCRes/MYODBCResLib/MYODBCResSetPtr.c
   MYODBCRes/MYODBCResLib/MYODBCResSkip.c
   MYODBCRes/MYODBCResLib/MYODBCResStoreMetaData.c
   MYODBCRes/MYODBCResLib/MYODBCResStoreMetaDataField.c
Modified:
   MYODBCDes/MYODBCDesLib/MYODBCDes.cpp
   MYODBCDes/MYODBCDesLib/MYODBCDesRec.h
   MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp
   MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.h
   MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp
   MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.h
   MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.cpp
   MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.h
   MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.cpp
   MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.h
   MYODBCDes/include/MYODBCDes.h
   MYODBCDes/include/MYODBCDesAPD.h
   MYODBCRes/MYODBCResLib/MYODBCResLib.vpj
   MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
   MYODBCRes/include/MYODBCRes.h
   MYODBCRes/include/MYODBCResServer.h
Log:
UNICODE:
- work for prepared statement support

Modified: MYODBCDes/MYODBCDesLib/MYODBCDes.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDes.cpp	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDes.cpp	2006-01-19 19:51:41 UTC (rev 43)
@@ -502,7 +502,6 @@
     MYODBCDbgReturn( listRecords[nRecord]->setUpdatable( nUpdatable ) );
 }
 
-
 SQLRETURN MYODBCDes::getDescRec( SQLSMALLINT nRecNumber, SQLWCHAR *pszName, SQLSMALLINT
nBufferLength, SQLSMALLINT *pnStringLengthPtr, SQLSMALLINT *pnTypePtr, SQLSMALLINT
*pnSubTypePtr, SQLINTEGER *pnLengthPtr, SQLSMALLINT *pnPrecisionPtr, SQLSMALLINT
*pnScalePtr, SQLSMALLINT *pnNullablePtr )
 {
     MYODBCDbgEnter();

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRec.h
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRec.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRec.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -42,7 +42,7 @@
     virtual SQLRETURN setBaseTableName( const QString &stringBaseTableName );
     virtual SQLRETURN setCaseSensitive( SQLINTEGER nCaseSensitive );
     virtual SQLRETURN setCatalogName( const QString &stringCatalogName );
-    virtual SQLRETURN setConciseType( SQLSMALLINT nConciseType );
+    virtual SQLRETURN setConciseType( SQLSMALLINT nConciseType ) = 0;
     virtual SQLRETURN setDataPtr( SQLPOINTER pDataPtr );
     virtual SQLRETURN setDatetimeIntervalCode( SQLSMALLINT nDatetimeIntervalCode );
     virtual SQLRETURN setDatetimeIntervalPrecision( SQLINTEGER nDatetimeIntervalPrecision
);

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp	2006-01-19 19:51:41 UTC (rev 43)
@@ -390,3 +390,11 @@
     MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL ) );
 }
 
+SQLRETURN MYODBCDesRecAPD::setConciseType( SQLSMALLINT nConciseType )
+{
+    MYODBCDbgEnter();
+
+    MYODBCDbgReturn( setConciseTypeC( nConciseType ) );
+}
+
+

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.h
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -9,7 +9,8 @@
     MYODBCDesRecAPD( MYODBCDesAPD *pdes );
 
     /* setters */
-    virtual SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setConciseType( SQLSMALLINT nConciseType );
 
     /* getters */
 };

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.cpp	2006-01-19 19:51:41 UTC (rev 43)
@@ -377,3 +377,11 @@
     MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL ) );
 }
 
+SQLRETURN MYODBCDesRecARD::setConciseType( SQLSMALLINT nConciseType )
+{
+    MYODBCDbgEnter();
+
+    MYODBCDbgReturn( setConciseTypeC( nConciseType ) );
+}
+
+

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.h
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecARD.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -9,7 +9,8 @@
     MYODBCDesRecARD( MYODBCDesARD *pdes );
 
     /* setters */
-    virtual SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setConciseType( SQLSMALLINT nConciseType );
 
     /* getters */
 };

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.cpp	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.cpp	2006-01-19 19:51:41 UTC (rev 43)
@@ -375,3 +375,11 @@
     MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL ) );
 }
 
+SQLRETURN MYODBCDesRecIPD::setConciseType( SQLSMALLINT nConciseType )
+{
+    MYODBCDbgEnter();
+
+    MYODBCDbgReturn( setConciseTypeSQL( nConciseType ) );
+}
+
+

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.h
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecIPD.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -9,7 +9,8 @@
     MYODBCDesRecIPD( MYODBCDesIPD *pdes );
 
     /* setters */
-    virtual SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setConciseType( SQLSMALLINT nConciseType );
 
     /* getters */
 };

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.cpp	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.cpp	2006-01-19 19:51:41 UTC (rev 43)
@@ -33,3 +33,11 @@
     MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY016, 0, NULL ) );
 }
 
+SQLRETURN MYODBCDesRecIRD::setConciseType( SQLSMALLINT nConciseType )
+{
+    MYODBCDbgEnter();
+
+    MYODBCDbgReturn( setConciseTypeSQL( nConciseType ) );
+}
+
+

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.h
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecIRD.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -9,7 +9,8 @@
     MYODBCDesRecIRD( MYODBCDesIRD *pdes );
 
     /* setters */
-    virtual SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength );
+    SQLRETURN setConciseType( SQLSMALLINT nConciseType );
 
     /* getters */
 };

Modified: MYODBCDes/include/MYODBCDes.h
===================================================================
--- MYODBCDes/include/MYODBCDes.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/include/MYODBCDes.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -60,15 +60,14 @@
 class MYODBCDesRec;
 
 /*!
-    \brief  This is the top-level descriptor struct. It represents a;
-            GEN, APD, IPD, ARD, or IRD depending upon what the 
-            type_sub_id is.
-    
-            This structure reflects *all* fields given in the ODBC 
-            specification. However; some fields may be calculated or
-            not used when part of a particular descriptor type.
+    \brief  Descriptor.
 
-    \sa     MYODBC_DES_REC
+            This is the base class for all descriptors.
+
+    \sa     MYODBCDesAPD
+            MYODBCDesARD
+            MYODBCDesIPD
+            MYODBCDesIRD
 */
 class MYODBCDes
 {

Modified: MYODBCDes/include/MYODBCDesAPD.h
===================================================================
--- MYODBCDes/include/MYODBCDesAPD.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCDes/include/MYODBCDesAPD.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -10,8 +10,14 @@
 #include "MYODBCDes.h"
 
 /*!
-    \brief  
-    \sa     
+    \brief  Application parameter descriptor (APD).
+
+            This is the base class for all descriptors.
+
+    \sa     MYODBCDesAPD
+            MYODBCDesARD
+            MYODBCDesIPD
+            MYODBCDesIRD
 */
 class MYODBCDesAPD : public MYODBCDes
 {

Deleted: MYODBCRes/MYODBCResLib/MYODBCResAlloc.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResAlloc.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResAlloc.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,107 +0,0 @@
-/*! 
-    \file     MYODBCResAlloc.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResAlloc( MYODBC_RES_METHOD_TYPE    nMethod,
-                          MYODBC_DIA_HANDLE         hDia,
-                          MYODBC_DES_PTR            pDesIRD,
-                          MYSQL *                   pMySQL,
-                          MYODBC_RES_HANDLE *       phRes )
-{
-    MYODBC_RES_PTR pRes = NULL;
-
-#if MYODBC_DEV > 0
-    if ( !hDia )
-        MYODBCCAssert( "pDia" );
-    if ( !pDesIRD )
-        MYODBCCAssert( "pDesIRD" );
-#endif
-
-    switch ( nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            pRes = MYODBCCMalloc( sizeof(MYODBC_RES) );
-            if ( !pRes )
-                MYODBCCAssert( NULL );
-            pRes->nTypeID       = MYODBC_RTTI_RES;
-            pRes->hDia          = hDia;
-            pRes->pDesIRD       = pDesIRD;
-            pRes->pMySQL        = NULL;
-            pRes->nMethod       = nMethod;
-            pRes->pszSQL        = NULL;             /* always NULL for internal
results */
-            MYODBCArrayAlloc( &(pRes->u.hRows) );
-            MYODBCArraySetCacheStep( pRes->u.hRows, 100 );
-            MYODBCArraySetFreeFunc( pRes->u.hRows, (void
(*)(MYODBC_ARRAY_ITEM_DATA_PTR pData))MYODBCArrayFree );
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            {
-                my_bool bUpdateMaxLength = 1;
-
-                if ( !pMySQL )
-                    return SQL_ERROR;
-
-                pRes = MYODBCCMalloc( sizeof(MYODBC_RES) );
-                if ( !pRes )
-                    MYODBCCAssert( NULL );
-                pRes->nTypeID       = MYODBC_RTTI_RES;
-                pRes->hDia          = hDia;
-                pRes->pDesIRD       = pDesIRD;
-                pRes->pMySQL        = pMySQL;
-                pRes->nMethod       = nMethod;
-                pRes->pszSQL        = NULL;
-                pRes->u.pStmt = MYODBCCMalloc( sizeof(MYODBC_RES_STMT) );
-                if ( !pRes->u.pStmt )
-                    MYODBCCAssert( NULL );
-                pRes->u.pStmt->pColumns     = NULL;
-                pRes->u.pStmt->pParameters  = NULL;
-                pRes->u.pStmt->pStmt = mysql_stmt_init( pMySQL );
-                if ( !pRes->u.pStmt->pStmt )
-                    MYODBCCAssert( NULL );
-                pRes->u.pStmt->nRetrieveType= MYODBC_RES_FETCH_BUFFERED;
-                pRes->u.pStmt->bEOR         = MYODBC_C_TRUE;
-
-                /* we need max_length in the field struct so... */
-                mysql_stmt_attr_set( pRes->u.pStmt->pStmt,
STMT_ATTR_UPDATE_MAX_LENGTH, &bUpdateMaxLength );
-            }
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            if ( !pMySQL )
-                return SQL_ERROR;
-
-            pRes = MYODBCCMalloc( sizeof(MYODBC_RES) );
-            if ( !pRes )
-                MYODBCCAssert( NULL );
-            pRes->nTypeID       = MYODBC_RTTI_RES;
-            pRes->hDia          = hDia;
-            pRes->pDesIRD       = pDesIRD;
-            pRes->pMySQL        = pMySQL;
-            pRes->nMethod       = nMethod;
-            pRes->pszSQL        = NULL;
-            pRes->u.pRes = MYODBCCMalloc( sizeof(MYODBC_RES_RES) );
-            if ( !pRes->u.pRes )
-                MYODBCCAssert( NULL );
-            pRes->u.pRes->nRetrieveType = MYODBC_RES_FETCH_BUFFERED;
-            pRes->u.pRes->pRes          = NULL;
-            pRes->u.pRes->nAffectedRows = 0;
-            pRes->u.pRes->hRow          = NULL;
-            break;
-        default:
-            return SQL_ERROR;
-    }
-
-    *phRes = pRes;
-
-    return SQL_SUCCESS;
-}
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResAppend.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResAppend.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResAppend.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,59 +0,0 @@
-/*! 
-    \file     MYODBCResAppend.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResAppend( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            {
-                MYODBC_ARRAY_HANDLE hColumns;
-                SQLRETURN           nReturn;
-
-                /* Create another row (array of columns). */
-                if ( SQL_SUCCESS != (nReturn = MYODBCArrayAlloc( &hColumns )) )
-                    return nReturn;
-
-                /* all column values are either NULL or are dynamically allocated */
-                MYODBCArraySetFreeFunc( pRes->u.hRows, (void
(*)(MYODBC_ARRAY_ITEM_DATA_PTR pData))free );
-
-                /* Set size to match the number of columns described in the 
-                   IRD and accounting for the bookmark */
-                MYODBCArraySetSize( hColumns, pRes->pDesIRD->desc_count + 1 );
-
-                /* Append the row to the result set. */
-                if ( SQL_SUCCESS != (nReturn = MYODBCArrayAppend( pRes->u.hRows,
hColumns )) )
-                {
-                    MYODBCArrayFree( hColumns );
-                    return nReturn;
-                }
-            }
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-#endif
-        case MYODBC_RES_METHOD_RES:
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResClear.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResClear.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResClear.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,64 +0,0 @@
-/*! 
-    \file     MYODBCResClear.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResClear( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            return MYODBCArrayClear( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            /* go back to prepare state */
-            /* 
-                In this case we do not need to free the data as this is done
-                automatically when we reuse statement?
-
-                We keep IRD since it is still valid - same for pszSQL and
-                other prepared derived info.
-            */
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            /* go back to prepare state */
-            /*
-                In this case we want to free our data (the entire result) as 
-                it will not be automatically purged upon any reuse.
-                 
-                We still keep IRD since it is still valid - same for pszSQL and
-                other prepared derived info.
-            */
-            if ( pRes->u.pRes->pRes )
-            {
-                mysql_free_result( pRes->u.pRes->pRes );
-                pRes->u.pRes->pRes          = NULL;
-                pRes->u.pRes->nAffectedRows = 0;
-                pRes->u.pRes->hRow          = NULL;
-            }
-            break;
-
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResConvert.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResConvert.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResConvert.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,323 +0,0 @@
-/*! 
-    \file     MYODBCResConvert.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-MYODBC_C_BOOL MYODBCCStrToDate( SQL_DATE_STRUCT *rgbValue, const char *str, uint length )
-{
-    uint field_length,year_length,digits,i,date[3];
-    const char *pos;
-    const char *end= str+length;
-    for (; !isdigit(*str) && str != end ; str++) ;
-    /*
-      Calculate first number of digits.
-      If length= 4, 8 or >= 14 then year is of format YYYY
-      (YYYY-MM-DD,  YYYYMMDD)
-    */
-    for (pos= str; pos != end && isdigit(*pos) ; pos++) ;
-    digits= (uint) (pos-str);
-    year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2;
-    field_length= year_length-1;
-
-    for (i= 0 ; i < 3 && str != end; i++)
-    {
-        uint tmp_value= (uint) (uchar) (*str++ - '0');
-        while (str != end && isdigit(str[0]) && field_length--)
-        {
-            tmp_value= tmp_value*10 + (uint) (uchar) (*str - '0');
-            str++;
-        }
-        date[i]= tmp_value;
-        while (str != end && !isdigit(*str))
-            str++;
-        field_length= 1;   /* Rest fields can only be 2 */
-    }
-    if (i <= 1 || date[1] == 0)   /* Wrong date */
-        return MYODBC_C_FALSE;
-    while (i < 3)
-        date[i++]= 1;
-
-    rgbValue->year    = date[0];
-    rgbValue->month   = date[1];
-    rgbValue->day     = date[2];
-
-    return MYODBC_C_TRUE;
-}
-
-MYODBC_C_BOOL MYODBCCStrToTime( SQL_TIME_STRUCT *ts, const char *str )
-{ 
-    char buff[12],*to;
-    SQL_TIME_STRUCT tmp_time;
-
-    if (!ts)
-        ts= (SQL_TIME_STRUCT *) &tmp_time;
-
-    for (to= buff ; *str && to < buff+sizeof(buff)-1 ; str++)
-    {
-        if (isdigit(*str))
-            *to++= *str;
-    }
-
-    ts->hour=   MYODBCCDigit(buff[0])*10+MYODBCCDigit(buff[1]);
-    ts->minute= MYODBCCDigit(buff[2])*10+MYODBCCDigit(buff[3]);
-    ts->second= MYODBCCDigit(buff[4])*10+MYODBCCDigit(buff[5]);
-
-    return MYODBC_C_TRUE;
-}
-
-MYODBC_C_BOOL MYODBCCStrToTimestamp( SQL_TIMESTAMP_STRUCT *ts, const char *str )
-{ 
-    uint year, length;
-    char buff[15],*to;
-    SQL_TIMESTAMP_STRUCT tmp_timestamp;
-
-    if (!ts)
-        ts= (SQL_TIMESTAMP_STRUCT *) &tmp_timestamp;
-
-    for (to= buff ; *str && to < buff+sizeof(buff)-1 ; str++)
-    {
-        if (isdigit(*str))
-            *to++= *str;
-    }
-
-    length= (uint) (to-buff);
-
-    if (length == 6 || length == 12)  /* YYMMDD or YYMMDDHHMMSS */
-    {
-        bmove_upp(to+2,to,length);
-        if (buff[0] <= '6')
-        {
-            buff[0]='2';
-            buff[1]='0';
-        }
-        else
-        {
-            buff[0]='1';
-            buff[1]='9';
-        }
-        length+= 2;
-        to+= 2;
-    }
-
-    if (length < 14)
-        strfill(to,14 - length,'0');
-    else
-        *to= 0;
-
-    year=
(MYODBCCDigit(buff[0])*1000+MYODBCCDigit(buff[1])*100+MYODBCCDigit(buff[2])*10+MYODBCCDigit(buff[3]));
-
-    if (buff[4] == '0' && buff[5] == '0')
-        return MYODBC_C_FALSE;
-
-    ts->year=   year;
-    ts->month=  MYODBCCDigit(buff[4])*10+MYODBCCDigit(buff[5]);
-    ts->day=    MYODBCCDigit(buff[6])*10+MYODBCCDigit(buff[7]);
-    ts->hour=   MYODBCCDigit(buff[8])*10+MYODBCCDigit(buff[9]);
-    ts->minute= MYODBCCDigit(buff[10])*10+MYODBCCDigit(buff[11]);
-    ts->second= MYODBCCDigit(buff[12])*10+MYODBCCDigit(buff[13]);
-    ts->fraction= 0;
-
-    return MYODBC_C_TRUE;
-}
-
-SQLRETURN MYODBCResConvert( MYODBC_RES_PTR      pRes, 
-                            MYODBC_DES_REC_PTR  pDesRec, 
-                            char *              pColumn, 
-                            unsigned long       nLength,
-                            SQLSMALLINT         nType, 
-                            SQLPOINTER          pValue, 
-                            SQLINTEGER          nBufferLength, 
-                            SQLINTEGER *        pnStrLen )
-{
-    SQLINTEGER nStrLen = 0;
-
-    if ( !pnStrLen )
-        pnStrLen = &nStrLen;
-
-    /* alpha (roughly) ordered list of viable C types */
-    switch ( nType )
-    {
-        case SQL_C_BINARY:
-            /*! \todo */
-            return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_07006, 0, NULL );
-            break;
-
-        case SQL_C_BIT:
-            if ( pValue )
-                *((char*)pValue) = ( atoi( pColumn ) == 0 ? 0 : 1 );
-            *pnStrLen = 1;
-            break;
-
-        /* case SQL_C_BOOKMARK: - same as SQL_C_ULONG or SQL_C_BIGINT (XP) */
-
-        case SQL_C_CHAR:
-            if ( !MYODBCCStrCopyOut( pValue, nBufferLength, pColumn, pnStrLen ) )
-                return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_01004, 0, NULL );
-            break;
-
-        case SQL_C_DOUBLE:
-            if ( pValue )
-                *((double*)pValue) = (double)atof( pColumn );
-            *pnStrLen = sizeof(double);
-            break;
-
-        case SQL_C_FLOAT:
-            if ( pValue )
-                *((float*)pValue) = (float)atof( pColumn );
-            *pnStrLen = sizeof(float);
-            break;
-
-        case SQL_C_GUID:
-            return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_07006, 0, NULL );
-
-        case SQL_C_INTERVAL_YEAR:
-        case SQL_C_INTERVAL_MONTH:
-        case SQL_C_INTERVAL_DAY:
-        case SQL_C_INTERVAL_HOUR:
-        case SQL_C_INTERVAL_MINUTE:
-        case SQL_C_INTERVAL_SECOND:
-        case SQL_C_INTERVAL_YEAR_TO_MONTH:
-        case SQL_C_INTERVAL_DAY_TO_HOUR:
-        case SQL_C_INTERVAL_DAY_TO_MINUTE:
-        case SQL_C_INTERVAL_DAY_TO_SECOND:
-        case SQL_C_INTERVAL_HOUR_TO_MINUTE:
-        case SQL_C_INTERVAL_HOUR_TO_SECOND:
-        case SQL_C_INTERVAL_MINUTE_TO_SECOND:
-            /*! \todo */
-            return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_07006, 0, NULL );
-            break;
-
-        case SQL_C_NUMERIC:
-            /*! \todo */
-            return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_07006, 0, NULL );
-            break;
-
-        case SQL_C_SBIGINT:
-            if ( pValue )
-                *((longlong*)pValue) = (longlong)strtoll( pColumn, NULL, 10 );
-            *pnStrLen = sizeof(longlong);
-            break;
-
-        case SQL_C_SLONG:
-            if ( pValue )
-            {
-                /*
-                  Check if it could be a date...... :)
-                */
-                if ( nLength >= 10 && pColumn[4] == '-' && pColumn[7]
== '-' &&
-                     (!pColumn[10] || pColumn[10] == ' ') )
-                {
-                    *((long*)pValue) = ( (long)atol( pColumn ) * 10000L +
-                                         (long)atol( pColumn + 5 ) * 100L +
-                                         (long)atol( pColumn + 8 ) );
-                }
-                else
-                    *((long*)pValue) = (long)atol( pColumn );
-            }
-            *pnStrLen = sizeof(long);
-            break;
-
-        case SQL_C_SSHORT:
-            if ( pValue )
-                *((short*)pValue) = (short)atoi( pColumn );
-            *pnStrLen = sizeof(short);
-            break;
-
-        case SQL_C_STINYINT:
-            if ( pValue )
-                *((char*)pValue) = (char)atoi( pColumn );
-            *pnStrLen = 1;
-            break;
-
-        case SQL_C_TYPE_DATE:
-            {
-                SQL_DATE_STRUCT dateStruct;
-
-                if ( !pValue )
-                    pValue = (char*)&dateStruct;
-                if ( MYODBCCStrToDate( (SQL_DATE_STRUCT *)pValue, pColumn, nLength ) )
-                    *pnStrLen = sizeof(SQL_DATE_STRUCT);
-                else
-                    *pnStrLen = SQL_NULL_DATA;  /* ODBC can't handle 0000-00-00 dates */
-            }
-            break;
-
-        case SQL_C_TYPE_TIME:
-            {
-                SQL_TIME_STRUCT timeStruct;
-
-                if ( MYODBCCStrToTime( &timeStruct, pColumn ) )
-                {
-                    SQL_TIME_STRUCT *pTime = (SQL_TIME_STRUCT *)pValue;
-
-                    if ( pTime )
-                    {
-                        pTime->hour     = timeStruct.hour;
-                        pTime->minute   = timeStruct.minute;
-                        pTime->second   = timeStruct.second;          
-                    }
-                    *pnStrLen = sizeof(TIME_STRUCT);
-                }
-                else
-                    *pnStrLen = SQL_NULL_DATA;
-            }
-            break;
-
-        case SQL_C_TYPE_TIMESTAMP:
-            {
-                SQL_TIMESTAMP_STRUCT timestampStruct;
-
-                if (!pValue )
-                    pValue = &timestampStruct;
-                if ( MYODBCCStrToTimestamp( (SQL_TIMESTAMP_STRUCT *)pValue, pColumn ) )
-                    *pnStrLen = sizeof(SQL_TIMESTAMP_STRUCT);
-                else
-                    *pnStrLen = SQL_NULL_DATA;
-            }
-            break;
-
-        case SQL_C_USHORT:
-            if ( pValue )
-                *((ushort*)pValue) = (ushort)(uint)atol( pColumn );
-            *pnStrLen = sizeof(short);
-            break;
-
-        case SQL_C_ULONG:
-            if ( pValue )
-            {
-                char *pEnd;
-                *((ulong*)pValue) = strtoul( pColumn, &pEnd, 10 );
-            }
-            *pnStrLen = sizeof(long);
-            break;
-
-        case SQL_C_UTINYINT:
-            if ( pValue )
-                *((uchar*)pValue) = (uchar)(uint)atoi( pColumn );
-            *pnStrLen = 1;
-            break;
-
-        case SQL_C_UBIGINT:
-            if ( pValue )
-                *((ulonglong*)pValue) = (ulonglong)strtoull( pColumn, NULL, 10 );
-            *pnStrLen = sizeof(ulonglong);
-            break;
-
-        /* case SQL_C_VARBOOKMARK: - same as SQL_C_BINARY (XP) */
-        /* case SQL_C_XML: - not defined (XP) */
-
-        default:
-            return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000, 0, "Data type not
suported" );
-    }
-
-    return SQL_SUCCESS;
-}
-
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResDelete.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResDelete.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResDelete.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,39 +0,0 @@
-/*! 
-    \file     MYODBCResDeleteRow.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResDelete( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        return MYODBCArrayDelete( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResExecute.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResExecute.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResExecute.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,102 +0,0 @@
-/*! 
-    \file     MYODBCResExecute.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResExecute( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            /* 
-                No such thing as 'execute' for an internal result set. 
-            */
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            if ( mysql_stmt_execute( pRes->u.pStmt->pStmt ) )
-                MYODBCDbgReturn( MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
mysql_stmt_errno( pRes->u.pStmt->pStmt ), (SQLCHAR*)mysql_stmt_error(
pRes->u.pStmt->pStmt ) ) );
-            /* Should we pull all the data to the client now? */
-            if ( pRes->u.pStmt->nRetrieveType == MYODBC_RES_FETCH_BUFFERED )
-            {
-                if ( mysql_stmt_store_result( pRes->u.pStmt->pStmt ) )
-                    MYODBCDbgReturn( MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
mysql_stmt_errno( pRes->u.pStmt->pStmt ), (SQLCHAR*)mysql_stmt_error(
pRes->u.pStmt->pStmt ) ) );
-            }
-
-            /* 
-                We may have better or more information for IRD now. 
-            */
-
-            /*!
-                \internal ODBC Rule
-
-                The data in this field is reset after every nondiagnostic function call,
whereas the row 
-                count returned by SQLRowCount remains the same until the statement is set
back to the 
-                prepared or allocated state.
-            */
-            MYODBCDiaSetField( pRes->hDia, 0, SQL_DIAG_ROW_COUNT,
(SQLPOINTER)pRes->u.pStmt->pStmt->affected_rows, 0 );
-
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            /* submit statement to server */
-            if ( mysql_query( pRes->pMySQL, pRes->pszSQL ) == 0 )
-            {
-                /* Should we pull all the data to the client now or just use the data 1
row at a time? */
-                if ( pRes->u.pStmt->nRetrieveType == MYODBC_RES_FETCH_BUFFERED )
-                    pRes->u.pRes->pRes = mysql_store_result( pRes->pMySQL );
-                else
-                    pRes->u.pRes->pRes = mysql_use_result( pRes->pMySQL );
-
-                if ( mysql_errno( pRes->pMySQL ) != 0 )
-                    MYODBCDbgReturn( MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
mysql_errno( pRes->pMySQL ), (SQLCHAR*)mysql_error( pRes->pMySQL ) ) );
-            }
-            else
-                MYODBCDbgReturn( MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
mysql_errno( pRes->pMySQL ), (SQLCHAR*)mysql_error( pRes->pMySQL ) ) );
-
-            /*
-                Row count is cached in MYSQL_RES but affected rows is not so we cache it.
-
-                Row count is not accurate unless we are using BUFFERED fetch.
-            */
-            pRes->u.pRes->nAffectedRows = mysql_affected_rows( pRes->pMySQL );
-
-            /*  
-                Load the IRD (meta-data) unless we are reusing prepared statement - in
which case we will 
-                already have a valid IRD.
-            */
-            if ( pRes->pDesIRD->desc_count == 0 )
-                MYODBCResStoreMetaData( pRes );
-
-            /*!
-                \internal ODBC Rule
-
-                The data in this field is reset after every nondiagnostic function call,
whereas the row 
-                count returned by SQLRowCount remains the same until the statement is set
back to the 
-                prepared or allocated state.
-            */
-            MYODBCDiaSetField( pRes->hDia, 0, SQL_DIAG_ROW_COUNT,
(SQLPOINTER)pRes->u.pRes->nAffectedRows, 0 );
-            break;
-
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResFirst.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResFirst.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResFirst.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,36 +0,0 @@
-/*! 
-    \file     MYODBCResFirst.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResFirst( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        return MYODBCArrayFirst( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}

Deleted: MYODBCRes/MYODBCResLib/MYODBCResFree.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResFree.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResFree.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,77 +0,0 @@
-/*! 
-    \file     MYODBCResFree.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResFree( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR  pRes = (MYODBC_RES_PTR)hRes;
-    SQLRETURN       nReturn;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            nReturn = MYODBCArrayFree( pRes->u.hRows );
-            if ( SQL_SUCCEEDED( nReturn ) )
-            {
-                MYODBCDesCount( pRes->pDesIRD, 0, MYODBC_C_TRUE );
-                MYODBCCFree( pRes );
-                nReturn = SQL_SUCCESS;
-            }
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            if ( mysql_stmt_close( pRes->u.pStmt->pStmt ) == 0 )
-            {
-                /* free row data buffers */
-                SQLSMALLINT nColumn = 0;
-
-                for ( ; nColumn < pRes->pDesIRD->desc_count; nColumn++ )
-                {
-                    MYODBCCFree( (pRes->u.pStmt->pColumns)[nColumn].buffer );
-                }
-
-                /* \todo free parameters */
-
-                MYODBCDesCount( pRes->pDesIRD, 0, MYODBC_C_TRUE );
-                MYODBCCFree( (pRes->u.pStmt->pColumns) );
-                MYODBCCFree( pRes->u.pStmt );
-                MYODBCCFree( pRes->pszSQL );
-                MYODBCCFree( pRes );
-
-                nReturn = SQL_SUCCESS;
-            }
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            if ( pRes->u.pRes->pRes )
-                mysql_free_result( pRes->u.pRes->pRes );
-            MYODBCDesCount( pRes->pDesIRD, 0, MYODBC_C_TRUE );
-            MYODBCCFree( pRes->u.pRes );
-            MYODBCCFree( pRes->pszSQL );
-            MYODBCCFree( pRes );
-            nReturn = SQL_SUCCESS;
-            break;
-
-        default:
-            nReturn = SQL_ERROR;
-    }
-
-    return nReturn;
-}
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResGet.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResGet.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResGet.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,112 +0,0 @@
-/*! 
-    \file     MYODBCResGet.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResGet( MYODBC_RES_HANDLE   hRes,
-                        SQLUSMALLINT        nColumn,
-                        SQLSMALLINT         nType,
-                        SQLPOINTER          pValue,
-                        SQLINTEGER          nBufferLength, 
-                        SQLINTEGER *        pnStrLenOrInd )
-{
-    MYODBC_RES_PTR      pRes    = (MYODBC_RES_PTR)hRes;
-    MYODBC_DES_REC_PTR  pDesRec = NULL;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    MYODBCArrayGetExt( pRes->pDesIRD->hRecords, nColumn, &pDesRec );
-    if ( !pDesRec )
-        MYODBCCAssert( "Missing IRD record." );
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            {
-                char *              pColumn = NULL;
-                SQLRETURN           nReturn = MYODBCResGetPtr( hRes, nColumn,
&pColumn );
-                
-                if ( !SQL_SUCCEEDED( nReturn ) )
-                    return nReturn;
-
-                /* handle NULL */
-                if ( !pColumn )
-                {
-                    if ( pnStrLenOrInd )
-                    {
-                        *pnStrLenOrInd = SQL_NULL_DATA;
-                        return SQL_SUCCESS;
-                    }
-                    else
-                        return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_22002, 0, NULL
);
-                }
-
-                /* copy/convert data */
-                return MYODBCResConvert( pRes, pDesRec, pColumn, MYODBCCStrLen( pColumn
), nType, pValue, nBufferLength, pnStrLenOrInd );
-            }
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            {
-                MYSQL_BIND *pColumn = &(pRes->u.pStmt->pColumns[nColumn - 1]);
-
-                /* handle NULL */
-                if ( pColumn->is_null_value )
-                {
-                    if ( pnStrLenOrInd )
-                    {
-                        *pnStrLenOrInd = SQL_NULL_DATA;
-                        return SQL_SUCCESS;
-                    }
-                    else
-                        return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_22002, 0, NULL
);
-                }
-
-                /* copy/convert data */
-                /* \todo copy/convert here */
-                return SQL_ERROR;
-            }
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            {
-                char *          pColumn     = pRes->u.pRes->hRow[nColumn - 1];
-                unsigned long * pnLengths   = mysql_fetch_lengths(
pRes->u.pRes->pRes );
-
-                /* handle NULL */
-                if ( !pColumn )
-                {
-                    if ( pnStrLenOrInd )
-                    {
-                        *pnStrLenOrInd = SQL_NULL_DATA;
-                        return SQL_SUCCESS;
-                    }
-                    else
-                        return MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_22002, 0, NULL
);
-                }
-
-                /* copy/convert data */
-                return MYODBCResConvert( pRes, pDesRec, pColumn, pnLengths[nColumn -1],
nType, pValue, nBufferLength, pnStrLenOrInd );
-            }
-            break;
-
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResGetAffected.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResGetAffected.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResGetAffected.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,45 +0,0 @@
-/*! 
-    \file     MYODBCResGetAffected.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResGetAffected( MYODBC_RES_HANDLE    hRes, 
-                                MYODBC_C_ULONGLONG * pnRows )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            /* UPDATE/DELETE not supported */
-            *pnRows = 0;
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            *pnRows = pRes->u.pStmt->pStmt->affected_rows;
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            *pnRows = pRes->u.pRes->nAffectedRows;
-            break;
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResGetColDef.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResGetColDef.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResGetColDef.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,30 +0,0 @@
-/*! 
-    \file     MYODBCResGetColDef.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResGetColDef( MYODBC_RES_HANDLE hRes, 
-                              MYODBC_DES_PTR *  ppDesIRD )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    if ( !ppDesIRD )
-        return SQL_ERROR;
-
-    *ppDesIRD = pRes->pDesIRD;
-
-    return SQL_SUCCESS;
-}

Deleted: MYODBCRes/MYODBCResLib/MYODBCResGetCount.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResGetCount.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResGetCount.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,46 +0,0 @@
-/*! 
-    \file     MYODBCResGetCount.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResGetCount( MYODBC_RES_HANDLE    hRes, 
-                             MYODBC_C_ULONGLONG * pnRows )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            return MYODBCArrayGetCount( pRes->u.hRows, pnRows );
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            /* We may need to get all unbuffered rows for this to be accurate? */ 
-            *pnRows = mysql_stmt_num_rows( pRes->u.pStmt->pStmt );
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            /* We may need to get all unbuffered rows for this to be accurate? */ 
-            *pnRows = mysql_num_rows( pRes->u.pRes->pRes );
-            break;
-
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResGetPos.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResGetPos.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResGetPos.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,39 +0,0 @@
-/*! 
-    \file     MYODBCResGetPos.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResGetPos( MYODBC_RES_HANDLE    hRes, 
-                           MYODBC_C_ULONGLONG * pnRow )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        return MYODBCArrayGetPos( pRes->u.hRows, pnRow );
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResGetPtr.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResGetPtr.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResGetPtr.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,61 +0,0 @@
-/*! 
-    \file     MYODBCResGetPtr.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResGetPtr( MYODBC_RES_HANDLE            hRes, 
-                           MYODBC_C_ULONGLONG           nColumn, /* 0 - based where
0=bookmark */
-                           MYODBC_RES_CELL_PTR *        ppData )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            {
-                MYODBC_ARRAY_HANDLE hColumns = NULL;
-                SQLRETURN           nReturn;
-
-                if ( SQL_SUCCESS != (nReturn = MYODBCArrayGet( pRes->u.hRows,
&hColumns )) )
-                    return nReturn;
-                if ( SQL_SUCCESS != (nReturn = MYODBCArrayGetExt( hColumns, nColumn,
ppData )) )
-                    return nReturn;
-                return nReturn;
-            }
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            if ( pRes->u.pStmt->pColumns[nColumn - 1].is_null_value )
-                *ppData = NULL;
-            else
-                *ppData = pRes->u.pStmt->pColumns[nColumn - 1].buffer;
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            {
-                unsigned long *pnLengths = mysql_fetch_lengths( pRes->u.pRes->pRes
);
-                *ppData = pRes->u.pRes->hRow[nColumn - 1];
-            }
-            break;
-
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResInsert.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResInsert.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResInsert.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,56 +0,0 @@
-/*! 
-    \file     MYODBCResInsertRow.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResInsert( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        {
-            MYODBC_ARRAY_HANDLE hColumns;
-            SQLRETURN           nReturn;
-
-            if ( SQL_SUCCESS != (nReturn = MYODBCArrayAlloc( &hColumns )) )
-                return nReturn;
-
-            /* set size to match the number of columns described in the IRD */
-            MYODBCArraySetSize( hColumns, pRes->pDesIRD->desc_count );
-
-            /* always insert *before* the current item */
-            if ( SQL_SUCCESS != (nReturn = MYODBCArrayInsert( pRes->u.hRows,
MYODBC_ARRAY_INSERT_BEFORE, hColumns )) )
-            {
-                MYODBCArrayFree( hColumns );
-                return nReturn;
-            }
-        }
-        break;
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResIsEOR.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResIsEOR.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResIsEOR.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,40 +0,0 @@
-/*! 
-    \file     MYODBCResIsEOF.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-MYODBC_C_BOOL MYODBCResIsEOR( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            return MYODBCArrayIsEOA( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            return pRes->u.pStmt->bEOR;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            return ( pRes->u.pRes->hRow ? MYODBC_C_FALSE : MYODBC_C_TRUE );
-
-        default:
-            return MYODBC_C_TRUE;
-    }
-
-    return MYODBC_C_TRUE;
-}

Deleted: MYODBCRes/MYODBCResLib/MYODBCResLast.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResLast.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResLast.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,37 +0,0 @@
-/*! 
-    \file     MYODBCResLast.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResLast( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        return MYODBCArrayLast( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Modified: MYODBCRes/MYODBCResLib/MYODBCResLib.vpj
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResLib.vpj	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResLib.vpj	2006-01-19 19:51:41 UTC (rev 43)
@@ -54,36 +54,9 @@
 			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="MYODBCRes.cpp"/>
-			<F N="MYODBCResAlloc.c"/>
-			<F N="MYODBCResAppend.c"/>
-			<F N="MYODBCResClear.c"/>
 			<F N="MYODBCResClient.cpp"/>
-			<F N="MYODBCResConvert.c"/>
-			<F N="MYODBCResDelete.c"/>
 			<F N="MYODBCResDriver.cpp"/>
-			<F N="MYODBCResExecute.c"/>
-			<F N="MYODBCResFirst.c"/>
-			<F N="MYODBCResFree.c"/>
-			<F N="MYODBCResGet.c"/>
-			<F N="MYODBCResGetAffected.c"/>
-			<F N="MYODBCResGetColDef.c"/>
-			<F N="MYODBCResGetCount.c"/>
-			<F N="MYODBCResGetPos.c"/>
-			<F N="MYODBCResGetPtr.c"/>
-			<F N="MYODBCResInsert.c"/>
-			<F N="MYODBCResIsEOR.c"/>
-			<F N="MYODBCResLast.c"/>
-			<F N="MYODBCResNext.c"/>
-			<F N="MYODBCResPrepare.c"/>
-			<F N="MYODBCResPrev.c"/>
 			<F N="MYODBCResServer.cpp"/>
-			<F N="MYODBCResSet.c"/>
-			<F N="MYODBCResSetColDef.c"/>
-			<F N="MYODBCResSetPos.c"/>
-			<F N="MYODBCResSetPtr.c"/>
-			<F N="MYODBCResSkip.c"/>
-			<F N="MYODBCResStoreMetaData.c"/>
-			<F N="MYODBCResStoreMetaDataField.c"/>
 		</Folder>
 		<Folder
 			Name="Header Files"

Deleted: MYODBCRes/MYODBCResLib/MYODBCResNext.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResNext.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResNext.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,76 +0,0 @@
-/*! 
-    \file     MYODBCResNext.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResNext( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            return MYODBCArrayNext( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            {
-                int nReturn;
-
-                /*! \todo rewind here */
-                if ( pRes->u.pStmt->bEOR )
-                {
-                }
-
-                nReturn = mysql_stmt_fetch( pRes->u.pStmt->pStmt );
-                switch ( nReturn )
-                {
-                    case 0:
-                        pRes->u.pStmt->bEOR = MYODBC_C_FALSE;
-                        return SQL_SUCCESS;
-                    case 1:
-                        return SQL_ERROR;
-                    case MYSQL_NO_DATA:
-                        pRes->u.pStmt->bEOR = MYODBC_C_TRUE;
-                        return SQL_NO_DATA;
-/*
-                    case MYSQL_DATA_TRUNCATED:
-                        return SQL_SUCCESS_WITH_INFO;
-*/                        
-                    default:
-                        return SQL_ERROR;
-                }
-            }
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            pRes->u.pRes->hRow = mysql_fetch_row( pRes->u.pRes->pRes );
-            if ( !pRes->u.pRes->hRow )
-            {
-                if ( mysql_errno( pRes->pMySQL ) )
-                {
-                    /*! \todo add some self diagnosis to get a more exact error state to
report */
-                    MYODBCDbgReturn( MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_01S01,
mysql_errno( pRes->pMySQL ), (SQLCHAR*)mysql_error( pRes->pMySQL ) ) );
-                }
-                return SQL_NO_DATA;
-            }
-            break;
-
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}

Deleted: MYODBCRes/MYODBCResLib/MYODBCResPrepare.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResPrepare.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResPrepare.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,67 +0,0 @@
-/*! 
-    \file     MYODBCResPrepare.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResPrepare( MYODBC_RES_HANDLE   hRes, 
-                            SQLCHAR *           pszStatementText, 
-                            SQLINTEGER          nLength )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            /* no such thing as prepare for an internal result set */
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            /* - preprocess and store SQL   */
-            /* - store meta data            */
-            {
-                unsigned long nLen = nLength;
-
-                if ( nLength == SQL_NTS )
-                    nLen = MYODBCCStrLen( pszStatementText );
-                if ( mysql_stmt_prepare( pRes->u.pStmt->pStmt, pszStatementText,
nLen ) )
-                    MYODBCDbgReturn( MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
mysql_stmt_errno( pRes->u.pStmt->pStmt ), (SQLCHAR*)mysql_stmt_error(
pRes->u.pStmt->pStmt ) ) );
-                MYODBCCFree( pRes->pszSQL );
-                pRes->pszSQL = MYODBCCMalloc( nLen + 1 );
-                MYODBCCStrCopyIn( pRes->pszSQL, nLen + 1, pszStatementText, nLength );
-                /* store FIELD info in the IRD and bind all columns (opt latter bit
later) */
-                MYODBCResStoreMetaData( pRes );
-            }
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            /* - preprocess and store SQL   */
-            {
-                unsigned long nLen = nLength;
-
-                if ( nLength == SQL_NTS )
-                    nLen = MYODBCCStrLen( pszStatementText );
-                MYODBCCFree( pRes->pszSQL );
-                pRes->pszSQL = MYODBCCMalloc( nLen + 1 );
-                MYODBCCStrCopyIn( pRes->pszSQL, nLen + 1, pszStatementText, nLength );
-            }
-            break;
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResPrev.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResPrev.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResPrev.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,37 +0,0 @@
-/*! 
-    \file     MYODBCResPrev.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResPrev( MYODBC_RES_HANDLE hRes )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        return MYODBCArrayPrev( pRes->u.hRows );
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Modified: MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResServer.cpp	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResServer.cpp	2006-01-19 19:51:41 UTC (rev 43)
@@ -5,12 +5,8 @@
 {
     MYODBCDbgEnter();
 
-    pstm            = mysql_stmt_init( pmysql );
-    nRow            = 0;
-    pbindColumns    = NULL;
+    doInit();
 
-    Q_ASSERT( !pstm );
-
     MYODBCDbgReturn2();
 }
 
@@ -27,21 +23,27 @@
 {
     MYODBCDbgEnter();
 
-    Q_ASSERT( !isValidRow() );
-    Q_ASSERT( !isValidColumn( nColumn ) );
+    if ( !isValidRow() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
+
+    if ( !isValidColumn( nColumn ) )
+        MYODBCDbgReturn( pdia->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( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid column.
Bookmark column is read-only." ) );
 
-    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "setData not supported here
- use UPDATE." ) );
+    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "setData not supported here
at this time." ) );
 }
 
 SQLRETURN MYODBCResServer::setRow( qulonglong nRow )
 {
     MYODBCDbgEnter();
 
-    Q_ASSERT( !isValidRow( nRow ) );
+    if ( !isValidRow() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
 
-    this->nRow = nRow;
+    mysql_stmt_data_seek( pstm, nRow );
 
     MYODBCDbgReturn( SQL_SUCCESS );
 }
@@ -52,6 +54,9 @@
 
     Q_ASSERT( !pnColumns );
 
+    if ( stringStatement.isEmpty() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, "No statement prepared."
) );
+
     *pnColumns = pdesIRD->getCount();
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -61,10 +66,13 @@
 {
     MYODBCDbgEnter();
 
-    Q_ASSERT( !isValidRow() );
-    Q_ASSERT( !isValidColumn( nColumn ) );
+    if ( !isValidRow() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
 
-    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "getData not supported here
- use SELECT with bound columns." ) );
+    if ( !isValidColumn( nColumn ) )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid column." ) );
+
+    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "getData not supported here
yet - use SELECT with bound columns." ) );
 }
 
 SQLRETURN MYODBCResServer::getRow( qulonglong *pnRow )
@@ -73,6 +81,9 @@
 
     Q_ASSERT( !pnRow );
 
+    if ( stringStatement.isEmpty() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, "No statement prepared."
) );
+
     *pnRow = nRow;
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -84,8 +95,11 @@
 
     Q_ASSERT( !pnRow );
 
-    *pnRows = listResults.count();
+    if ( stringStatement.isEmpty() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, "No statement prepared."
) );
 
+    *pnRows = mysql_stmt_num_rows( pstm );
+
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
@@ -93,18 +107,16 @@
 {
     MYODBCDbgEnter();
 
-    /* allocate row - no bookmark column allocated */
-    listResults.append( QVector<QVariant>( pdesIRD->getCount() - 1 ) );
-    nRow = listResults.count();
-
-    MYODBCDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "doAppend not supported here
at this time." ) );
 }
 
 SQLRETURN MYODBCResServer::doClear()
 {
     MYODBCDbgEnter();
 
-    listResults.clear();
+    pdesIRD->doClear();
+    mysql_stmt_close( pstm );
+    doInit();
 
     MYODBCDbgReturn( SQL_SUCCESS );
 }
@@ -115,17 +127,26 @@
 
     Q_ASSERT( !isValidRow() );
 
-    nRow--;
-    listResults.removeAt( nRow );
-
-    MYODBCDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "doDelete not supported here
at this time." ) );
 }
 
-SQLRETURN MYODBCResServer::doExecute( const QString & )
+SQLRETURN MYODBCResServer::doExecute()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Execute a statement is not
relevant for driver generated resultsets." ) );
+    if ( !pstmt )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, NULL ) );
+
+    if ( stringStatement.isEmpty() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, NULL ) );
+
+    if ( mysql_stmt_execute( pstm ) )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm ),
mysql_stmt_error( pstm ) ) );
+
+    if ( mysql_stmt_store_result( pstm ) )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm ),
mysql_stmt_error( pstm ) ) );
+
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 SQLRETURN MYODBCResServer::doFirst()
@@ -162,6 +183,10 @@
 {
     MYODBCDbgEnter();
 
+    if ( stringStatement.isEmpty() )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, "No statement prepared."
) );
+
+++++
     nRow = listResults.count();
     if ( !isValidRow() )
         MYODBCDbgReturn( SQL_NO_DATA );
@@ -187,9 +212,16 @@
 {
     MYODBCDbgEnter();
 
+    if ( !pstmt )
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY010, 0, NULL ) );
+
+    /* not prepared */
+    this->stringStatement = QString::null;
+
     if ( mysql_stmt_prepare( pstm, stringStatement, stringStatement.length() ) )
-        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno(
pRes->u.pStmt->pStmt ), (SQLCHAR*)mysql_stmt_error( pRes->u.pStmt->pStmt ) )
);
+        MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm ),
mysql_stmt_error( pstm ) ) );
 
+    /* now we are prepared */
     this->stringStatement = stringStatement;
 
     /* store FIELD info in the IRD and bind all columns (opt latter bit later) */
@@ -257,13 +289,16 @@
 
 bool MYODBCResServer::isValidRow( qulonglong nRow )
 {
-    bool b;
+    SQLRETURN   nReturn;
+    qulonglong  nRowActual;
 
     MYODBCDbgEnter();
 
-    b = ( nRow > 0 && nRow <= listResults.count() );
+    nReturn = getRow( &nRowActual );
+    if ( !SQL_SUCCEEDED( nReturn ) )
+        MYODBCDbgReturn3( "%d", false );
 
-    MYODBCDbgReturn3( "%d", b );
+    MYODBCDbgReturn3( "%d", ( nRow > 0 && nRow <= nRowActual ) );
 }
 
 
@@ -273,51 +308,55 @@
 
     MYODBCDbgEnter();
 
-    pMetaData = mysql_stmt_result_metadata( pstmt );
+    pdesIRD->doClear();
 
-    if ( pMetaData )
+    pMetaData = mysql_stmt_result_metadata( pstm );
+    if ( !pMetaData )
     {
-        unsigned int nFields;
+        if ( mysql_stmt_error( pstm ) )
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm
), mysql_stmt_error( pstm ) ) );
+        else
+            MYODBCDbgReturn( SQL_SUCCESS );
+    }
 
-        nFields = mysql_num_fields( pMetaData );
-        if ( nFields )
-        {
-            unsigned int    nField;
-            MYSQL_FIELD *   pField;
+    unsigned int nFields = mysql_num_fields( pMetaData );
 
-            pdesIRD->doClear();
-            pdesIRD->setCount( nFields, true );
+    if ( nFields )
+    {
+        unsigned int    nField;
+        MYSQL_FIELD *   pField;
 
-            pstm->pbindColumns = MYODBCCCalloc( nFields, sizeof(MYSQL_BIND) );
+        pdesIRD->setCount( nFields, true );
 
-            mysql_field_seek( pMetaData, 0 );
-            for ( nField = 0; nField < nFields; nField++ )
-            {
-                pField  = mysql_fetch_field( pMetaData );
-                nReturn = doLoadMetaDataField( nField + 1, pField );
-                if ( !SQL_SUCCEEDED( nReturn ) )
-                {
-                    mysql_free_result( pMetaData );
-                    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Failed to
store field descriptor information." ) );
-                }
+        pstm->pbindColumns = MYODBCCCalloc( nFields, sizeof(MYSQL_BIND) );
 
-                /* 
-                    bind all columns in resultset because; 
-                    - ODBC binding can be changed (columns added/removed) even after
resultset generated
-                    - SQLGetData can be used to get unbound columns 
-                */
-                (pstm->pbindColumns)[nField].buffer_type     = pField->type;
-                (pstm->pbindColumns)[nField].buffer_length   = pField->max_length +
1; 
-                (pstm->pbindColumns)[nField].buffer          = MYODBCCMalloc(
pField->max_length + 1 );
-            }
-
-            if ( mysql_stmt_bind_result( pstm, pstm->pbindColumns ) )
+        mysql_field_seek( pMetaData, 0 );
+        for ( nField = 0; nField < nFields; nField++ )
+        {
+            pField  = mysql_fetch_field( pMetaData );
+            nReturn = doLoadMetaDataField( nField + 1, pField );
+            if ( !SQL_SUCCEEDED( nReturn ) )
             {
-                pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm ),
mysql_stmt_error( pstm ) );
                 mysql_free_result( pMetaData );
-                MYODBCDbgReturn( SQL_ERROR );
+                MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Failed to store
field descriptor information." ) );
             }
+
+            /* 
+                bind all columns in resultset because; 
+                - ODBC binding can be changed (columns added/removed) even after
resultset generated
+                - SQLGetData can be used to get unbound columns 
+            */
+            (pstm->pbindColumns)[nField].buffer_type     = pField->type;
+            (pstm->pbindColumns)[nField].buffer_length   = pField->max_length + 1; 
+            (pstm->pbindColumns)[nField].buffer          = MYODBCCMalloc(
pField->max_length + 1 );
         }
+
+        if ( mysql_stmt_bind_result( pstm, pstm->pbindColumns ) )
+        {
+            pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm ),
mysql_stmt_error( pstm ) );
+            mysql_free_result( pMetaData );
+            MYODBCDbgReturn( SQL_ERROR );
+        }
     }
 
     MYODBCDbgReturn( SQL_SUCCESS );
@@ -328,9 +367,7 @@
     MYODBCDbgEnter();
 
     if ( !pField )
-    {
         MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Failed to store field
descriptor information." ) );
-    }
 
     /*
         WARNING!!!
@@ -415,14 +452,14 @@
                 pdesIRD->setLiteralPrefix( nField, "" );
                 pdesIRD->setLiteralSuffix( nField, "" );
                 pdesIRD->setTypeName( nField, "blob" );
-                setConciseTypeSQL( SQL_LONGVARBINARY );
+                pdesIRD->setConciseType( nField, SQL_LONGVARBINARY );
             }
             else
             {
                 pdesIRD->setLiteralPrefix( nField, "\"'" );
                 pdesIRD->setLiteralSuffix( nField, "\"'" );
                 pdesIRD->setTypeName( nField, "text" );
-                setConciseTypeSQL( SQL_LONGVARCHAR );
+                pdesIRD->setConciseType( nField, SQL_LONGVARCHAR );
             }
             break;
         case MYSQL_TYPE_DATE:
@@ -434,7 +471,7 @@
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setPrecision( nField, 10 );
             pdesIRD->setTypeName( nField, "date" );
-            setConciseTypeSQL( SQL_TYPE_DATE );
+            pdesIRD->setConciseType( nField, SQL_TYPE_DATE );
             break;
         case MYSQL_TYPE_DATETIME:
             pdesIRD->setDisplaySize( nField, 19 );
@@ -445,7 +482,7 @@
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setPrecision( nField, 19 );
             pdesIRD->setTypeName( nField, "datetime" );
-            setConciseTypeSQL( SQL_TYPE_TIMESTAMP );
+            pdesIRD->setConciseType( nField, SQL_TYPE_TIMESTAMP );
             break;
         case MYSQL_TYPE_DECIMAL:
             pdesIRD->setDisplaySize( nField, max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals ) );
@@ -456,7 +493,7 @@
             pdesIRD->setNumPrecRadix( nField, 10 );
             pdesIRD->setPrecision( nField, (SQLSMALLINT)max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals ) );
             pdesIRD->setTypeName( nField, "decimal" );
-            setConciseTypeSQL( SQL_DECIMAL );
+            pdesIRD->setConciseType( nField, SQL_DECIMAL );
             break;
         case MYSQL_TYPE_DOUBLE:
             pdesIRD->setLength( nField, pField->max_length );
@@ -468,7 +505,7 @@
                 pdesIRD->setTypeName( nField, "double unsigned" );
             else
                 pdesIRD->setTypeName( nField, "double" );
-            setConciseTypeSQL( SQL_DOUBLE );
+            pdesIRD->setConciseType( nField, SQL_DOUBLE );
             break;
         case MYSQL_TYPE_ENUM:
             pdesIRD->setLength( nField, pField->max_length );
@@ -477,7 +514,7 @@
             pdesIRD->setNumPrecRadix( nField, 0 );
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setTypeName( nField, "enum" );
-            setConciseTypeSQL( SQL_CHAR );
+            pdesIRD->setConciseType( nField, SQL_CHAR );
             break;
         case MYSQL_TYPE_FLOAT:
             pdesIRD->setLength( nField, pField->max_length );
@@ -489,7 +526,7 @@
                 pdesIRD->setTypeName( nField, "float unsigned" );
             else
                 pdesIRD->setTypeName( nField, "float" );
-            setConciseTypeSQL( SQL_REAL );
+            pdesIRD->setConciseType( nField, SQL_REAL );
             break;
         case MYSQL_TYPE_GEOMETRY:
             pdesIRD->setLength( nField, pField->max_length );
@@ -498,7 +535,7 @@
             pdesIRD->setNumPrecRadix( nField, 0 );
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setTypeName( nField, "blob" );
-            setConciseTypeSQL( SQL_LONGVARBINARY );
+            pdesIRD->setConciseType( nField, SQL_LONGVARBINARY );
             break;
         case MYSQL_TYPE_INT24:
             pdesIRD->setLength( nField, pField->max_length );
@@ -510,7 +547,7 @@
                 pdesIRD->setTypeName( nField, "mediumint unsigned" );
             else
                 pdesIRD->setTypeName( nField, "mediumint" );
-            setConciseTypeSQL( SQL_INTEGER );
+            pdesIRD->setConciseType( nField, SQL_INTEGER );
             break;
         case MYSQL_TYPE_LONG:
             pdesIRD->setLength( nField, pField->max_length );
@@ -522,7 +559,7 @@
                 pdesIRD->setTypeName( nField, "integer unsigned" );
             else
                 pdesIRD->setTypeName( nField, "integer" );
-            setConciseTypeSQL( SQL_TINYINT );
+            pdesIRD->setConciseType( nField, SQL_TINYINT );
             break;
         case MYSQL_TYPE_LONG_BLOB:
             pdesIRD->setLength( nField, pField->max_length );
@@ -533,12 +570,12 @@
             if (pField->flags & BINARY_FLAG)
             {
                 pdesIRD->setTypeName( nField, "longblob" );
-                setConciseTypeSQL( SQL_LONGVARBINARY );
+                pdesIRD->setConciseType( nField, SQL_LONGVARBINARY );
             }
             else
             {
                 pdesIRD->setTypeName( nField, "longtext" );
-                setConciseTypeSQL( SQL_LONGVARCHAR );
+                pdesIRD->setConciseType( nField, SQL_LONGVARCHAR );
             }
             break;
         case MYSQL_TYPE_LONGLONG:
@@ -556,7 +593,7 @@
                 pdesIRD->setPrecision( nField, 19 );
                 pdesIRD->setTypeName( nField, "bigint" );
             }
-            setConciseTypeSQL( SQL_BIGINT );
+            pdesIRD->setConciseType( nField, SQL_BIGINT );
             break;
         case MYSQL_TYPE_MEDIUM_BLOB:
             pdesIRD->setLength( nField, pField->max_length );
@@ -567,12 +604,12 @@
             if ( pField->flags & BINARY_FLAG )
             {
                 pdesIRD->setTypeName( nField, "mediumblob" );
-                setConciseTypeSQL( SQL_LONGVARBINARY );
+                pdesIRD->setConciseType( nField, SQL_LONGVARBINARY );
             }
             else
             {
                 pdesIRD->setTypeName( nField, "mediumtext" );
-                setConciseTypeSQL( SQL_LONGVARCHAR );
+                pdesIRD->setConciseType( nField, SQL_LONGVARCHAR );
             }
             break;
         case MYSQL_TYPE_NEWDATE:
@@ -584,7 +621,7 @@
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setPrecision( nField, 10 );
             pdesIRD->setTypeName( nField, "date" );
-            setConciseTypeSQL( SQL_TYPE_DATE );
+            pdesIRD->setConciseType( nField, SQL_TYPE_DATE );
             break;
         case MYSQL_TYPE_NULL:
             pdesIRD->setLength( nField, pField->max_length );
@@ -592,7 +629,7 @@
             pdesIRD->setLiteralSuffix( nField, "" );
             pdesIRD->setNumPrecRadix( nField, 0 );
             pdesIRD->setTypeName( nField, "null" );
-            setConciseTypeSQL( SQL_VARCHAR );
+            pdesIRD->setConciseType( nField, SQL_VARCHAR );
             break;
         case MYSQL_TYPE_SHORT:
             pdesIRD->setLength( nField, pField->max_length );
@@ -604,7 +641,7 @@
                 pdesIRD->setTypeName( nField, "smallint unsigned" );
             else
                 pdesIRD->setTypeName( nField, "smallint" );
-            setConciseTypeSQL( SQL_SMALLINT );
+            pdesIRD->setConciseType( nField, SQL_SMALLINT );
             break;
         case MYSQL_TYPE_TIME:
             pdesIRD->setDisplaySize( nField, 8 );
@@ -615,7 +652,7 @@
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setPrecision( nField, 8 );
             pdesIRD->setTypeName( nField, "time" );
-            setConciseTypeSQL( SQL_TYPE_TIME );
+            pdesIRD->setConciseType( nField, SQL_TYPE_TIME );
             break;
         case MYSQL_TYPE_TIMESTAMP:
             pdesIRD->setDisplaySize( nField, 19 );
@@ -627,7 +664,7 @@
             pdesIRD->setPrecision( nField, 19 );
             pdesIRD->setRowver( nField, SQL_TRUE );
             pdesIRD->setTypeName( nField, "timestamp" );
-            setConciseTypeSQL( SQL_TYPE_TIMESTAMP );
+            pdesIRD->setConciseType( nField, SQL_TYPE_TIMESTAMP );
             break;
         case MYSQL_TYPE_SET:
             pdesIRD->setLength( nField, pField->max_length );
@@ -636,7 +673,7 @@
             pdesIRD->setNumPrecRadix( nField, 0 );
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setTypeName( nField, "set" );
-            setConciseTypeSQL( SQL_CHAR );
+            pdesIRD->setConciseType( nField, SQL_CHAR );
             break;
         case MYSQL_TYPE_STRING:
             pdesIRD->setDisplaySize( nField, pField->length ? pField->length :
255 );
@@ -646,7 +683,7 @@
             pdesIRD->setNumPrecRadix( nField, 0 );
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setTypeName( nField, "char" );
-            setConciseTypeSQL( SQL_CHAR );
+            pdesIRD->setConciseType( nField, SQL_CHAR );
             break;
         case MYSQL_TYPE_TINY: 
             pdesIRD->setLength( nField, pField->max_length );
@@ -660,7 +697,7 @@
                     pdesIRD->setTypeName( nField, "tinyint unsigned" );
                 else
                     pdesIRD->setTypeName( nField, "tinyint" );
-                setConciseTypeSQL( SQL_TINYINT );
+                pdesIRD->setConciseType( nField, SQL_TINYINT );
             }
             else
             {
@@ -668,7 +705,7 @@
                     pdesIRD->setTypeName( nField, "char unsigned" );
                 else
                     pdesIRD->setTypeName( nField, "char" );
-                setConciseTypeSQL( SQL_CHAR );
+                pdesIRD->setConciseType( nField, SQL_CHAR );
             }
             break;
         case MYSQL_TYPE_TINY_BLOB:
@@ -680,12 +717,12 @@
             if ( pField->flags & BINARY_FLAG )
             {
                 pdesIRD->setTypeName( nField, "tinyblob" );
-                setConciseTypeSQL( SQL_LONGVARBINARY );
+                pdesIRD->setConciseType( nField, SQL_LONGVARBINARY );
             }
             else
             {
                 pdesIRD->setTypeName( nField, "tinytext" );
-                setConciseTypeSQL( SQL_LONGVARCHAR );
+                pdesIRD->setConciseType( nField, SQL_LONGVARCHAR );
             }
             break;
         case MYSQL_TYPE_VAR_STRING:
@@ -696,7 +733,7 @@
             pdesIRD->setNumPrecRadix( nField, 0 );
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setTypeName( nField, "varchar" );
-            setConciseTypeSQL( SQL_VARCHAR );
+            pdesIRD->setConciseType( nField, SQL_VARCHAR );
             break;
         case MYSQL_TYPE_YEAR:
             pdesIRD->setLength( nField, pField->max_length );
@@ -706,7 +743,7 @@
             pdesIRD->setOctetLength( nField, pField->max_length );
             pdesIRD->setPrecision( nField, (SQLSMALLINT)pField->max_length );
             pdesIRD->setTypeName( nField, "year" );
-            setConciseTypeSQL( SQL_SMALLINT );
+            pdesIRD->setConciseType( nField, SQL_SMALLINT );
             break;
         default:
         {
@@ -717,3 +754,13 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
+
+void MYODBCResServer::doInit()
+{
+    pstm            = mysql_stmt_init( pmysql );
+    nRow            = 0;
+    pbindColumns    = NULL;
+    stringStatement = QString::null; 
+    Q_ASSERT( !pstm );
+}
+

Deleted: MYODBCRes/MYODBCResLib/MYODBCResSet.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResSet.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResSet.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,39 +0,0 @@
-/*! 
-    \file     MYODBCResSet.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResSet( MYODBC_RES_HANDLE   hRes,       
-                        MYODBC_C_ULONGLONG  nColumn,
-                        SQLSMALLINT         nType,
-                        SQLPOINTER          pValue,
-                        SQLINTEGER          nLength )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResSetColDef.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResSetColDef.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResSetColDef.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,30 +0,0 @@
-/*! 
-    \file     MYODBCResSetColDef.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResSetColDef( MYODBC_RES_HANDLE hRes, 
-                              MYODBC_DES_PTR    pDesIRD )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    if ( !pDesIRD )
-        return SQL_ERROR;
-
-    pRes->pDesIRD = pDesIRD;
-
-    return SQL_SUCCESS;
-}

Deleted: MYODBCRes/MYODBCResLib/MYODBCResSetPos.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResSetPos.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResSetPos.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,39 +0,0 @@
-/*! 
-    \file     MYODBCResSetPos.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    
-    \brief    This code is used to support resultsets.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResSetPos( MYODBC_RES_HANDLE    hRes, 
-                           MYODBC_C_ULONGLONG   nRow ) /* 0-based */
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        return MYODBCArraySetPos( pRes->u.hRows, nRow );
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResSetPtr.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResSetPtr.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResSetPtr.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,49 +0,0 @@
-/*! 
-    \file     MYODBCResSetPtr.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResSetPtr( MYODBC_RES_HANDLE    hRes, 
-                           MYODBC_C_ULONGLONG   nColumn, /* 0 - based where 0=bookmark */
-                           MYODBC_RES_CELL_PTR  pData )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-    case MYODBC_RES_METHOD_INTERNAL:
-        {
-            MYODBC_ARRAY_HANDLE hColumns = NULL;
-            SQLRETURN           nReturn;
-
-            /* get current row */
-            if ( SQL_SUCCESS != (nReturn = MYODBCArrayGet( pRes->u.hRows,
&hColumns )) )
-                return nReturn;
-            /* set column (ptr simply replaced - no free mem) */
-            return MYODBCArraySetExt( hColumns, nColumn, pData );
-        }
-        break;
-
-#if MYSQL_VERSION_ID >= 40100
-    case MYODBC_RES_METHOD_STMT:
-#endif
-    case MYODBC_RES_METHOD_RES:
-    default:
-        return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResSkip.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResSkip.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResSkip.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,38 +0,0 @@
-/*! 
-    \file     MYODBCResSkip.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResSkip( MYODBC_RES_HANDLE  hRes, 
-                         MYODBC_C_LONGLONG  nRows )
-{
-    MYODBC_RES_PTR pRes = (MYODBC_RES_PTR)hRes;
-
-#if MYODBC_DEV > 0
-    if ( !hRes )
-        MYODBCCAssert( "hRes" );
-    if ( MYODBCRttiType( hRes ) != MYODBC_RTTI_RES )
-        MYODBCCAssert( "hRes" );
-#endif
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            return MYODBCArraySkip( pRes->u.hRows, nRows );
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-#endif
-        case MYODBC_RES_METHOD_RES:
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResStoreMetaData.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResStoreMetaData.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResStoreMetaData.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,109 +0,0 @@
-/*! 
-    \file     MYODBCResStoreMetaData.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-SQLRETURN MYODBCResStoreMetaData( MYODBC_RES_PTR pRes )
-{
-    SQLRETURN   nReturn = SQL_SUCCESS;
-
-    switch ( pRes->nMethod )
-    {
-        case MYODBC_RES_METHOD_INTERNAL:
-            /* 
-                This should not be needed as meta data (IRD) is provided when the result
data 
-                is created.
-            */
-            break;
-
-#if MYSQL_VERSION_ID >= 40100
-        case MYODBC_RES_METHOD_STMT:
-            /*
-                We process each field to get the meta data and bind all fields. We may be

-                able to just bind some fields when we have bound columns from
SQLBindCol() etc.
-                - not sure.
-            */
-            {
-                MYSQL_RES *pResultMetaData = mysql_stmt_result_metadata(
pRes->u.pStmt->pStmt );
-
-                if ( pResultMetaData )
-                {
-                    unsigned int        nFields;
-    
-                    nFields = mysql_num_fields( pResultMetaData );
-                    if ( nFields )
-                    {
-                        unsigned int        nField;
-                        MYSQL_FIELD *       pField;
-                        MYODBC_DES_REC_PTR  pDesRec;
-
-                        MYODBCDesCount( pRes->pDesIRD, nFields, MYODBC_C_TRUE );
-                        pRes->u.pStmt->pColumns = MYODBCCCalloc( nFields,
sizeof(MYSQL_BIND) );
-
-                        /* The binding does NOT include a bookmark (at index 0 for
example). */
-                        mysql_field_seek( pResultMetaData, 0 );
-                        for ( nField = 0; nField < nFields; nField++ )
-                        {
-                            pField  = mysql_fetch_field( pResultMetaData );
-                            pDesRec = MYODBCDesRecGet( pRes->pDesIRD, nField + 1,
MYODBC_C_TRUE );
-                            if ( !MYODBCResStoreMetaDataField( pDesRec, pField ) )
-                                nReturn = MYODBCDiaAppend( pRes->hDia,
MYODBC_DIA_HY000, 0, "Failed to store field descriptor information." );
-                            /* bind all columns by default */
-                            (pRes->u.pStmt->pColumns)[nField].buffer_type     =
pField->type;
-                            (pRes->u.pStmt->pColumns)[nField].buffer_length   =
pField->max_length + 1; 
-                            (pRes->u.pStmt->pColumns)[nField].buffer          =
MYODBCCMalloc( pField->max_length + 1 );
-                        }
-
-                        if ( mysql_stmt_bind_result( pRes->u.pStmt->pStmt,
pRes->u.pStmt->pColumns ) )
-                            nReturn = MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
mysql_stmt_errno( pRes->u.pStmt->pStmt ), (SQLCHAR*)mysql_stmt_error(
pRes->u.pStmt->pStmt ) );
-
-                        mysql_free_result( pResultMetaData );
-                    }
-                }
-            }
-            break;
-#endif
-        case MYODBC_RES_METHOD_RES:
-            /*  
-                We process each field to get the meta data but we do not bind. We will
get the 
-                data by indexing row data.
-            */
-            {
-                unsigned int nFields = 0;
-
-                if ( pRes->u.pRes->pRes )
-                    nFields = mysql_num_fields( pRes->u.pRes->pRes );
-
-                if ( nFields )
-                {
-                    unsigned int        nField;
-                    MYSQL_FIELD *       pField;
-                    MYODBC_DES_REC_PTR  pDesRec;
-
-                    MYODBCDesCount( pRes->pDesIRD, nFields, MYODBC_C_TRUE );
-                    pRes->u.pStmt->pColumns = MYODBCCCalloc( nFields,
sizeof(MYSQL_BIND) );
-
-                    mysql_field_seek( pRes->u.pRes->pRes, 0 );
-                    for ( nField = 0; nField < nFields; nField++ )
-                    {
-                        pField  = mysql_fetch_field( pRes->u.pRes->pRes );
-                        pDesRec = MYODBCDesRecGet( pRes->pDesIRD, nField + 1,
MYODBC_C_TRUE );
-                        if ( !MYODBCResStoreMetaDataField( pDesRec, pField ) )
-                            nReturn = MYODBCDiaAppend( pRes->hDia, MYODBC_DIA_HY000,
0, "Failed to store field descriptor information." );
-                    }
-                }
-            }
-            break;
-
-        default:
-            nReturn = SQL_ERROR;
-    }
-
-    return nReturn;
-}
-

Deleted: MYODBCRes/MYODBCResLib/MYODBCResStoreMetaDataField.c
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResStoreMetaDataField.c	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/MYODBCResLib/MYODBCResStoreMetaDataField.c	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,401 +0,0 @@
-/*! 
-    \file     MYODBCResStoreMetaDataField.c
-    \author   Peter Harvey <pharvey@stripped>
-              Copyright (C) MySQL AB 2004-2005, Released under GPL.
-    \version  Connector/ODBC v5
-    \date     2005          
-    \brief    Code to help manage a result.
-*/
-#include "MYODBCResInternal.h"
-
-MYODBC_C_BOOL MYODBCResStoreMetaDataField( MYODBC_DES_REC_PTR  pDesRec,
-                                           MYSQL_FIELD *       pField )
-{
-    if ( !pDesRec )
-        return SQL_ERROR;
-    if ( !pField )
-        return SQL_ERROR;
-
-    /*
-        WARNING!!!
-
-        This function needs to be revisited and reviewed - probably several times.
-
-        This is a blend of my interpretation (1st pass kind of thing) and what
-        is found in the old driver. Some of what is in here is certianly in 
-        need if some changing.
-    */
-
-    /* 
-        common 
-
-        All fields are included (in alpha order) for completeness. Comments 
-        are made to state why some are not relevant. Again; there may be 
-        calculated fields in here which are set now with the thinking that 
-        it will make maintaining and working with the whole descriptor 
-        business easier (for example; desc_label which could be just mapped
-        to desc_name as needed but is set now).
-
-        These must be handled before the type specific ones because in some
-        cases the values set here are replaced depending upon the type -
-        but only sometimes.
-    */
-    pDesRec->desc_auto_unique_value = (pField->flags &&
AUTO_INCREMENT_FLAG) ? SQL_TRUE : SQL_FALSE;
-    pDesRec->desc_base_column_name  = (pField->org_name ? MYODBCCStrDup(
pField->org_name, pField->org_name_length ) : MYODBCCStrDup( "", SQL_NTS ));
-    pDesRec->desc_base_table_name   = (pField->org_table ? MYODBCCStrDup(
pField->org_table, pField->org_table_length ) : MYODBCCStrDup( "", SQL_NTS ));
-    pDesRec->desc_case_sensitive    = (pField->flags & BINARY_FLAG ? SQL_FALSE
: SQL_TRUE);
-    pDesRec->desc_catalog_name      = (pField->catalog ? MYODBCCStrDup(
pField->catalog, pField->catalog_length ) : MYODBCCStrDup( "", SQL_NTS ));
-/*  pDesRec->desc_concise_type;                 - type specific     */
-/*  pDesRec->desc_data_ptr;                     - N/A               */
-/*  pDesRec->desc_datetime_interval_code;       - type specific     */
-    pDesRec->desc_datetime_interval_precision   = 10;       /* this is a conservative
guess - not sure what precision we get when we diff 2 times */
-    pDesRec->desc_display_size      = pField->max_length;   /* - also type specific
  */
-    pDesRec->desc_fixed_prec_scale  = SQL_FALSE;            /* - also type specific  
*/
-/*  pDesRec->desc_indicator_ptr;                - N/A               */
-    pDesRec->desc_label             = MYODBCCStrDup( pField->name,
pField->name_length );
-/*  pDesRec->desc_length;                       - type specific     */
-/*  pDesRec->desc_literal_prefix;               - type specific     */
-/*  pDesRec->desc_literal_suffix;               - type specific     */
-    pDesRec->desc_local_type_name   = MYODBCCStrDup( "", SQL_NTS );
-    pDesRec->desc_name              = MYODBCCStrDup( pField->name,
pField->name_length );
-    pDesRec->desc_nullable          = (pField->flags && NOT_NULL_FLAG) ?
SQL_NO_NULLS : SQL_NULLABLE;
-/*  pDesRec->desc_num_prec_radix;               - type specific     */   
-/*  pDesRec->desc_octet_length;                 - type specific     */
-/*  pDesRec->desc_octet_length_ptr;             - N/A               */
-/*  pDesRec->desc_paramter_type;                - N/A               */
-/*  pDesRec->desc_precision;                    - type specific     */   
-    pDesRec->desc_rowver            = SQL_FALSE;            /* - also type specific  
*/
-    pDesRec->desc_scale             = pField->decimals;
-    pDesRec->desc_schema_name       = MYODBCCStrDup( pField->db,
pField->db_length );
-    pDesRec->desc_searchable        = SQL_PRED_SEARCHABLE;
-    pDesRec->desc_table_name        = MYODBCCStrDup( pField->table,
pField->table_length );
-/*  pDesRec->desc_type;                         - type specific     */
-/*  pDesRec->desc_type_name;                    - type specific     */
-    pDesRec->desc_unnamed           = SQL_NAMED;
-    pDesRec->desc_unsigned          = (pField->flags & UNSIGNED_FLAG ? SQL_TRUE
: SQL_FALSE);
-    pDesRec->desc_updatable         = (pField->table && pField->table[0]
? SQL_ATTR_READWRITE_UNKNOWN : SQL_ATTR_READONLY);
-
-    /* 
-        set type specific values here 
-
-        All supported mysql field types in *alpha* order (for readability).
-        
-        Many descriptor fields can be set without much regard to the type
-        or are may not even be used given that we are an IRD. 
-
-        The ones set in this switch/case are special cases where the
-        values are dependent upon the type. Note that MYODBCDesRecType
-        does set some related fields in the descriptor to ensure that
-        the related fields are valid.
-    */
-    switch ( pField->type )
-    {
-        case MYSQL_TYPE_BLOB:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            if (pField->flags & BINARY_FLAG)
-            {
-                pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-                pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-                pDesRec->desc_type_name         = MYODBCCStrDup( "blob", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARBINARY );
-            }
-            else
-            {
-                pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-                pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-                pDesRec->desc_type_name         = MYODBCCStrDup( "text", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARCHAR );
-            }
-            break;
-        case MYSQL_TYPE_DATE:
-            pDesRec->desc_display_size      = 10;
-            pDesRec->desc_length            = 10;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_precision         = 10;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "date", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TYPE_DATE );
-            break;
-        case MYSQL_TYPE_DATETIME:
-            pDesRec->desc_display_size      = 19;
-            pDesRec->desc_length            = 19;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_precision         = 19;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "datetime", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TYPE_TIMESTAMP );
-            break;
-        case MYSQL_TYPE_DECIMAL:
-            pDesRec->desc_display_size      = max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals );
-            pDesRec->desc_fixed_prec_scale  = pField->decimals ? SQL_TRUE :
SQL_FALSE;
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 10;
-            pDesRec->desc_precision         = (SQLSMALLINT)max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals );
-            pDesRec->desc_type_name         = MYODBCCStrDup( "decimal", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_DECIMAL );
-            break;
-        case MYSQL_TYPE_DOUBLE:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            if ( pField->flags & UNSIGNED_FLAG )
-                pDesRec->desc_type_name     = MYODBCCStrDup( "double unsigned",
SQL_NTS );
-            else
-                pDesRec->desc_type_name     = MYODBCCStrDup( "double", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_DOUBLE );
-            break;
-        case MYSQL_TYPE_ENUM:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "enum", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_CHAR );
-            break;
-        case MYSQL_TYPE_FLOAT:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            if ( pField->flags & UNSIGNED_FLAG )
-                pDesRec->desc_type_name     = MYODBCCStrDup( "float unsigned", SQL_NTS
);
-            else
-                pDesRec->desc_type_name     = MYODBCCStrDup( "float", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_REAL );
-            break;
-        case MYSQL_TYPE_GEOMETRY:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "blob", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARBINARY );
-            break;
-        case MYSQL_TYPE_INT24:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            if ( pField->flags & UNSIGNED_FLAG )
-                pDesRec->desc_type_name     = MYODBCCStrDup( "mediumint unsigned",
SQL_NTS );
-            else
-                pDesRec->desc_type_name     = MYODBCCStrDup( "mediumint", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_INTEGER );
-            break;
-        case MYSQL_TYPE_LONG:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            if ( pField->flags & UNSIGNED_FLAG )
-                pDesRec->desc_type_name     = MYODBCCStrDup( "integer unsigned",
SQL_NTS );
-            else
-                pDesRec->desc_type_name     = MYODBCCStrDup( "integer", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TINYINT );
-            break;
-        case MYSQL_TYPE_LONG_BLOB:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            if (pField->flags & BINARY_FLAG)
-            {
-                pDesRec->desc_type_name     = MYODBCCStrDup( "longblob", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARBINARY );
-            }
-            else
-            {
-                pDesRec->desc_type_name     = MYODBCCStrDup( "longtext", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARCHAR );
-            }
-            break;
-        case MYSQL_TYPE_LONGLONG:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            if ( pField->flags & UNSIGNED_FLAG )
-            {
-                pDesRec->desc_precision     = 20;
-                pDesRec->desc_type_name     = MYODBCCStrDup( "bigint unsigned",
SQL_NTS );
-            }
-            else
-            {
-                pDesRec->desc_precision     = 19;
-                pDesRec->desc_type_name     = MYODBCCStrDup( "bigint", SQL_NTS );
-            }
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_BIGINT );
-            break;
-        case MYSQL_TYPE_MEDIUM_BLOB:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            if ( pField->flags & BINARY_FLAG )
-            {
-                pDesRec->desc_type_name     = MYODBCCStrDup( "mediumblob", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARBINARY );
-            }
-            else
-            {
-                pDesRec->desc_type_name     = MYODBCCStrDup( "mediumtext", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARCHAR );
-            }
-            break;
-        case MYSQL_TYPE_NEWDATE:
-            pDesRec->desc_display_size      = 10;
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_precision         = 10;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "date", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TYPE_DATE );
-            break;
-        case MYSQL_TYPE_NULL:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "null", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_VARCHAR );
-            break;
-        case MYSQL_TYPE_SHORT:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            if ( pField->flags & UNSIGNED_FLAG )
-                pDesRec->desc_type_name     = MYODBCCStrDup( "smallint unsigned",
SQL_NTS );
-            else
-                pDesRec->desc_type_name     = MYODBCCStrDup( "smallint", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_SMALLINT );
-            break;
-        case MYSQL_TYPE_TIME:
-            pDesRec->desc_display_size      = 8;
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_precision         = 8;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "time", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TYPE_TIME );
-            break;
-        case MYSQL_TYPE_TIMESTAMP:
-            pDesRec->desc_display_size      = 19;
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_precision         = 19;
-            pDesRec->desc_rowver            = SQL_TRUE;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "timestamp", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TYPE_TIMESTAMP );
-            break;
-        case MYSQL_TYPE_SET:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "set", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_CHAR );
-            break;
-        case MYSQL_TYPE_STRING:
-            pDesRec->desc_display_size      = pField->length ? pField->length :
255;
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "char", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_CHAR );
-            break;
-        case MYSQL_TYPE_TINY: 
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 2;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            if ( pField->flags & NUM_FLAG )
-            {
-                if ( pField->flags & UNSIGNED_FLAG )
-                    pDesRec->desc_type_name = MYODBCCStrDup( "tinyint unsigned",
SQL_NTS );
-                else
-                    pDesRec->desc_type_name = MYODBCCStrDup( "tinyint", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_TINYINT );
-            }
-            else
-            {
-                if ( pField->flags & UNSIGNED_FLAG )
-                    pDesRec->desc_type_name = MYODBCCStrDup( "char unsigned", SQL_NTS
);
-                else
-                    pDesRec->desc_type_name = MYODBCCStrDup( "char", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_CHAR );
-            }
-            break;
-        case MYSQL_TYPE_TINY_BLOB:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            if ( pField->flags & BINARY_FLAG )
-            {
-                pDesRec->desc_type_name     = MYODBCCStrDup( "tinyblob", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARBINARY );
-            }
-            else
-            {
-                pDesRec->desc_type_name     = MYODBCCStrDup( "tinytext", SQL_NTS );
-                MYODBCDesRecConciseTypeSQL( pDesRec, SQL_LONGVARCHAR );
-            }
-            break;
-        case MYSQL_TYPE_VAR_STRING:
-            pDesRec->desc_display_size      = pField->length ? pField->length :
255;
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "varchar", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_VARCHAR );
-            break;
-        case MYSQL_TYPE_YEAR:
-            pDesRec->desc_length            = pField->max_length;
-            pDesRec->desc_literal_prefix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_literal_suffix    = MYODBCCStrDup( "\"'", SQL_NTS );
-            pDesRec->desc_num_prec_radix    = 0;
-            pDesRec->desc_octet_length      = pField->max_length;
-            pDesRec->desc_precision         = (SQLSMALLINT)pField->max_length;
-            pDesRec->desc_type_name         = MYODBCCStrDup( "year", SQL_NTS );
-            MYODBCDesRecConciseTypeSQL( pDesRec, SQL_SMALLINT );
-            break;
-        default:
-            return SQL_ERROR;
-    }
-
-    return SQL_SUCCESS;
-}
-

Modified: MYODBCRes/include/MYODBCRes.h
===================================================================
--- MYODBCRes/include/MYODBCRes.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/include/MYODBCRes.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -1,13 +1,10 @@
 /*! 
     \file       MYODBCRes.h
     \author     Peter Harvey <pharvey@stripped>
-                Copyright (C) MySQL AB 2004-2005, Released under GPL.
+                Copyright (C) MySQL AB 2004-2006, Released under GPL.
     \version    Connector/ODBC v5
-    \date       2004          
-    \brief      This API exists to abstract the caller from issues related to the
-                fact that we can create a result set in several different ways and
-                that the result set may be managed by the; server, client library
-                or the driver depending upon options available/set.
+    \date       2006
+    \brief      Resultset.
 */
 
 #ifndef MYODBC_RES_H
@@ -24,6 +21,16 @@
 #include "QVector"
 #include "QList"
 
+/*!
+    \brief  Resultset.
+
+            This is the base class (pure virtual) for a resultset. The problem this
+            addresses is the fact that we can have a resultset generated in a variety
+            of ways - each with their own unique quirks.
+
+    \sa     MYODBCResDriver
+            MYODBCResServer
+*/
 class MYODBCRes
 {
 public:

Modified: MYODBCRes/include/MYODBCResServer.h
===================================================================
--- MYODBCRes/include/MYODBCResServer.h	2006-01-17 02:35:41 UTC (rev 42)
+++ MYODBCRes/include/MYODBCResServer.h	2006-01-19 19:51:41 UTC (rev 43)
@@ -35,12 +35,13 @@
 
 protected:
     MYSQL_STMT *pstm;               /* MySQL prepared statement                        
*/
-    MYSQL_BIND *pbindColumns        /* we bind all/any columns of resultset here       
*/
+    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()        
*/
 
     SQLRETURN doLoadMetaData();     /* load resultset meta data (IRD)                  
*/
     SQLRETURN doLoadMetaDataField( unsigned int nField, MYSQL_FIELD *pField ); /* load
resultset column meta data (IRD) */
+    void      doInit();
 };
 
 #endif

Thread
Connector/ODBC 5 commit: r43 - MYODBCDes/MYODBCDesLib MYODBCDes/include MYODBCRes/MYODBCResLib MYODBCRes/includepharvey19 Jan