List:Commits« Previous MessageNext Message »
From:pharvey Date:January 20 2006 6:52am
Subject:Connector/ODBC 5 commit: r44 - / MYODBCAtt MYODBCAtt/MYODBCAttLib MYODBCAtt/MYODBCAttTest MYODBCAtt/include MYODBCRes/MYODBCResLib MYODBCRes/include
View as plain text  
Added:
   MYODBCAtt/
   MYODBCAtt/MYODBCAtt.pro
   MYODBCAtt/MYODBCAtt.vpj
   MYODBCAtt/MYODBCAttLib/
   MYODBCAtt/MYODBCAttLib/MYODBCAttInternal.h
   MYODBCAtt/MYODBCAttLib/MYODBCAttLib.pro
   MYODBCAtt/MYODBCAttLib/MYODBCAttLib.vpj
   MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp
   MYODBCAtt/MYODBCAttTest/
   MYODBCAtt/MYODBCAttTest/MYODBCAttTest.cpp
   MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro
   MYODBCAtt/include/
   MYODBCAtt/include/MYODBCAttStatement.h
   MYODBCAtt/include/MYODBCAttStm.h
Modified:
   MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp
   MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
   MYODBCRes/include/MYODBCResServer.h
   connector-odbc.vpw
Log:
UNICODE:
- more work to objectify resultsets (with loose coupling) and support unicode

Added: MYODBCAtt/MYODBCAtt.pro
===================================================================
--- MYODBCAtt/MYODBCAtt.pro	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAtt.pro	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,5 @@
+TEMPLATE        = subdirs
+SUBDIRS		= \
+		MYODBCResLib \
+		MYODBCResTest
+

Added: MYODBCAtt/MYODBCAtt.vpj
===================================================================
--- MYODBCAtt/MYODBCAtt.vpj	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAtt.vpj	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,72 @@
+<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
+<Project
+	Version="10.0"
+	VendorName="SlickEdit"
+	WorkingDir=".">
+	<Config
+		Name="Release"
+		OutputFile=""
+		CompilerConfigName="Latest Version">
+		<Menu>
+			<Target
+				Name="Compile"
+				MenuCaption="&amp;Compile"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveCurrent"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Build"
+				MenuCaption="&amp;Build"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveWorkspaceFiles"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Rebuild"
+				MenuCaption="&amp;Rebuild"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveWorkspaceFiles"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Debug"
+				MenuCaption="&amp;Debug"
+				SaveOption="SaveNone"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Execute"
+				MenuCaption="E&amp;xecute"
+				SaveOption="SaveNone"
+				RunFromDir="%rw">
+				<Exec CmdLine='"MYODBCAtt.exe"'/>
+			</Target>
+		</Menu>
+	</Config>
+	<Files>
+		<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"/>
+		<Folder
+			Name="Header Files"
+			Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
+			<F N="include/MYODBCAttStm.h"/>
+		</Folder>
+		<Folder
+			Name="Resource Files"
+			Filters="*.ico;*.cur;*.dlg"/>
+		<Folder
+			Name="Bitmaps"
+			Filters="*.bmp"/>
+		<Folder
+			Name="Other Files"
+			Filters="">
+			<F N="MYODBCAtt.pro"/>
+		</Folder>
+	</Files>
+</Project>

Added: MYODBCAtt/MYODBCAttLib/MYODBCAttInternal.h
===================================================================
--- MYODBCAtt/MYODBCAttLib/MYODBCAttInternal.h	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAttLib/MYODBCAttInternal.h	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,17 @@
+/*! 
+    \internal
+    \file     MYODBCAttInternal.h
+    \author   Peter Harvey <pharvey@stripped>
+              Copyright (C) MySQL AB 2004-2005, Released under GPL.
+    \version  Connector/ODBC v5
+    \date     2005          
+    \brief    Internal code to help manage a result-set.
+*/
+#ifndef MYODBC_ATT_INTERNAL_H
+#define MYODBC_ATT_INTERNAL_H
+
+#include "../include/MYODBCAtt.h"
+
+#endif
+
+

