List:Commits« Previous MessageNext Message »
From:pharvey Date:November 17 2006 7:39am
Subject:Connector/ODBC 5 commit: r680 - trunk/SDK/MYSQLPlus/Library
View as plain text  
Modified:
   trunk/SDK/MYSQLPlus/Library/MStatement.cpp
Log:
Catch use of SQL_ATTR_PARAMSET_SIZE and report error until we fully support.

Modified: trunk/SDK/MYSQLPlus/Library/MStatement.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MStatement.cpp	2006-11-17 01:29:44 UTC (rev 679)
+++ trunk/SDK/MYSQLPlus/Library/MStatement.cpp	2006-11-17 07:39:14 UTC (rev 680)
@@ -2966,28 +2966,49 @@
     if ( isExecuted() )
         doStateRollBack( STATE_S3 );
 
+    /*!
+        \internal ODBC RULE
+
+        \todo
+
+        If the value of the SQL_ATTR_PARAMSET_SIZE statement attribute is greater than 1
and the SQL 
+        statement contains at least one parameter marker, SQLExecute executes the SQL
statement once for each 
+        set of parameter values in the arrays pointed to by the *ParameterValuePtr
argument in the calls to 
+        SQLBindParameter. For more information, see Arrays of Parameter Values.
+    */
+    if ( getParamsetSize() > 1 )
+        MYODBCDbgReturn( getDiagnostic()->doAppend( MDiagnostic::STATE_HY000, 0,
tr("SQL_ATTR_PARAMSET_SIZE > 1 not supported.") ) );
+
     MResult *pResult = getResult();
     Q_ASSERT( pResult );
     SQLRETURN nReturn = pResult->doExecute();
-    if ( !SQL_SUCCEEDED( nReturn ) )
+    switch ( nReturn )
     {
-        /*!
-            \internal ODBC RULE
-            \todo
+        case SQL_SUCCESS:
+        case SQL_SUCCESS_WITH_INFO:
+            break;
+        case SQL_NEED_DATA:
+            /*!
+                \internal ODBC RULE
 
-            If SQLExecute executes a searched update or delete statement that does 
-            not affect any rows at the data source, the call to SQLExecute returns 
-            SQL_NO_DATA.
-        */
-        /*!
-            \internal ODBC RULE
-            \todo
+                If SQLExecute encounters a data-at-execution parameter, it returns 
+                SQL_NEED_DATA. The application sends the data using SQLParamData and 
+                SQLPutData.
+            */
+            setState( STATE_S8 );
+            MYODBCDbgReturn( nReturn );
+        case SQL_NO_DATA:
+            /*!
+                \internal ODBC RULE
+                \todo
 
-            If SQLExecute encounters a data-at-execution parameter, it returns 
-            SQL_NEED_DATA. The application sends the data using SQLParamData and 
-            SQLPutData.
-        */
-        MYODBCDbgReturn( nReturn );
+                If SQLExecute executes a searched update or delete statement that does 
+                not affect any rows at the data source, the call to SQLExecute returns 
+                SQL_NO_DATA.
+            */
+            MYODBCDbgReturn( nReturn );
+        default:
+            MYODBCDbgReturn( nReturn );
     }
 
     /*!

Thread
Connector/ODBC 5 commit: r680 - trunk/SDK/MYSQLPlus/Librarypharvey17 Nov