Added:
MYODBCRes/MYODBCResTest/MYODBCResTest.cpp
Removed:
MYODBCRes/MYODBCResTest/MYODBCResTest.c
Modified:
MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro
MYODBCRes/MYODBCRes.vpj
MYODBCRes/MYODBCResLib/MYODBCResInternal.h
MYODBCRes/MYODBCResLib/MYODBCResLib.pro
MYODBCRes/MYODBCResLib/MYODBCResLib.vpj
MYODBCRes/MYODBCResTest/MYODBCResTest.pro
MYODBCRes/MYODBCResTest/MYODBCResTest.vpj
MYODBCRes/include/MYODBCRes.h
root.pro
Log:
UNICODE:
- driver based resultset in place
- basic unit test code in place for driver based resultset
- more tests to be added next
Modified: MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro
===================================================================
--- MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCDes/MYODBCDesTest/MYODBCDesTest.pro 2006-01-15 16:51:23 UTC (rev 38)
@@ -15,7 +15,9 @@
INCLUDEPATH += ../../MYODBCRtti/include
INCLUDEPATH += ../include
LIBS += -L../../lib
-LIBS += -lMYODBCDes -lMYODBCDia -lMYODBCDbg
+LIBS += -lMYODBCDes
+LIBS += -lMYODBCDia
+LIBS += -lMYODBCDbg
# #########################################################
# FILES
Modified: MYODBCRes/MYODBCRes.vpj
===================================================================
--- MYODBCRes/MYODBCRes.vpj 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCRes.vpj 2006-01-15 16:51:23 UTC (rev 38)
@@ -57,6 +57,9 @@
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
<F N="include/MYODBCRes.h"/>
+ <F N="include/MYODBCResClient.h"/>
+ <F N="include/MYODBCResDriver.h"/>
+ <F N="include/MYODBCResServer.h"/>
</Folder>
<Folder
Name="Resource Files"
Modified: MYODBCRes/MYODBCResLib/MYODBCResInternal.h
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResInternal.h 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCResLib/MYODBCResInternal.h 2006-01-15 16:51:23 UTC (rev 38)
@@ -10,136 +10,8 @@
#ifndef MYODBC_RES_INTERNAL_H
#define MYODBC_RES_INTERNAL_H
-#include "../include/MYODBCRes.h"
+#include "../include/MYODBCResDriver.h"
-/*!
- \internal
- \brief MySQL prepared statement.
-
- This wraps together a few things needed when we are
- working with a MySQL prepared statement.
-*/
-typedef struct tagMYODBC_RES_STMT
-{
- MYSQL_STMT * pStmt; /*!< Prepared statement handle.
*/
- MYODBC_RES_FETCH_TYPE nRetrieveType; /*!< Pull all data to client at
execution? */
- MYSQL_BIND * pParameters; /*!< Bound parameters.
*/
- MYSQL_BIND * pColumns; /*!< Bound columns.
*/
- MYODBC_C_BOOL bEOR; /*!< True if we are EndOfResult
*/
-
-} MYODBC_RES_STMT, *MYODBC_RES_STMT_PTR;
-
-/*!
- \internal
- \brief MySQL result.
-
- This wraps together a few things needed when we are
- working with a MySQL result.
-*/
-typedef struct tagMYODBC_RES_RES
-{
- MYSQL_RES * pRes; /*!< Result handle.
*/
- MYODBC_RES_FETCH_TYPE nRetrieveType; /*!< Pull all data to client at
execution? */
- MYODBC_C_ULONGLONG nAffectedRows; /*!< Number of rows affected or row
count. */
- MYSQL_ROW hRow; /*!< from mysql_fetch_row()
*/
-
-} MYODBC_RES_RES, *MYODBC_RES_RES_PTR;
-
-/*!
- \internal
- \brief General purpose result set.
-
- This structure allows us to have a result set which encapsulates
- the various types of result set structures we can use such as;
-
- - MYSQL_RES
- - MYSQL_STMT
- - internal
-*/
-typedef struct tagMYODBC_RES
-{
- MYODBC_RTTI_TYPE nTypeID; /*!< RTTI (MYODBC_RTTI_RES) */
- MYODBC_RES_METHOD_TYPE nMethod; /*!< tells us whats in u */
- MYSQL * pMySQL; /*!< parent of MYSQL_RES or MYSQL_STMT */
- MYODBC_DES_PTR pDesIRD; /*!< Reference to statements IRD */
- MYODBC_DIA_HANDLE hDia; /*!< Reference to statements hDia */
- SQLCHAR * pszSQL; /*!< pre-prepared SQL */
-
- union
- {
- MYODBC_RES_RES_PTR pRes; /*!< nMethod = MYODBC_RES_METHOD_RES
*/
-#if MYSQL_VERSION_ID >= 40100
- MYODBC_RES_STMT_PTR pStmt; /*!< nMethod = MYODBC_RES_METHOD_STMT
*/
#endif
- MYODBC_ARRAY_HANDLE hRows; /*!< nMethod = MYODBC_RES_METHOD_INTERNAL
*/
- } u;
-} MYODBC_RES;
-/*!
- \internal
- \brief Generic result pointer.
-
- This is for convenience and code clarity.
-*/
-typedef MYODBC_RES *MYODBC_RES_PTR;
-
-/*!
- \internal
- \brief Converts/copies out a column value.
-
-*/
-SQLRETURN MYODBCResConvert( MYODBC_RES_PTR pRes,
- MYODBC_DES_REC_PTR pDesRec,
- char * pColumn,
- unsigned long nLength,
- SQLSMALLINT nType,
- SQLPOINTER pValue,
- SQLINTEGER nBufferLength,
- SQLINTEGER * pnStrLen );
-
-/*!
- \internal
- \brief Retreives the meta data for the result set from the
- server and stores it in the IRD.
-
- \note Assumes that the descriptor is initialized as per
- MYODBCDesAlloc and is an IRD.
-
- \param pRes A viable pointer to a MYODBC_RES_PTR.
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResStoreMetaDataField
-*/
-SQLRETURN MYODBCResStoreMetaData( MYODBC_RES_PTR pRes );
-
-/*!
- \internal
- \brief Sets ODBC IRD using the given MySQL FIELD.
-
- This function exists to support MYODBCResStoreMetaData
- and is probably only called from there.
-
- \note Assumes that the descriptor record is initialized as per
- MYODBCDesRecAllocExt.
-
- \param pRes Pointer to a viable MYODBC_RES structure of an IRD.
- \param pField Pointer to a viable MySQL FIELD structure.
-
- \return MYODBC_C_BOOL
-
- \retval MYODBC_C_TRUE Everything went fine.
- \retval MYODBC_C_FALSE Something went wrong. Perhaps the MySQL
- 'type' was not recognized.
-
- \sa MYODBCResStoreMetaData
-*/
-MYODBC_C_BOOL MYODBCResStoreMetaDataField( MYODBC_DES_REC_PTR pDesRec,
- MYSQL_FIELD * pField );
-#endif
-
-
Modified: MYODBCRes/MYODBCResLib/MYODBCResLib.pro
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResLib.pro 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCResLib/MYODBCResLib.pro 2006-01-15 16:51:23 UTC (rev 38)
@@ -10,8 +10,6 @@
CONFIG += staticlib
INCLUDEPATH += ../../MYODBCC/include
INCLUDEPATH += ../../MYODBCDbg/include
-INCLUDEPATH += ../../MYODBCArray/include
-INCLUDEPATH += ../../MYODBCList/include
INCLUDEPATH += ../../MYODBCRtti/include
INCLUDEPATH += ../../MYODBCDia/include
INCLUDEPATH += ../../MYODBCDes/include
@@ -39,34 +37,10 @@
# #########################################################
HEADERS = \
../include/MYODBCRes.h \
+ ../include/MYODBCResDriver.h \
MYODBCResInternal.h
SOURCES = \
- MYODBCResAlloc.c \
- MYODBCResAppend.c \
- MYODBCResClear.c \
- MYODBCResConvert.c \
- MYODBCResDelete.c \
- MYODBCResExecute.c \
- MYODBCResFirst.c \
- MYODBCResFree.c \
- MYODBCResGet.c \
- MYODBCResGetAffected.c \
- MYODBCResGetColDef.c \
- MYODBCResGetCount.c \
- MYODBCResGetPos.c \
- MYODBCResGetPtr.c \
- MYODBCResInsert.c \
- MYODBCResIsEOR.c \
- MYODBCResLast.c \
- MYODBCResNext.c \
- MYODBCResPrepare.c \
- MYODBCResPrev.c \
- MYODBCResSet.c \
- MYODBCResSetColDef.c \
- MYODBCResSetPos.c \
- MYODBCResSetPtr.c \
- MYODBCResSkip.c \
- MYODBCResStoreMetaData.c \
- MYODBCResStoreMetaDataField.c
+ MYODBCRes.cpp \
+ MYODBCResDriver.cpp
Modified: MYODBCRes/MYODBCResLib/MYODBCResLib.vpj
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResLib.vpj 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCResLib/MYODBCResLib.vpj 2006-01-15 16:51:23 UTC (rev 38)
@@ -53,11 +53,14 @@
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl">
+ <F N="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"/>
@@ -73,6 +76,7 @@
<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"/>
Deleted: MYODBCRes/MYODBCResTest/MYODBCResTest.c
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.c 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.c 2006-01-15 16:51:23 UTC (rev 38)
@@ -1,83 +0,0 @@
-/*!
- \file MYODBCResTest.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 test MYODBCRes.
-*/
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <MYODBCC.h>
-#include <MYODBCDbg.h>
-#include <MYODBCDia.h>
-#include <MYODBCDes.h>
-#include <MYODBCRes.h>
-
-typedef struct tTEST
-{
- char * name;
- MYODBC_C_BOOL (*pfunc)();
-} TEST;
-
-/*!
- \brief test1
-
- Allocate result.
-*/
-MYODBC_C_BOOL test1()
-{
- MYODBC_RES_HANDLE hRes = NULL;
- MYODBC_DIA_HANDLE hDia = NULL;
- MYODBC_DES_PTR pDes = NULL;
-
- hDia = MYODBCDiaAlloc();
- pDes = MYODBCDesAlloc( NULL, MYODBC_RTTI_DES_IRD );
- MYODBCResAlloc( MYODBC_RES_METHOD_INTERNAL, hDia, pDes, NULL, &hRes );
-
- /* do stuff here */
-
- MYODBCResFree( hRes );
- MYODBCDesFree( pDes );
- MYODBCDiaFree( hDia );
-
- return MYODBC_C_TRUE;
-}
-
-/*!
- \brief main
-
- To add a new test simply create a new function in here
- and then 'register' it by adding another element to the
- 'tests' array.
-*/
-int main()
-{
- TEST tests[2]=
- {
- { "test1", test1},
- { NULL, NULL}
- };
- int n;
-
- for ( n = 0; tests[n].name; n++ )
- {
- printf( "%-40s", tests[n].name );
- if ( tests[n].pfunc() )
- printf( "[ OK ]\n" );
- else
- {
- printf( "[FAILED]\n" );
- exit( 1 );
- }
- }
-
- return 0;
-}
-
-
Copied: MYODBCRes/MYODBCResTest/MYODBCResTest.cpp (from rev 17,
MYODBCRes/MYODBCResTest/MYODBCResTest.c)
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.c 2005-12-27 03:12:31 UTC (rev 17)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.cpp 2006-01-15 16:51:23 UTC (rev 38)
@@ -0,0 +1,64 @@
+/*!
+ \file MYODBCResTest.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 test MYODBCRes.
+*/
+
+#include <QtTest/QtTest>
+#include <QString>
+#include <QFile>
+#include <MYODBCRes.h>
+#include <MYODBCResDriver.h>
+
+class MYODBCResTest : public QObject
+{
+ Q_OBJECT
+public:
+ MYODBCResTest();
+ ~MYODBCResTest();
+ QFile fileDebugOut;
+
+private slots:
+ void driver();
+};
+
+MYODBCResTest::MYODBCResTest()
+{
+ fileDebugOut.setFileName( "MYODBCResTest.txt" );
+ if ( fileDebugOut.open( QFile::WriteOnly | QFile::Truncate ) )
+ {
+ MYODBCDbgInit( &fileDebugOut );
+ }
+ else
+ {
+ MYODBCDbgInit( stdout );
+ }
+}
+
+MYODBCResTest::~MYODBCResTest()
+{
+ MYODBCDbgFini();
+ fileDebugOut.close();
+}
+
+void MYODBCResTest::driver()
+{
+ MYODBCDia * pdia = new MYODBCDia();
+ MYODBCDesIRD * pdesIRD = new MYODBCDesIRD( (SQLHANDLE)1 );
+ MYODBCResDriver * presDriver = new MYODBCResDriver( pdia, pdesIRD, (MYSQL *)1 );
+
+
+ delete presDriver;
+ delete pdesIRD;
+ delete pdia;
+}
+
+QTEST_MAIN( MYODBCResTest )
+#include "MYODBCResTest.moc"
+
+
+
Modified: MYODBCRes/MYODBCResTest/MYODBCResTest.pro
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.pro 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.pro 2006-01-15 16:51:23 UTC (rev 38)
@@ -7,22 +7,18 @@
include( ../../common.pri )
include( ../../config.pri )
include( ../../defines.pri )
-CONFIG += console
-INCLUDEPATH += ../../MYODBCC/include
-INCLUDEPATH += ../../MYODBCDbg/include
-INCLUDEPATH += ../../MYODBCArray/include
-INCLUDEPATH += ../../MYODBCList/include
-INCLUDEPATH += ../../MYODBCRtti/include
-INCLUDEPATH += ../../MYODBCDia/include
+include( ../../odbc.pri )
+CONFIG += qtestlib
+INCLUDEPATH += ../../MYODBCC/include
+INCLUDEPATH += ../../MYODBCDbg/include
+INCLUDEPATH += ../../MYODBCDia/include
INCLUDEPATH += ../../MYODBCDes/include
INCLUDEPATH += ../include
LIBS += -L../../lib
LIBS += -lMYODBCRes
-LIBS += -lMYODBCDes
-LIBS += -lMYODBCDia
-LIBS += -lMYODBCArray
-LIBS += -lMYODBCDbg
-LIBS += -lMYODBCC
+LIBS += -lMYODBCDes
+LIBS += -lMYODBCDia
+LIBS += -lMYODBCDbg
include( ../../mysql.pri )
@@ -41,6 +37,5 @@
HEADERS =
SOURCES = \
-# missing.c \
- MYODBCResTest.c
+ MYODBCResTest.cpp
Modified: MYODBCRes/MYODBCResTest/MYODBCResTest.vpj
===================================================================
--- MYODBCRes/MYODBCResTest/MYODBCResTest.vpj 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/MYODBCResTest/MYODBCResTest.vpj 2006-01-15 16:51:23 UTC (rev 38)
@@ -185,7 +185,6 @@
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl">
<F N="missing.c"/>
- <F N="MYODBCResTest.c"/>
</Folder>
<Folder
Name="Header Files"
Modified: MYODBCRes/include/MYODBCRes.h
===================================================================
--- MYODBCRes/include/MYODBCRes.h 2006-01-08 23:16:58 UTC (rev 37)
+++ MYODBCRes/include/MYODBCRes.h 2006-01-15 16:51:23 UTC (rev 38)
@@ -17,671 +17,50 @@
#include <MYODBCDia.h>
#include <MYODBCDes.h>
-#include <my_global.h>
-#include <my_sys.h>
+/* we introduce mysql stuff as late as possible - here */
#include <mysql.h>
-#include <my_list.h>
-#include <m_string.h>
-#include <errmsg.h>
-/*!
- \brief Where to insert a new record.
+#include "QVariant"
+#include "QVector"
+#include "QList"
- This is used by MYODBCResRowInsert
-*/
-typedef enum
+class MYODBCRes
{
- MYODBC_RES_INSERT_BEFORE,
- MYODBC_RES_INSERT_AFTER,
- MYODBC_RES_INSERT_FIRST,
- MYODBC_RES_INSERT_LAST
+public:
+ MYODBCRes( MYODBCDia *pdia, MYODBCDes *pdesIRD, MYSQL *pmysql );
+ virtual ~MYODBCRes();
-} MYODBC_RES_INSERT_TYPE;
+ virtual SQLRETURN setData( uint nColumn, const QVariant &variantData ) = 0;
+ virtual SQLRETURN setRow( my_ulonglong nRow ) = 0;
-/*!
- \brief Different methods we can use to generate results.
+ virtual SQLRETURN getColumns( uint *pnColumns ) = 0;
+ virtual SQLRETURN getData( uint nColumn, QVariant &variantData ) = 0;
+ virtual SQLRETURN getRow( my_ulonglong *pnRow ) = 0;
+ virtual SQLRETURN getRows( my_ulonglong *pnRows ) = 0;
+ virtual MYODBCDes * getDesIRD();
- These are used when creating a result set. The method chosen will affect
- what is, and is not, supported in the result.
+ virtual SQLRETURN doAppend() = 0;
+ virtual SQLRETURN doClear() = 0;
+ virtual SQLRETURN doDelete() = 0;
+ virtual SQLRETURN doFirst() = 0;
+ virtual SQLRETURN doInsert() = 0;
+ virtual SQLRETURN doLast() = 0;
+ virtual SQLRETURN doNext() = 0;
+ virtual SQLRETURN doPrev() = 0;
+ virtual SQLRETURN doSkip( my_ulonglong nRows ) = 0;
- \sa MYODBCResAlloc
-*/
-typedef enum
-{
- MYODBC_RES_METHOD_STMT, /*!< Results created by server using MYSQL_STMT. */
- MYODBC_RES_METHOD_RES, /*!< Results created by server using MYSQL_RES. */
- MYODBC_RES_METHOD_INTERNAL /*!< Results created and managed by driver. */
+ virtual bool isValidColumn( uint nColumn );
+ virtual bool isValidRow( my_ulonglong nRow ) = 0;
+ virtual bool isValidRow();
+ virtual bool isBOS() = 0;
+ virtual bool isEOS() = 0;
-} MYODBC_RES_METHOD_TYPE;
+protected:
+ MYSQL * pmysql; /*!< parent of MYSQL_RES or MYSQL_STMT */
+ MYODBCDes * pdesIRD; /*!< Reference to statements IRD */
+ MYODBCDia * pdia; /*!< Reference to statements hDia */
+};
-/*!
- \brief Different ways we can retrieve results.
-
- We can 'store' or 'use' results. When we 'store' results; all result
- data is pulled from the server when result is created (buffered). This is
- best when result is small. When we 'use' results; we get result data one
- row at a time (unbuffered). This is good when we have large result sets
-
- \sa MYODBCResAlloc
- mysql_store_result
- mysql_use_result
-*/
-typedef enum
-{
- MYODBC_RES_FETCH_BUFFERED,
- MYODBC_RES_FETCH_UNBUFFERED
-
-} MYODBC_RES_FETCH_TYPE;
-
-/*!
- \brief Result handle.
-
- The result set may be internally generated or generated on
- the server. The result may reside on the client side or the
- server side. Results which reside on the client side may be
- managed by the mysql client library or by myodbc.
-
- All of the above is hidden by MYODBC_RES_HANDLE.
- However; one can assume certian things - for example;
-
- A) Calling most info and catalog functions in myodbc will have
- the effect of creating a result which is generated and managed
- in myodbc.
-
- B) Calls to SQLExecute and SQLExecDirect will have the server
- create the result. Where the result is managed (mysql client
- or server) is dictated by; DSN options, env/dbc/stm attributes.
-*/
-typedef void *MYODBC_RES_HANDLE;
-
-/*!
- \brief Result cell.
-
- A result cell in MYODBC_RES_HANDLE. This is where row and col
- intersect - where our value/data is. In practice the cell
- may actually be;
-
- MYODBC_RES_METHOD_INTERNAL - MYODBC_RES_CELL_PTR
- MYODBC_RES_METHOD_RES - char *
- MYODBC_RES_METHOD_STMT - MYSQL_BIND *
-
- But these implementation details are hidden in MYODBC_RES_HANDLE
- and should not be of concern to Users of this API.
-
- We use MYODBC_RES_CELL as a generic way to set/get a cell value.
- This is used in conjunction with a corresponding IRD record.
-*/
-/* NOT USED!!!
-typedef struct tagMYODBC_RES_CELL
-{
- unsigned long nLength;
- char * pData;
-
-} MYODBC_RES_CELL, *MYODBC_RES_CELL_PTR;
-*/
-
-/*!
- \brief Result cell handle.
-
- A result cell in MYODBC_RES_HANDLE. This is where row and col
- intersect - where our value/data is.
-
- Caller should cast this to a pointer of the C-Type as described
- in the descriptor.
-*/
-typedef void *MYODBC_RES_CELL_PTR;
-
-/*!
- \internal
- \brief Allocates, initializes and returns a new MYODBC_RES_HANDLE.
-
- The current position will be EOR.
-
- \param nMethod A MYODBC_RES_METHOD_TYPE indicating what type
- of result set we will generate and how we will
- generate it.
- \param hDia Diagnostic handle to use for errors and warnings.
- This is likely to just be the diagnostic handle
- associated with an ODBC statement.
- \param pDesIRD Descriptor describing the result set. This is
- likely to be the IRD of a statement.
- \param pMySQL The current MySQL (connection) handle. This should
- be null if nMethod is MYODBC_RES_METHOD_INTERNAL.
- \param phRes Pointer to a place where we can store the new handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_ERROR
-
- \sa MYODBCResFree
-*/
-SQLRETURN MYODBCResAlloc( MYODBC_RES_METHOD_TYPE nMethod,
- MYODBC_DIA_HANDLE hDia,
- MYODBC_DES_PTR pDesIRD,
- MYSQL * pMySQL,
- MYODBC_RES_HANDLE * phRes );
-
-/*!
- \internal
- \brief Appends a row to result.
-
- Appends a new, blank, row to the end of the result and
- makes the new row the current position.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResInsert
-*/
-SQLRETURN MYODBCResAppend( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Clears result.
-
- Deletes all of the rows from the result.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResFree
- MYODBCResDelete
-*/
-SQLRETURN MYODBCResClear( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Delete row.
-
- Delete the row at current position. The current position
- must be valid.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResAppend
- MYODBCResInsert
-*/
-SQLRETURN MYODBCResDelete( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Submit the request to the server.
-
- This will cause bound parameters to be sent to the
- server and any results to be at least partially
- retreived.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_ERROR
-
- \sa MYODBCResPrepare
-*/
-SQLRETURN MYODBCResExecute( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Move to first row.
-
- Makes the first row the current position.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResLast
- MYODBCResNext
- MYODBCResPrev
- MYODBCResSkip
- MYODBCResSetPos
- MYODBCResIsEOR
-*/
-SQLRETURN MYODBCResFirst( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Free result.
-
- Release all resources allocated for the result. The
- result handle will no longer be valid.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_ERROR
-
- \sa MYODBCResAlloc
-*/
-SQLRETURN MYODBCResFree( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Get a column value.
-
- Gets a column value from the current row - converting value as needed.
-
- \param hRes Result handle.
- \param nColumn Desired column (0-based where 0=bookmark).
- \param nType Data type for pValue.
- \param pValue Value copied/converted to here.
- \param nBufferLength Size of pValue buffer.
- \param pnStrLenOrInd String length or null indicator returned here.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResSet
-*/
-SQLRETURN MYODBCResGet( MYODBC_RES_HANDLE hRes,
- SQLUSMALLINT nColumn,
- SQLSMALLINT nType,
- SQLPOINTER pValue,
- SQLINTEGER nBufferLength,
- SQLINTEGER * pnStrLenOrInd );
-
-/*!
- \internal
- \brief Gets the number of rows affected by UPDATE/INSERT.
-
- \param hRes Result handle.
- \param pnRows Place to hold number of rows.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResSetPos
- MYODBCResGetPos
-*/
-SQLRETURN MYODBCResGetAffected( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG * pnRows );
-
-/*!
- \internal
- \brief Get reference to column definitions.
-
- Gets a reference to the desired column definitions. This is
- the active IRD for the result.
-
- \param hRes Result handle.
- \param ppDesIRD Place to hold descriptor reference (IRD).
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResSetColDef
-*/
-SQLRETURN MYODBCResGetColDef( MYODBC_RES_HANDLE hRes,
- MYODBC_DES_PTR * ppDesIRD );
-
-/*!
- \internal
- \brief Gets the number of rows in result.
-
- Gets the number of rows in result. This may force the entire
- result to be retreived depending upon the type of result.
-
- \param hRes Result handle.
- \param pnRows Place to hold number of rows.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResSetPos
- MYODBCResGetPos
-*/
-SQLRETURN MYODBCResGetCount( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG * pnRows );
-
-/*!
- \internal
- \brief Gets the current position.
-
- Gets the current position. This value is 0-based.
-
- \param hRes Result handle.
- \param pnRow Place to hold current position.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResSetPos
-*/
-SQLRETURN MYODBCResGetPos( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG * pnRow );
-
-/*!
- \internal
- \brief Gets the value pointer for the requested column.
-
- Gets the value pointer for the requested column in the current row.
-
- \param hRes Result handle.
- \param nColumn 0-based where 0 = bookmark.
- \param ppData Place to hold pointer to column data.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResSetPtr
-*/
-SQLRETURN MYODBCResGetPtr( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG nColumn,
- MYODBC_RES_CELL_PTR * ppData );
-
-/*!
- \internal
- \brief Inserts a new row.
-
- Inserts a new, blank, row before the current position
- and makes the new row the current position.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResAppend
-*/
-SQLRETURN MYODBCResInsert( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Called to determine if current position is invalid.
-
- The current position is invalid when it is before the
- beginning of the list or after the end of the list.
-
- The current position may be invalid even when a call
- to MYODBCResGetPos seems to return a valid position. For
- this reason only rely upon this function to determine if
- the current position is valid.
-
- \param hRes Result handle.
-
- \return MYODBC_C_BOOL
-
- \retval MYODBC_C_TRUE Current position is invalid.
- \retval MYODBC_C_FALSE Current position is valid.
-*/
-MYODBC_C_BOOL MYODBCResIsEOR( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Move to last row.
-
- Makes the last row the current position.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResFirst
- MYODBCResNext
- MYODBCResPrev
- MYODBCResSkip
- MYODBCResSetPos
- MYODBCResIsEOR
-*/
-SQLRETURN MYODBCResLast( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Move to next row.
-
- Makes the next row the current position.
-
- If the current position is the last row - this call will
- make the current position invalid.
-
- If the current position is invalid and there are row(s) in
- the result - this call will make the current position
- the first row.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResFirst
- MYODBCResLast
- MYODBCResPrev
- MYODBCResSkip
- MYODBCResSetPos
- MYODBCResIsEOR
-*/
-SQLRETURN MYODBCResNext( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Prepares an SQL statement.
-
- Scans the SQL to gather information about any
- parameters which may exist.
-
- \param hRes Result handle.
- \param pszSQL SQL or other database command.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResInsert
-*/
-SQLRETURN MYODBCResPrepare( MYODBC_RES_HANDLE hRes,
- SQLCHAR * pszStatementText,
- SQLINTEGER nLength );
-
-/*!
- \internal
- \brief Move to prev row.
-
- Makes the prev row the current position.
-
- If the current position is the first row - this call will
- make the current position invalid.
-
- If the current position is invalid and there are row(s) in
- the result - this call will make the current position
- the last row.
-
- \param hRes Result handle.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResFirst
- MYODBCResLast
- MYODBCResNext
- MYODBCResSkip
- MYODBCResSetPos
- MYODBCResIsEOR
-*/
-SQLRETURN MYODBCResPrev( MYODBC_RES_HANDLE hRes );
-
-/*!
- \internal
- \brief Sets a column value.
-
- Sets a column value in the current row - converting value as needed.
-
- \param hRes Result handle.
- \param nColumn Desired column (0-based where 0=bookmark).
- \param nType SQL_C_? type found in pValue.
- \param pValue Value to copy. NULL = NULL.
- \param nLength Length of data in pValue. This can be SQL_NTS if pValue
- contains a null terminated string.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResGet
-*/
-SQLRETURN MYODBCResSet( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG nColumn,
- SQLSMALLINT nType,
- SQLPOINTER pValue,
- SQLINTEGER nLength );
-/*!
- \internal
- \brief Sets the column definition.
-
- Sets the column definition for the result. This is a
- reference to an IRD.
-
- \param hRes Result handle.
- \param pDesIRD Reference to a valid IRD.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
-
- \sa MYODBCResGetColDef
-*/
-SQLRETURN MYODBCResSetColDef( MYODBC_RES_HANDLE hRes,
- MYODBC_DES_PTR pDesIRD );
-
-/*!
- \internal
- \brief Makes the desired row the current position.
-
- Makes the desired row the current position. If the desired row
- is out of range the current position is becomes invalid.
-
- \param hRes Result handle.
- \param nRow Desired row number to make current position (0-based).
-
- \sa MYODBCResSkip
-*/
-SQLRETURN MYODBCResSetPos( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG nRow );
-
-/*!
- \internal
- \brief Sets the value pointer for the requested column.
-
- Sets the value pointer for the requested column in the current row. This
results
- in a new value for the column (whatever is in pData or NULL).
-
- \param hRes Result handle.
- \param nColumn 0-based where 0 = bookmark.
- \param pData Value pointer. Can be NULL.
-
- \return SQLRETURN
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResSetPtr
-*/
-SQLRETURN MYODBCResSetPtr( MYODBC_RES_HANDLE hRes,
- MYODBC_C_ULONGLONG nColumn,
- MYODBC_RES_CELL_PTR pData );
-/*!
- \internal
- \brief Moves the current position forward/backward.
-
- The current position is moved nRows prev if nRows is a negative number
- otherwise it is moved nRows forward.
-
- If the move results in the current position being moved before the beginning
- of the result or after the end - the current position becomes invalid.
-
- This function differs from MYODBCResSetPos in that it changes the current
- position relative to the current position.
-
- It is more efficient to use MYODBCResNext/MYODBCResPrev to move the current
- position by one row.
-
- \param hRes Result handle.
- \param nRows Desired number of rows to move. Negative to move backward, positive
- value to move forward.
-
- \retval SQL_SUCCESS
- \retval SQL_SUCCESS_WITH_INFO
- \retval SQL_ERROR
- \retval SQL_NO_DATA
-
- \sa MYODBCResSetPos
- MYODBCResNext
- MYODBCResPrev
- MYODBCResFirst
- MYODBCResLast
- MYODBCResIsEOR
-*/
-SQLRETURN MYODBCResSkip( MYODBC_RES_HANDLE hRes,
- MYODBC_C_LONGLONG nRows );
#endif
Modified: root.pro
===================================================================
--- root.pro 2006-01-08 23:16:58 UTC (rev 37)
+++ root.pro 2006-01-15 16:51:23 UTC (rev 38)
@@ -51,8 +51,8 @@
MYODBCIns \
# MYODBCSetup \
MYODBCDia \
- MYODBCDes
-# MYODBCRes \
+ MYODBCDes \
+ MYODBCRes
# MYODBCDrv \
# MYODBCInstaller \
# MYODBCShell
| Thread |
|---|
| • Connector/ODBC 5 commit: r38 - / MYODBCDes/MYODBCDesTest MYODBCRes MYODBCRes/MYODBCResLib MYODBCRes/MYODBCResTest MYODBCRes/include | pharvey | 15 Jan |