Added: MYODBCAtt/MYODBCAttLib/MYODBCAttLib.pro
===================================================================
--- MYODBCAtt/MYODBCAttLib/MYODBCAttLib.pro	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAttLib/MYODBCAttLib.pro	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,48 @@
+# #########################################################
+# COMMON
+# #########################################################
+TEMPLATE	= lib
+TARGET		= MYODBCRes
+DESTDIR		= ../../lib
+include( ../../common.pri )
+include( ../../config.pri )
+include( ../../defines.pri )
+CONFIG		+= staticlib
+INCLUDEPATH	+= ../../MYODBCC/include
+INCLUDEPATH	+= ../../MYODBCDbg/include
+INCLUDEPATH	+= ../../MYODBCRtti/include
+INCLUDEPATH	+= ../../MYODBCDia/include
+INCLUDEPATH	+= ../../MYODBCDes/include
+
+include( ../../mysql.pri )
+
+# #########################################################
+# UNIX
+#       Your preference should be to use the GNU auto-build
+#       on unix - but this will do as alternative.
+#
+#	64 bit linux
+#
+#	Static libs we link into a share lib - must have pos
+#	independent code (PIC) so we need to add PIC to
+#	CFLAGS and CXXFLAGS.
+# #########################################################
+unix {
+        QMAKE_CFLAGS    += $$QMAKE_CFLAGS_SHLIB
+        QMAKE_CXXFLAGS 	+= $$QMAKE_CXXFLAGS_SHLIB
+}
+
+# #########################################################
+# FILES
+# #########################################################
+HEADERS		= \
+		../include/MYODBCRes.h \
+		../include/MYODBCResDriver.h \
+		../include/MYODBCResServer.h \
+		MYODBCResInternal.h
+
+SOURCES		= \
+		MYODBCRes.cpp \
+		MYODBCResDriver.cpp \
+		MYODBCResServer.cpp
+

Added: MYODBCAtt/MYODBCAttLib/MYODBCAttLib.vpj
===================================================================
--- MYODBCAtt/MYODBCAttLib/MYODBCAttLib.vpj	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAttLib/MYODBCAttLib.vpj	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,74 @@
+<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
+<Project
+	Version="10.0"
+	VendorName="SlickEdit"
+	WorkingDir=".">
+	<Config
+		Name="Release"
+		OutputFile=""
+		CompilerConfigName="Latest Version">
+		<Menu>
+			<Target
+				Name="Compile"
+				MenuCaption="&amp;Compile"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveCurrent"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Build"
+				MenuCaption="&amp;Build"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveWorkspaceFiles"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Rebuild"
+				MenuCaption="&amp;Rebuild"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveWorkspaceFiles"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Debug"
+				MenuCaption="&amp;Debug"
+				SaveOption="SaveNone"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Execute"
+				MenuCaption="E&amp;xecute"
+				SaveOption="SaveNone"
+				RunFromDir="%rw">
+				<Exec CmdLine='"MYODBCAttLib.exe"'/>
+			</Target>
+		</Menu>
+	</Config>
+	<Files>
+		<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="MYODBCAttStatement.cpp"/>
+		</Folder>
+		<Folder
+			Name="Header Files"
+			Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
+			<F N="MYODBCAttInternal.h"/>
+		</Folder>
+		<Folder
+			Name="Resource Files"
+			Filters="*.ico;*.cur;*.dlg"/>
+		<Folder
+			Name="Bitmaps"
+			Filters="*.bmp"/>
+		<Folder
+			Name="Other Files"
+			Filters="">
+			<F N="MYODBCAttLib.pro"/>
+		</Folder>
+	</Files>
+</Project>

