List:Commits« Previous MessageNext Message »
From:pharvey Date:April 7 2006 10:31pm
Subject:Connector/ODBC 5 commit: r60 - / MYODBCRes/MYODBCResLib MYODBCRes/include
View as plain text  
Modified:
   CreateMakefiles.bat
   MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
   MYODBCRes/include/MYODBCRes.h
   MYODBCRes/include/MYODBCResClient.h
   MYODBCRes/include/MYODBCResDriver.h
   MYODBCRes/include/MYODBCResServer.h
   connector-odbc.vpw
Log:
- some doc work

Modified: CreateMakefiles.bat
===================================================================
--- CreateMakefiles.bat	2006-04-06 22:23:03 UTC (rev 59)
+++ CreateMakefiles.bat	2006-04-07 22:31:43 UTC (rev 60)
@@ -64,6 +64,12 @@
 cd ..\MYODBCDesTest
 qmake
 
+ECHO MYODBCAtt...
+cd ..\..\MYODBCAtt\MYODBCAttLib
+qmake
+cd ..\MYODBCAttTest
+qmake
+
 ECHO MYODBCRes...
 cd ..\..\MYODBCRes\MYODBCResLib
 qmake

Modified: MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResServer.cpp	2006-04-06 22:23:03 UTC (rev 59)
+++ MYODBCRes/MYODBCResLib/MYODBCResServer.cpp	2006-04-07 22:31:43 UTC (rev 60)
@@ -204,7 +204,7 @@
         variantData = nRow; // bookmark - using nRow has limitations  
     else
     {
-        MYSQL_BIND *pbind = pbindColumn[nColumn - 1];
+        MYSQL_BIND *pbind = &(pbindColumns[nColumn - 1]);
 
         if ( pbindColumns->is_null )
             variantData = QVariant();
@@ -252,7 +252,7 @@
                 case MYSQL_TYPE_BLOB:
                 case MYSQL_TYPE_MEDIUM_BLOB:
                 case MYSQL_TYPE_LONG_BLOB:
-                    variantData.setValue( QByteArray( pbind->buffer,
pbind->length_value ) );
+                    variantData.setValue( QByteArray( (const char *)pbind->buffer,
pbind->length_value ) );
                     break;
                 default:
                     MYODBCDbgReturn( getDia()->doAppend( MYODBC_DIA_HY000, 0, "Invalid
column bind data type." ) );
@@ -279,12 +279,12 @@
 {
     MYODBCDbgEnter();
 
-    QVariant    variantData;
-    MYSQL_BIND *pbind           = pbindColumns[nColumn];
-    SQLRETURN   nReturn         = getData( nColumn, &variantData );
-    SQLPOINTER  pdata           = pdesrec->getDataPtr();
-    SQLINTEGER * pnIndicator    = pdesrec->getIndicatorPtr();
-    SQLINTEGER * pnOctetLength  = pdesrec->getOctetLengthPtr();
+    QVariant        variantData;
+    MYSQL_BIND *    pbind           = &(pbindColumns[nColumn]);
+    SQLRETURN       nReturn         = getData( nColumn, variantData );
+    SQLPOINTER      pdata           = pdesrec->getDataPtr();
+    SQLINTEGER *    pnIndicator     = pdesrec->getIndicatorPtr();
+    SQLINTEGER *    pnOctetLength   = pdesrec->getOctetLengthPtr();
 
     if ( variantData.isNull() )
     {

Modified: MYODBCRes/include/MYODBCRes.h
===================================================================
--- MYODBCRes/include/MYODBCRes.h	2006-04-06 22:23:03 UTC (rev 59)
+++ MYODBCRes/include/MYODBCRes.h	2006-04-07 22:31:43 UTC (rev 60)
@@ -19,15 +19,19 @@
 #include "QVariant"
 #include "QVector"
 #include "QList"
+#include "QDateTime"
+#include "QByteArray"
+#include "QString"
 
 /*!
-    \brief  Resultset.
+    \brief  Result-set.
 
-            This is the base class (pure virtual) for a resultset. The problem this
+            This is the base class (pure virtual) for a result-set. 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
+            MYODBCResClient
             MYODBCResServer
 */
 class MYODBCRes
@@ -68,7 +72,7 @@
 protected:
     MYODBCAttStatement *    patt;       /*!< statement attributes               */
     MYSQL *                 pmysql;     /*!< parent of MYSQL_RES or MYSQL_STMT  */
-    int                     nState;     /*!< our state                          */
+    enum State              nState;     /*!< our state                          */
 
     virtual SQLRETURN   setState( enum State nState ) = 0;
 

Modified: MYODBCRes/include/MYODBCResClient.h
===================================================================
--- MYODBCRes/include/MYODBCResClient.h	2006-04-06 22:23:03 UTC (rev 59)
+++ MYODBCRes/include/MYODBCResClient.h	2006-04-07 22:31:43 UTC (rev 60)
@@ -3,6 +3,19 @@
 
 #include "MYODBCRes.h"
 
+/*!
+    \brief  This is a statement based upon a MYSQL_RES.
+
+            This is the traditional technique of working with result-sets using the 
+            C API in MySQL. 
+
+            This technique, currently, provides the most complete support for 
+            working with MySQL servers but also results in some limitations.
+
+    \sa MYODBCRes
+        MYODBCResDriver
+        MYODBCResServer
+*/
 class MYODBCResClient : public MYODBCRes
 {
 public:
@@ -33,7 +46,7 @@
     bool isValidRow( qulonglong nRow );
 
 protected:
-    MYSQL_STMT *        pstm;              /* MySQL prepared statement                   
     */
+    MYSQL_RES *         pstm;              /* MySQL statement                            
      */
     qulonglong          nRow;
     QString             stringStatement;   /* SQL statement as provided to doPrepare()   
     */
 

Modified: MYODBCRes/include/MYODBCResDriver.h
===================================================================
--- MYODBCRes/include/MYODBCResDriver.h	2006-04-06 22:23:03 UTC (rev 59)
+++ MYODBCRes/include/MYODBCResDriver.h	2006-04-07 22:31:43 UTC (rev 60)
@@ -3,6 +3,29 @@
 
 #include "MYODBCRes.h"
 
+/*!
+    \brief  This is a statement where the result-set is created and maintained within the
driver.
+
+            We use this to support driver derived result-sets. In most cases, but not
all, the
+            data for the result-set comes from the server. The driver will ensure that
the data
+            is structured in a way which is consistent with the ODBC specification. 
+
+            For example;
+                - SQLGetTypeInfo
+                - SQLProcedures
+                - SQLProcedureColumns
+                - SQLTables
+                - SQLPrimaryKeys
+                - SQLForeignKeys
+                - SQLSpecialColumns
+                - SQLColumns
+                - SQLStatistics
+                - SQLTablePrivileges
+
+    \sa MYODBCRes
+        MYODBCResClient
+        MYODBCResServer
+*/
 class MYODBCResDriver : public MYODBCRes
 {
 public:

Modified: MYODBCRes/include/MYODBCResServer.h
===================================================================
--- MYODBCRes/include/MYODBCResServer.h	2006-04-06 22:23:03 UTC (rev 59)
+++ MYODBCRes/include/MYODBCResServer.h	2006-04-07 22:31:43 UTC (rev 60)
@@ -3,6 +3,20 @@
 
 #include "MYODBCRes.h"
 
+/*!
+    \brief  This is a statement based upon a MYSQL_STMT.
+
+            We use this when we want to have the server do more of the work
+            such as prepare the statement text.
+
+    \note   There may be limitations due to incomplete implementation of
+            MYSQL_STMT based functionality on the server. For example some
+            SQL is not supported at this time. 
+
+    \sa MYODBCRes
+        MYODBCResClient
+        MYODBCResDriver
+*/
 class MYODBCResServer : public MYODBCRes
 {
 public:
@@ -35,19 +49,19 @@
     bool isValidRow( qulonglong nRow );
 
 protected:
-    MYSQL_STMT *    pstm;               /* MySQL prepared statement                      
                                              */
-    MYSQL_BIND *    pbindColumns;       /* binds for every col in res - loaded witb call
to mysql_stmt_fetch_column() as needed         */
-    qulonglong      nRow;               /* Current row. This is 1-based but a 0 is valid
(means before first row and after last row).   */
-    QString         stringStatement;    /* SQL statement as provided to doPrepare()      
                                              */
+    MYSQL_STMT *    pstm;               /*!< MySQL prepared statement                 
                                                   */
+    MYSQL_BIND *    pbindColumns;       /*!< binds for every col in res - loaded witb
call to mysql_stmt_fetch_column() as needed         */
+    qulonglong      nRow;               /*!< Current row. This is 1-based but a 0 is
valid (means before first row and after last row).   */
+    QString         stringStatement;    /*!< SQL statement as provided to doPrepare() 
                                                   */
 
     SQLRETURN       setState( enum State nState );
 
     enum State getState() { return nState; }
 
     /* prepare MYSQL_BIND for a call to mysql_stmt_fetch_column() - used by SQLColBind
and SQLGetData */
-    SQLRETURN   doInitBindCol( MYODBC_BIND_COL *pbind, uint nColumn, SQLSMALLINT
nTargetType, SQLPOINTER pTarget, SQLINTEGER nTargetSize, SQLINTEGER *pnStrLenInd );
+//    SQLRETURN   doInitBindCol( MYODBC_BIND_COL *pbind, uint nColumn, SQLSMALLINT
nTargetType, SQLPOINTER pTarget, SQLINTEGER nTargetSize, SQLINTEGER *pnStrLenInd );
     /* for some types we have had to use our own data buffer. for example mysql knows
nothing about SQL_NUMERIC_STRUCT - this is freed in here */
-    SQLRETURN   doFiniBindCol( MYODBC_BIND_COL *pbind );
+//    SQLRETURN   doFiniBindCol( MYODBC_BIND_COL *pbind );
 
     SQLRETURN doLoadMetaData();     /* load resultset meta data (IRD)                  
*/
     SQLRETURN doLoadMetaDataField( unsigned int nField, MYSQL_FIELD *pField ); /* load
resultset column meta data (IRD) */

Modified: connector-odbc.vpw
===================================================================
--- connector-odbc.vpw	2006-04-06 22:23:03 UTC (rev 59)
+++ connector-odbc.vpw	2006-04-07 22:31:43 UTC (rev 60)
@@ -34,6 +34,7 @@
 		<Project File="MYODBCShell/MYODBCShell.vpj"/>
 		<Project File="MYODBCTst/MYODBCTst.vpj"/>
 		<Project File="MYODBCTst/MYODBCTstLib/MYODBCTstLib.vpj"/>
+		<Project File="../mysql-include.vpj"/>
 		<Project File="root.vpj"/>
 	</Projects>
 </Workspace>

Thread
Connector/ODBC 5 commit: r60 - / MYODBCRes/MYODBCResLib MYODBCRes/includepharvey8 Apr