List:Commits« Previous MessageNext Message »
From:pharvey Date:November 28 2006 3:43pm
Subject:Connector/ODBC 5 commit: r698 - trunk/SDK/MYSQLPlus/Library
View as plain text  
Modified:
   trunk/SDK/MYSQLPlus/Library/MResultRes.cpp
Log:


Modified: trunk/SDK/MYSQLPlus/Library/MResultRes.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MResultRes.cpp	2006-11-28 14:40:00 UTC (rev 697)
+++ trunk/SDK/MYSQLPlus/Library/MResultRes.cpp	2006-11-28 14:43:12 UTC (rev 698)
@@ -197,11 +197,13 @@
         SQLExecute, SQLExecDirect, SQLBulkOperations, or SQLSetPos was called for the
StatementHandle and returned SQL_NEED_DATA. 
         This function was called before data was sent for all data-at-execution
parameters or columns.
     */
-    if ( stateExecute.nPrevCall != MStateExecute::PREV_CALL_NONE )
+    if ( stateExecute.nPrevCall != MStateExecute::PREV_CALL_CLEAR )
         MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::STATE_HY010 ) );
 
-    stateExecute.pDescriptorIPD = (MDescriptorIPD*)getImpParamDesc();
-    stateExecute.pDescriptorAPD = (MDescriptorAPD*)getAppParamDesc();
+    /* start to init our execute state.. */
+    stateExecute.doClear(); 
+    stateExecute.pDescriptorSQL = (MDescriptorIPD*)getImpParamDesc();
+    stateExecute.pDescriptorC = (MDescriptorAPD*)getAppParamDesc();
 
     /*!
         \internal ODBC RULE
@@ -220,8 +222,8 @@
 
         In other words; all parameters markers must have bound data.
     */
-    if ( stateExecute.pDescriptorIPD->getCount() <
pCommand->getParameterMarkerCount() )
-        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::STATE_07002, 0,
QString( tr("number of IPD records (%1) must be >= number of parameter markers (%2)")
).arg( stateExecute.pDescriptorIPD->getCount() ).arg(
pCommand->getParameterMarkerCount() ) ) );
+    if ( stateExecute.pDescriptorSQL->getCount() <
pCommand->getParameterMarkerCount() )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::STATE_07002, 0,
QString( tr("number of IPD records (%1) must be >= number of parameter markers (%2)")
).arg( stateExecute.pDescriptorSQL->getCount() ).arg(
pCommand->getParameterMarkerCount() ) ) );
 
     /*!
         \internal MYODBC RULE
@@ -229,19 +231,26 @@
         APD's can be swapped out by the app between/after SQLBindParameter etc and as
such get out of 
         sync. It should be sufficient to catch the case where we have too few APD
records.
     */
-    if ( stateExecute.pDescriptorAPD->getCount() <
pCommand->getParameterMarkerCount() )
-        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::STATE_07002, 0,
QString( tr("number of APD records (%1) must be >= number of parameter markers (%2)")
).arg( stateExecute.pDescriptorAPD->getCount() ).arg(
pCommand->getParameterMarkerCount() ) ) );
+    if ( stateExecute.pDescriptorC->getCount() <
pCommand->getParameterMarkerCount() )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::STATE_07002, 0,
QString( tr("number of APD records (%1) must be >= number of parameter markers (%2)")
).arg( stateExecute.pDescriptorC->getCount() ).arg(
pCommand->getParameterMarkerCount() ) ) );
 
 #if MYODBC_DBG > 1
     MYODBCDbgInfo( QString( "Command Raw=%1" ).arg( pCommand->getCommand() ) );
 #endif
 
+    /* more execute state init... */
     stateExecute.stringlistCommandSegments  = pCommand->getSegments();
     stateExecute.nParameterFirst            = pCommand->getParameterFirst(); /* we
offset the parameter because this may be the 2nd or more command in a batch */
 
-    SQLRETURN nReturn = doSubmitCommand( &stateExecute );
+    SQLRETURN nReturn = doInsertParameters( &stateExecute );
+    if ( nReturn == SQL_NEED_DATA )
+    {
+        stateExecute.nPrevCall = MStateExecute::PREV_CALL_EXECUTE;
+        MYODBCDbgReturn( nReturn );
+    }
 
-    stateExecute.nPrevCall                  = MStateExecute::PREV_CALL_EXECUTE;
+    if ( SQL_SUCCEEDED( nReturn ) )
+        nReturn = doSubmitCommand( stateExecute.stringCommand );
 
     MYODBCDbgReturn( nReturn );
 }
@@ -283,8 +292,6 @@
     MYODBCDbgReturn3( "%d", false ); 
 }
 
-/*!
-    \brief  Inserts any bound parameters into command and submits it to the server.
 
             This call is used to support doExecute. This call also supports doParamData
             for case when a bound parameter is SQL_LEN_DATA_AT_EXEC.

Thread
Connector/ODBC 5 commit: r698 - trunk/SDK/MYSQLPlus/Librarypharvey28 Nov