Added: MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp
===================================================================
--- MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAttLib/MYODBCAttStatement.cpp	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,153 @@
+#include "MYODBCAttInternal.h"
+
+MYODBCAtt::MYODBCAttStm( SQLHANDLE hStm, MYODBCDia *pdia )
+{
+    MYODBCDbgEnter();
+
+    Q_ASSERT( !hStm );
+    Q_ASSERT( !pdia );
+
+    this->hStm          = hStm;
+    this->pdia          = pdia;
+    pAppParamDesc       = pAppParamDescOrig = new MYODBCDesAPD( hStm );
+    pAppRowDesc         = pAppRowDescOrig   = new MYODBCDesARD( hStm );
+    nAsyncEnable        = SQL_ASYNC_ENABLE_OFF;
+    nConcurrency        = SQL_CONCUR_READ_ONLY;
+    nCursorScrollable   = SQL_FETCH_NEXT;
+    nCursorUnspecified  = SQL_UNSPECIFIED;
+
+    MYODBCDbgReturn2();
+}
+
+void MYODBCAtt::MYODBCAtt()
+{
+    MYODBCDbgEnter();
+
+    delete pAppParamDescOrig;
+    delete pAppRowDescOrig;
+
+    MYODBCDbgReturn2();
+}
+
+SQLRETURN MYODBCAtt::setAppParamDesc( MYODBCDes *pdes )
+{
+    MYODBCDbgEnter();
+
+    if ( pdes == SQL_NULL_DESC )
+        pAppParamDesc = pAppParamDescOrig;
+    else
+    {
+        if ( pdes->getAllocType() == SQL_DESC_ALLOC_AUTO && pdes !=
pAppParamDescOrig )
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY017, 0, NULL ) );
+        pAppParamDesc = pdes;
+    }
+
+    MYODBCDbgReturn( SQL_SUCCESS );
+}
+
+SQLRETURN MYODBCAtt::setAppRowDesc( MYODBCDes *pdes )
+{
+    MYODBCDbgEnter();
+
+    if ( pdes == SQL_NULL_DESC )
+        pAppRowDesc = pAppRowDescOrig;
+    else
+    {
+        if ( pdes->getAllocType() == SQL_DESC_ALLOC_AUTO && pdes !=
pAppRowDescOrig )
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY017, 0, NULL ) );
+        pAppRowDesc = pdes;
+    }
+
+    MYODBCDbgReturn( SQL_SUCCESS );
+}
+
+SQLRETURN MYODBCAtt::setAsyncEnable( SQLUINTEGER nAsyncEnable )
+{
+    MYODBCDbgEnter();
+
+    MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HYC00, 0, NULL ) );
+}
+
+SQLRETURN MYODBCAtt::setConcurrency( SQLUINTEGER nConcurrency )
+{
+    MYODBCDbgEnter();
+
+    switch ( nConcurrency )
+    {
+        case SQL_CONCUR_READ_ONLY:
+            nCursorSensitivity = SQL_INSENSITIVE;
+            break;
+        case SQL_CONCUR_LOCK:
+        case SQL_CONCUR_ROWVER:
+        case SQL_CONCUR_VALUES:
+            if ( nCursorSensitivity == SQL_INSENSITIVE )
+                nCursorSensitivity = SQL_UNSPECIFIED;
+            break;
+        default:
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY092, 0, NULL ) );
+    }
+
+    this->nConcurrency = nConcurrency;
+
+    MYODBCDbgReturn( SQL_SUCCESS );
+}
+
+SQLRETURN MYODBCAtt::setCursorScrollable( SQLUINTEGER nCursorScrollable )
+{
+    MYODBCDbgEnter();
+
+    switch ( nCursorScrollable )
+    {
+        case SQL_NONSCROLLABLE:
+            nCursorType = SQL_CURSOR_FORWARD_ONLY;
+            break;
+        case SQL_FETCH_NEXT:
+            break;
+        case SQL_SCROLLABLE:
+            nCursorType = SQL_CURSOR_STATIC; /*! \todo see odbc spec about this rule and
improve */
+            break;
+        default:
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY092, 0, NULL ) );
+    }
+
+    this->nCursorScrollable = nCursorScrollable;
+
+    MYODBCDbgReturn( SQL_SUCCESS );
+}
+
+SQLRETURN MYODBCAtt::setCursorSensitivity( SQLUINTEGER nCursorSensitivity )
+{
+    MYODBCDbgEnter();
+
+    switch ( nCursorSensitivity )
+    {
+        case SQL_UNSPECIFIED:
+            break;
+        case SQL_INSENSITIVE:
+            nConcurrency    = SQL_CONCUR_READ_ONLY;
+            nCursorType     = SQL_CURSOR_STATIC;
+            break;
+        case SQL_SENSITIVE:
+            break;
+        default:
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY092, 0, NULL ) );
+    }
+
+    this->nCursorSensitivity = nCursorSensitivity;
+
+    MYODBCDbgReturn( SQL_SUCCESS );
+}
+
+
+
+++++++++++++++++
+
+SQLUINTEGER MYODBCAtt::getAsyncEnable()
+{
+    MYODBCDbgEnter();
+
+    MYODBCDbgReturn3( "%d", nAsyncEnable );
+}
+
+
+

Added: MYODBCAtt/MYODBCAttTest/MYODBCAttTest.cpp
===================================================================
--- MYODBCAtt/MYODBCAttTest/MYODBCAttTest.cpp	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAttTest/MYODBCAttTest.cpp	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,197 @@
+/*! 
+    \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();
+}
+
+/* imitates a SQLStatistics call */
+void MYODBCResTest::driver()
+{
+    MYODBCDia *     pdia        = new MYODBCDia();
+    MYODBCDes *     pdes        = new MYODBCDesIRD( (SQLHANDLE)1 );
+    MYODBCRes *     pres        = new MYODBCResDriver( pdia, pdes, (MYSQL *)1 );
+    uint            nColumns    = 0;
+    qulonglong      nRows       = 0;
+    qulonglong      nRow        = 0;
+    QVariant        variantData;
+
+    /* its a driver resultset so we must set the IRD manually */
+    pdes->setCount( 13 );
+    pdes->setName( 0, "bookmark" );
+    pdes->setType( 0, SQL_INTEGER );
+    pdes->setName( 1, "TABLE_CAT" );
+    pdes->setType( 1, SQL_VARCHAR );
+    pdes->setName( 2, "TABLE_SCHEM" );
+    pdes->setType( 2, SQL_VARCHAR );
+    pdes->setName( 3, "TABLE_NAME" );
+    pdes->setType( 3, SQL_VARCHAR );
+    pdes->setName( 4, "NON_UNIQUE" );
+    pdes->setType( 4, SQL_SMALLINT );
+    pdes->setName( 5, "INDEX_QUALIFIER" );
+    pdes->setType( 5, SQL_VARCHAR );
+    pdes->setName( 6, "INDEX_NAME" );
+    pdes->setType( 6, SQL_VARCHAR );
+    pdes->setName( 7, "TYPE" );
+    pdes->setType( 7, SQL_SMALLINT );
+    pdes->setName( 8, "ORDINAL_POSITION" );
+    pdes->setType( 8, SQL_SMALLINT );
+    pdes->setName( 9, "COLUMN_NAME" );
+    pdes->setType( 9, SQL_VARCHAR );
+    pdes->setName( 10, "ASC_OR_DESC" );
+    pdes->setType( 10, SQL_CHAR );
+    pdes->setName( 11, "CARDINALITY" );
+    pdes->setType( 11, SQL_INTEGER );
+    pdes->setName( 12, "PAGES" );
+    pdes->setType( 12, SQL_INTEGER );
+    pdes->setName( 13, "FILTER_CONDITION" );
+    pdes->setType( 13, SQL_VARCHAR );
+
+    pres->getColumns( &nColumns );
+    QCOMPARE( (int)nColumns, 13 );
+
+    /* append some records */
+    QCOMPARE( pres->isValidRow(), false );
+    pres->doAppend();
+    QCOMPARE( pres->isValidRow(), true );
+
+    pres->setData( 1, "1" );
+    pres->setData( 2, "MyTableSchem" );
+    pres->setData( 3, "MyTableName" );
+    pres->setData( 4, SQL_TRUE );
+    pres->setData( 9, "MyColumnName" );
+    pres->getRow( &nRow );
+    QCOMPARE( (int)nRow, 1 );
+
+    pres->doAppend();
+    pres->setData( 1, "2" );
+    pres->setData( 2, "MyTableSchem" );
+    pres->setData( 3, "MyTableName" );
+    pres->setData( 4, SQL_FALSE );
+    pres->setData( 9, "MyColumnName" );
+    pres->getRow( &nRow );
+    QCOMPARE( (int)nRow, 2 );
+
+    pres->doAppend();
+    pres->setData( 1, "3" );
+    pres->setData( 2, "MyTableSchem" );
+    pres->setData( 3, "MyTableName" );
+    pres->setData( 4, SQL_TRUE );
+    pres->setData( 9, "MyColumnName" );
+    pres->getRow( &nRow );
+    QCOMPARE( (int)nRow, 3 );
+    pres->getRows( &nRows );
+    QCOMPARE( (int)nRows, 3 );
+
+    /* doFirst(), doNext() */
+    pres->doFirst();
+    pres->getData( 1, variantData );
+    QCOMPARE( 1, variantData.toInt() );
+
+    pres->doNext();
+    pres->getData( 1, variantData );
+    QCOMPARE( 2, variantData.toInt() );
+
+    pres->doNext();
+    pres->getData( 1, variantData );
+    QCOMPARE( 3, variantData.toInt() );
+    QCOMPARE( pres->isValidRow(), true );
+
+    pres->doNext();
+    QCOMPARE( pres->isValidRow(), false );
+
+    pres->doNext();
+    pres->getData( 1, variantData );
+    QCOMPARE( 1, variantData.toInt() );
+
+    /* doLast(), doPrev() */
+    pres->doLast();
+    pres->getData( 1, variantData );
+    QCOMPARE( 3, variantData.toInt() );
+
+    pres->doPrev();
+    pres->getData( 1, variantData );
+    QCOMPARE( 2, variantData.toInt() );
+
+    pres->doPrev();
+    pres->getData( 1, variantData );
+    QCOMPARE( 1, variantData.toInt() );
+    QCOMPARE( pres->isValidRow(), true );
+
+    pres->doPrev();
+    QCOMPARE( pres->isValidRow(), false );
+
+    pres->doPrev();
+    pres->getData( 1, variantData );
+    QCOMPARE( 3, variantData.toInt() );
+
+    /* doSkip() */
+    pres->doFirst();
+    pres->doSkip( 2 );
+    pres->getData( 1, variantData );
+    pres->getRow( &nRow );
+    QCOMPARE( (int)nRow, 3 );
+    QCOMPARE( 3, variantData.toInt() );
+
+    pres->doSkip( 1 );
+    QCOMPARE( pres->isValidRow(), false );
+
+    pres->doLast();
+    pres->doSkip( -2 );
+    pres->getData( 1, variantData );
+    QCOMPARE( 1, variantData.toInt() );
+
+    pres->doSkip( -1 );
+    QCOMPARE( pres->isValidRow(), false );
+
+    /* fini */
+    delete pres;
+    delete pdes;
+    delete pdia;
+}
+
+QTEST_MAIN( MYODBCResTest )
+#include "MYODBCResTest.moc"
+
+
+

Added: MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro
===================================================================
--- MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/MYODBCAttTest/MYODBCAttTest.pro	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,41 @@
+# #########################################################
+# COMMON
+# #########################################################
+TEMPLATE	= app
+TARGET          = MYODBCResTest
+DESTDIR		= ../../bin
+include( ../../common.pri )
+include( ../../config.pri )
+include( ../../defines.pri )
+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            += -lMYODBCDbg
+
+include( ../../mysql.pri )
+
+# #########################################################
+# WIN32
+# #########################################################
+win32 {
+#        TMAKE_LFLAGS    += /NODEFAULTLIB:libcmt.lib
+#        TMAKE_LFLAGS    += /NODEFAULTLIB:libcmtd.lib
+}
+
+
+# #########################################################
+# FILES
+# #########################################################
+HEADERS		=  
+
+SOURCES		= \
+		MYODBCResTest.cpp
+

Added: MYODBCAtt/include/MYODBCAttStatement.h
===================================================================
--- MYODBCAtt/include/MYODBCAttStatement.h	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/include/MYODBCAttStatement.h	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,53 @@
+#ifndef MYODBC_RES_SERVER_H
+#define MYODBC_RES_SERVER_H
+
+#include "MYODBCRes.h"
+
+class MYODBCResServer : public MYODBCRes
+{
+public:
+    MYODBCResServer( MYODBCDia *pdia, MYODBCDes *pdesIRD, MYSQL *pmysql );
+    ~MYODBCResServer();
+
+    SQLRETURN setData( uint nColumn, const QVariant &variantData );
+    SQLRETURN setRow( qulonglong nRow );
+
+    SQLRETURN getColumns( uint *pnColumns );
+    SQLRETURN getData( uint nColumn, QVariant &variantData );
+    SQLRETURN getRow( qulonglong *pnRow );
+    SQLRETURN getRows( qulonglong *pnRows );
+
+    SQLRETURN doAppend();
+    SQLRETURN doClear();
+    SQLRETURN doDelete();
+    SQLRETURN doExecute();
+    SQLRETURN doFirst();
+    SQLRETURN doInsert();
+    SQLRETURN doLast();
+    SQLRETURN doNext();
+    SQLRETURN doPrepare( const QString &stringStatement );
+    SQLRETURN doPrev();
+    SQLRETURN doSeek( qlonglong nRow );
+    SQLRETURN doSkip( qlonglong nRows );
+
+    bool isValidRow();
+    bool isValidRow( qulonglong nRow );
+
+protected:
+    MYSQL_STMT *pstm;               /* MySQL prepared statement                        
*/
+    MYSQL_BIND *pbindColumns;       /* we bind all/any columns of resultset here       
*/
+    qulonglong  nRow;               /* current row (1 - based, 0 is BOF/EOF)           
*/
+    QString     stringStatement;    /* SQL statement as provided to doPrepare()        
*/
+    bool        bBuffered;          /* true if we pull complete resultset to client    
*/
+    bool        bForwardOnly;       /* we will not */
+
+    
+
+
+    SQLRETURN doLoadMetaData();     /* load resultset meta data (IRD)                  
*/
+    SQLRETURN doLoadMetaDataField( unsigned int nField, MYSQL_FIELD *pField ); /* load
resultset column meta data (IRD) */
+    void      doInit();
+};
+
+#endif
+

Added: MYODBCAtt/include/MYODBCAttStm.h
===================================================================
--- MYODBCAtt/include/MYODBCAttStm.h	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCAtt/include/MYODBCAttStm.h	2006-01-20 06:52:10 UTC (rev 44)
@@ -0,0 +1,81 @@
+
+class MYODBCAttStm
+{
+public:
+    MYODBCAttStm( SQLHANDLE hStm, MYODBCDia *pdia );
+    virtual void ~MYODBCAttStm();
+
+    virtual setAsyncEnable( SQLUINTEGER nAsyncEnable );           /*!<
SQL_ATTR_ASYNC_ENABLE                  */
+    SQLUINTEGER     nConcurrency;           /*!< SQL_ATTR_CONCURRENCY                 
 */
+    SQLUINTEGER     nCursorScrollable;      /*!< SQL_ATTR_CURSOR_SCROLLABLE           
 */
+    SQLUINTEGER     nCursorSensitivity;     /*!< SQL_ATTR_CURSOR_SENSITIVITY          
 */
+    SQLUINTEGER     nCursorType;            /*!< SQL_ATTR_CURSOR_TYPE                 
 */ 
+    SQLUINTEGER     nEnableAutoIPD;         /*!< SQL_ATTR_ENABLE_AUTO_IPD             
 */
+    SQLPOINTER      pFetchBookmarkPtr;      /*!< SQL_ATTR_FETCH_BOOKMARK_PTR          
 */
+    MYODBCDesIPD ** ppImpParamDesc;         /*!< SQL_ATTR_IMP_PARAM_DESC              
 */
+    MYODBCDesIRD ** ppImpRowDesc;           /*!< SQL_ATTR_IMP_ROW_DESC                
 */
+    SQLUINTEGER     nKeysetSize;            /*!< SQL_ATTR_KEYSET_SIZE                 
 */
+    SQLUINTEGER     nMaxLength;             /*!< SQL_ATTR_MAX_LENGTH                  
 */
+    SQLUINTEGER     nMaxRows;               /*!< SQL_ATTR_MAX_ROWS                    
 */
+    SQLUINTEGER     nMetadataID;            /*!< SQL_ATTR_METADATA_ID                 
 */
+    SQLUINTEGER     nNoscan;                /*!< SQL_ATTR_NOSCAN                      
 */
+//    SQLUINTEGER *   pnParamBindOffsetPtr;   /*!< SQL_ATTR_PARAM_BIND_OFFSET_PTR =
APD->SQL_DESC_BIND_OFFSET_PTR     */
+//    SQLUINTEGER     nParamBindType;         /*!< SQL_ATTR_PARAM_BIND_TYPE =
APD->SQL_DESC_ BIND_TYPE                */
+//    SQLUSMALLINT *  pnParamOperationPtr;    /*!< SQL_ATTR_PARAM_OPERATION_PTR =
APD->SQL_DESC_ARRAY_STATUS_PTR      */
+//    SQLUSMALLINT *  pnParamStatusPtr;       /*!< SQL_ATTR_PARAM_STATUS_PTR =
IPD->SQL_DESC_ARRAY_STATUS_PTR         */
+//    SQLUINTEGER *   pnParamsProcessedPtr;   /*!< SQL_ATTR_PARAMS_PROCESSED_PTR =
IPD->SQL_DESC_ROWS_PROCESSED_PTR   */
+//    SQLUINTEGER     nParamsetSize;          /*!< SQL_ATTR_PARAMSET_SIZE =
APD->SQL_DESC_ARRAY_SIZE                  */
+    SQLUINTEGER     nQueryTimeout;          /*!< SQL_ATTR_QUERY_TIMEOUT               
 */
+    SQLUINTEGER     nRetrieveData;          /*!< SQL_ATTR_RETRIEVE_DATA               
 */
+//    SQLUINTEGER     nRowArraySize;          /*!< SQL_ATTR_ROW_ARRAY_SIZE =
ARD->SQL_DESC_ARRAY_SIZE                 */
+//    SQLUINTEGER *   pnRowBindOffsetPtr;     /*!< SQL_ATTR_ROW_BIND_OFFSET_PTR =
ARD->SQL_DESC_BIND_OFFSET_PTR       */
+//    SQLUINTEGER     nRowBindType;           /*!< SQL_ATTR_ROW_BIND_TYPE =
ARD->SQL_DESC_BIND_TYPE                   */
+    SQLUINTEGER     nRowNumber;             /*!< SQL_ATTR_ROW_NUMBER                  
 */
+//    SQLUSMALLINT *  pnRowOperationPtr;      /*!< SQL_ATTR_ROW_OPERATION_PTR =
ARD->SQL_DESC_ARRAY_STATUS_PTR        */
+//    SQLUSMALLINT *  pnRowStatusPtr;         /*!< SQL_ATTR_ROW_STATUS_PTR =
IRD->SQL_DESC_ARRAY_STATUS_PTR           */
+//    SQLUINTEGER *   pnRowsFetchedPtr;       /*!< SQL_ATTR_ROWS_FETCHED_PTR =
IRD->SQL_DESC_ROWS_PROCESSED_PTR       */
+    SQLUINTEGER     nSimulateCursor;        /*!< SQL_ATTR_SIMULATE_CURSOR             
 */
+    SQLUINTEGER     nUseBookmarks;          /*!< SQL_ATTR_USE_BOOKMARKS               
 */
+
+    virtual SQLUINTEGER getAsyncEnable();
+
+protected:
+    SQLHANDLE   hStm;                   /*!< Statement (which owns us).             */
        
+    MYODBCDia * pdia;                   /*!< Statements diagnostic.                 */
+    MYODBCDes * pAppParamDescOrig;      /*!< Original app param desc.               */
+    MYODBCDes * pAppRowDescOrig;        /*!< Original app row desc.                 */
+
+    MYODBCDes * pAppParamDesc;          /*!< SQL_ATTR_APP_PARAM_DESC                */
+    MYODBCDes * pAppRowDesc;            /*!< SQL_ATTR_APP_ROW_DESC                  */
+    SQLUINTEGER nAsyncEnable;           /*!< SQL_ATTR_ASYNC_ENABLE                  */
+    SQLUINTEGER nConcurrency;           /*!< SQL_ATTR_CONCURRENCY                   */
+    SQLUINTEGER nCursorScrollable;      /*!< SQL_ATTR_CURSOR_SCROLLABLE             */
+    SQLUINTEGER nCursorSensitivity;     /*!< SQL_ATTR_CURSOR_SENSITIVITY            */
+    SQLUINTEGER nCursorType;            /*!< SQL_ATTR_CURSOR_TYPE                   */

+    SQLUINTEGER nEnableAutoIPD;         /*!< SQL_ATTR_ENABLE_AUTO_IPD               */
+    SQLPOINTER  pFetchBookmarkPtr;      /*!< SQL_ATTR_FETCH_BOOKMARK_PTR            */
+    MYODBCDes * pImpParamDesc;          /*!< SQL_ATTR_IMP_PARAM_DESC                */
+    MYODBCDes * pImpRowDesc;            /*!< SQL_ATTR_IMP_ROW_DESC                  */
+    SQLUINTEGER nKeysetSize;            /*!< SQL_ATTR_KEYSET_SIZE                   */
+    SQLUINTEGER nMaxLength;             /*!< SQL_ATTR_MAX_LENGTH                    */
+    SQLUINTEGER nMaxRows;               /*!< SQL_ATTR_MAX_ROWS                      */
+    SQLUINTEGER nMetadataID;            /*!< SQL_ATTR_METADATA_ID                   */
+    SQLUINTEGER nNoscan;                /*!< SQL_ATTR_NOSCAN                        */
+//    SQLUINTEGER *   pnParamBindOffsetPtr;   /*!< SQL_ATTR_PARAM_BIND_OFFSET_PTR =
APD->SQL_DESC_BIND_OFFSET_PTR     */
+//    SQLUINTEGER     nParamBindType;         /*!< SQL_ATTR_PARAM_BIND_TYPE =
APD->SQL_DESC_ BIND_TYPE                */
+//    SQLUSMALLINT *  pnParamOperationPtr;    /*!< SQL_ATTR_PARAM_OPERATION_PTR =
APD->SQL_DESC_ARRAY_STATUS_PTR      */
+//    SQLUSMALLINT *  pnParamStatusPtr;       /*!< SQL_ATTR_PARAM_STATUS_PTR =
IPD->SQL_DESC_ARRAY_STATUS_PTR         */
+//    SQLUINTEGER *   pnParamsProcessedPtr;   /*!< SQL_ATTR_PARAMS_PROCESSED_PTR =
IPD->SQL_DESC_ROWS_PROCESSED_PTR   */
+//    SQLUINTEGER     nParamsetSize;          /*!< SQL_ATTR_PARAMSET_SIZE =
APD->SQL_DESC_ARRAY_SIZE                  */
+    SQLUINTEGER nQueryTimeout;          /*!< SQL_ATTR_QUERY_TIMEOUT                 */
+    SQLUINTEGER nRetrieveData;          /*!< SQL_ATTR_RETRIEVE_DATA                 */
+//    SQLUINTEGER     nRowArraySize;          /*!< SQL_ATTR_ROW_ARRAY_SIZE =
ARD->SQL_DESC_ARRAY_SIZE                 */
+//    SQLUINTEGER *   pnRowBindOffsetPtr;     /*!< SQL_ATTR_ROW_BIND_OFFSET_PTR =
ARD->SQL_DESC_BIND_OFFSET_PTR       */
+//    SQLUINTEGER     nRowBindType;           /*!< SQL_ATTR_ROW_BIND_TYPE =
ARD->SQL_DESC_BIND_TYPE                   */
+    SQLUINTEGER nRowNumber;             /*!< SQL_ATTR_ROW_NUMBER                    */
+//    SQLUSMALLINT *  pnRowOperationPtr;      /*!< SQL_ATTR_ROW_OPERATION_PTR =
ARD->SQL_DESC_ARRAY_STATUS_PTR        */
+//    SQLUSMALLINT *  pnRowStatusPtr;         /*!< SQL_ATTR_ROW_STATUS_PTR =
IRD->SQL_DESC_ARRAY_STATUS_PTR           */
+//    SQLUINTEGER *   pnRowsFetchedPtr;       /*!< SQL_ATTR_ROWS_FETCHED_PTR =
IRD->SQL_DESC_ROWS_PROCESSED_PTR       */
+    SQLUINTEGER nSimulateCursor;        /*!< SQL_ATTR_SIMULATE_CURSOR               */
+    SQLUINTEGER nUseBookmarks;          /*!< SQL_ATTR_USE_BOOKMARKS                 */
+};

Modified: MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCRes/MYODBCResLib/MYODBCResDriver.cpp	2006-01-20 06:52:10 UTC (rev 44)
@@ -148,6 +148,8 @@
 {
     MYODBCDbgEnter();
 
+    /*! \todo inserts mess up the use of nRow for bookmarks */
+
     if ( nRow == 0 )
     {
         listResults.insert( nRow, QVector<QVariant>( pdesIRD->getCount() - 1 )
);

Modified: MYODBCRes/MYODBCResLib/MYODBCResServer.cpp
===================================================================
--- MYODBCRes/MYODBCResLib/MYODBCResServer.cpp	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCRes/MYODBCResLib/MYODBCResServer.cpp	2006-01-20 06:52:10 UTC (rev 44)
@@ -19,7 +19,7 @@
     MYODBCDbgReturn2();
 }
 
-SQLRETURN MYODBCResServer::setData( uint nColumn, const QVariant & )
+SQLRETURN MYODBCResServer::setData( uint nColumn, const QVariant &variantData )
 {
     MYODBCDbgEnter();
 
@@ -33,6 +33,8 @@
     if (  nColumn == 0 )
         MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid column.
Bookmark column is read-only." ) );
 
+    /*! \todo */
+
     MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "setData not supported here
at this time." ) );
 }
 
@@ -43,9 +45,17 @@
     if ( !isValidRow() )
         MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
 
-    mysql_stmt_data_seek( pstm, nRow );
+    if ( bBuffered )
+    {
+        if ( !isValidRow() )
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid row." ) );
 
-    MYODBCDbgReturn( SQL_SUCCESS );
+        mysql_stmt_data_seek( pstm, nRow );
+
+        MYODBCDbgReturn( SQL_SUCCESS );
+    }
+
+
 }
 
 SQLRETURN MYODBCResServer::getColumns( uint *pnColumns )
@@ -62,7 +72,7 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
-SQLRETURN MYODBCResServer::getData( uint nColumn, QVariant & )
+SQLRETURN MYODBCResServer::getData( uint nColumn, QVariant &variantData )
 {
     MYODBCDbgEnter();
 
@@ -72,6 +82,11 @@
     if ( !isValidColumn( nColumn ) )
         MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "Invalid column." ) );
 
+    if ( nColumn == 0 )
+        variantData = nRow; // bookmark is row num - obvious limitations apply
+    else
+        variantData = xxxx;
+
     MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, 0, "getData not supported here
yet - use SELECT with bound columns." ) );
 }
 
@@ -143,8 +158,11 @@
     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 ) ) );
+    if ( bBuffered )
+    {
+        if ( mysql_stmt_store_result( pstm ) )
+            MYODBCDbgReturn( pdia->doAppend( MYODBC_DIA_HY000, mysql_stmt_errno( pstm
), mysql_stmt_error( pstm ) ) );
+    }
 
     MYODBCDbgReturn( SQL_SUCCESS );
 }
@@ -761,6 +779,7 @@
     nRow            = 0;
     pbindColumns    = NULL;
     stringStatement = QString::null; 
+    bBuffered       = true;
     Q_ASSERT( !pstm );
 }
 

Modified: MYODBCRes/include/MYODBCResServer.h
===================================================================
--- MYODBCRes/include/MYODBCResServer.h	2006-01-19 19:51:41 UTC (rev 43)
+++ MYODBCRes/include/MYODBCResServer.h	2006-01-20 06:52:10 UTC (rev 44)
@@ -38,7 +38,12 @@
     MYSQL_BIND *pbindColumns;       /* we bind all/any columns of resultset here       
*/
     qulonglong  nRow;               /* current row (1 - based, 0 is BOF/EOF)           
*/
     QString     stringStatement;    /* SQL statement as provided to doPrepare()        
*/
+    bool        bBuffered;          /* true if we pull complete resultset to client    
*/
+    bool        bForwardOnly;       /* we will not */
 
+    
+
+
     SQLRETURN doLoadMetaData();     /* load resultset meta data (IRD)                  
*/
     SQLRETURN doLoadMetaDataField( unsigned int nField, MYSQL_FIELD *pField ); /* load
resultset column meta data (IRD) */
     void      doInit();

Modified: connector-odbc.vpw
===================================================================
--- connector-odbc.vpw	2006-01-19 19:51:41 UTC (rev 43)
+++ connector-odbc.vpw	2006-01-20 06:52:10 UTC (rev 44)
@@ -2,6 +2,8 @@
 <Workspace Version="10.0" VendorName="SlickEdit">
 	<Projects>
 		<Project File="dltest/dltest.vpj"/>
+		<Project File="MYODBCAtt/MYODBCAtt.vpj"/>
+		<Project File="MYODBCAtt/MYODBCAttLib/MYODBCAttLib.vpj"/>
 		<Project File="MYODBCC/MYODBCC.vpj"/>
 		<Project File="MYODBCC/MYODBCCLib/MYODBCCLib.vpj"/>
 		<Project File="MYODBCC/MYODBCCTest/MYODBCCTest.vpj"/>

Thread
Connector/ODBC 5 commit: r44 - / MYODBCAtt MYODBCAtt/MYODBCAttLib MYODBCAtt/MYODBCAttTest MYODBCAtt/include MYODBCRes/MYODBCResLib MYODBCRes/includepharvey20 Jan