List:Commits« Previous MessageNext Message »
From:pharvey Date:October 6 2006 6:52pm
Subject:Connector/ODBC 5 commit: r577 - in trunk/SDK: C/Library C/include MYSQLPlus/Library
View as plain text  
Modified:
   trunk/SDK/C/Library/MYODBCC.cpp
   trunk/SDK/C/include/MYODBCC.h
   trunk/SDK/MYSQLPlus/Library/MDiagnostic.cpp
   trunk/SDK/MYSQLPlus/Library/MDiagnostic.h
   trunk/SDK/MYSQLPlus/Library/MInternal.h
Log:
FIX: More work to implement ODBC v3 SQL State mapping to ODBC v2 SQL State

Modified: trunk/SDK/C/Library/MYODBCC.cpp
===================================================================
--- trunk/SDK/C/Library/MYODBCC.cpp	2006-10-06 16:49:50 UTC (rev 576)
+++ trunk/SDK/C/Library/MYODBCC.cpp	2006-10-06 18:52:43 UTC (rev 577)
@@ -28,249 +28,6 @@
 */
 #include "../include/MYODBCC.h"
 
-/*!
-    \internal
-    \brief  This is a static table of all SQL, diagnostic, state information for ODBC v2.
-    
-            This static table is referenced using a corresponding numeric
-            identifier \sa MDiagnostic::DIA. The information in this table is used
-            to format diagnostic messages.
-        
-            The number of elements in here should ALWAYS be (MDiagnostic::DIA_MAX - 1).
-    
-    \sa     MDiagnostic::DIA 
-            MDIAGNOSTIC_STATE
-*/
-MYODBC_STATE MYODBCStatesV2[]=
-{
-    {"ISO 9075","01000","01","General warning",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01002","01","Disconnect error",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01003","01","NULL value eliminated in set
function",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01004","01","Data truncated",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01006","01","Privilege not revoked",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S00","01","Invalid connection string
attribute",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S01","01","Error in row",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S02","01","Option value changed",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S03","01","No rows updated or delete",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S04","01","More than one row updated or
deleted",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","07001","07","Wrong number of parameters",SQL_ERROR},
-    {"ISO 9075","07006","07","Restricted data type attribute violation",SQL_ERROR},
-    {"ISO 9075","08001","08","Unable to connect to data source",SQL_ERROR},
-    {"ISO 9075","08002","08","Connection in use",SQL_ERROR},
-    {"ISO 9075","08003","08","Connection not open",SQL_ERROR},
-    {"ISO 9075","08004","08","Data source rejected establishment of
connection",SQL_ERROR},
-    {"ISO 9075","08007","08","Connection failure during transaction",SQL_ERROR},
-    {"ISO 9075","08S01","08","Communication link failure",SQL_ERROR},
-    {"ISO 9075","21S01","21","Insert value list does not match column list",SQL_ERROR},
-    {"ISO 9075","21S02","21","Degree of derived table does not match column
list",SQL_ERROR},
-    {"ISO 9075","22001","22","String data right-truncated",SQL_ERROR},
-    {"ISO 9075","22003","22","Numeric value out of range",SQL_ERROR},
-    {"ISO 9075","22005","22","Error in assignment",SQL_ERROR},
-    {"ISO 9075","22008","22","Datetime field overflow",SQL_ERROR},
-    {"ISO 9075","22012","22","Division by zero",SQL_ERROR},
-    {"ISO 9075","22026","22","String data length mismatch",SQL_ERROR},
-    {"ISO 9075","23000","23","Integrity constraint violation",SQL_ERROR},
-    {"ISO 9075","24000","24","Invalid cursor state",SQL_ERROR},
-    {"ISO 9075","25000","25","Invalid transaction state",SQL_ERROR},
-    {"ISO 9075","28000","28","Invalid authorization specification",SQL_ERROR},
-    {"ISO 9075","34000","34","Invalid cursor name",SQL_ERROR},
-    {"ISO 9075","37000","37","Syntax error or access violation",SQL_ERROR},
-    {"ISO 9075","3C000","3C","Duplicate cursor name",SQL_ERROR},
-    {"ISO 9075","3F000","3F","Invalid schema name",SQL_ERROR},
-    {"ISO 9075","40001","40","Serialization failure",SQL_ERROR},
-    {"ISO 9075","42000","42","Syntax error or access violation",SQL_ERROR},
-    {"ISO 9075","70100","70","Operation aborted",SQL_ERROR},
-    {"ISO 9075","IM001","IM","Driver does not support this function",SQL_ERROR},
-    {"ISO 9075","IM002","IM","Data source name not found and no default driver
specified",SQL_ERROR},
-    {"ISO 9075","IM003","IM","Specified driver could not be loaded",SQL_ERROR},
-    {"ISO 9075","IM004","IM","Driver's SQLAllocEnv failed",SQL_ERROR},
-    {"ISO 9075","IM005","IM","Driver's SQLAllocConnect failed",SQL_ERROR},
-    {"ISO 9075","IM006","IM","Driver's SQLSetConnectOption failed",SQL_ERROR},
-    {"ISO 9075","IM007","IM","No data source or driver specified; dialog
prohibited",SQL_ERROR},
-    {"ISO 9075","IM008","IM","Dialog failed",SQL_ERROR},
-    {"ISO 9075","IM009","IM","Unable to load translation DLL",SQL_ERROR},
-    {"ISO 9075","IM010","IM","Data source name too long",SQL_ERROR},
-    {"ISO 9075","IM011","IM","Driver name too long",SQL_ERROR},
-    {"ISO 9075","IM012","IM","DRIVER keyword syntax error",SQL_ERROR},
-    {"ISO 9075","IM013","IM","Trace file error",SQL_ERROR},
-    {"ISO 9075","S0001","S0","Base table or view already exists",SQL_ERROR},
-    {"ISO 9075","S0002","S0","Base table not found",SQL_ERROR},
-    {"ISO 9075","S0011","S0","Index already exists",SQL_ERROR},
-    {"ISO 9075","S0012","S0","Index not found",SQL_ERROR},
-    {"ISO 9075","S0021","S0","Column already exists",SQL_ERROR},
-    {"ISO 9075","S0022","S0","Column not found",SQL_ERROR},
-    {"ISO 9075","S0023","S0","No default for column",SQL_ERROR},
-    {"ISO 9075","S1000","S1","General error",SQL_ERROR},
-    {"ISO 9075","S1001","S1","Memory allocation error",SQL_ERROR},
-    {"ISO 9075","S1002","S1","Invalid column number",SQL_ERROR},
-    {"ISO 9075","S1003","S1","Program type out of range",SQL_ERROR},
-    {"ISO 9075","S1004","S1","SQL data type out of range",SQL_ERROR},
-    {"ISO 9075","S1008","S1","Operation canceled",SQL_ERROR},
-    {"ISO 9075","S1009","S1","Invalid argument value",SQL_ERROR},
-    {"ISO 9075","S1010","S1","Function sequence error",SQL_ERROR},
-    {"ISO 9075","S1011","S1","Operation invalid at this time",SQL_ERROR},
-    {"ISO 9075","S1012","S1","Invalid transaction operation code specified",SQL_ERROR},
-    {"ISO 9075","S1015","S1","No cursor name available",SQL_ERROR},
-    {"ISO 9075","S1090","S1","Invalid string or buffer length",SQL_ERROR},
-    {"ISO 9075","S1091","S1","Descriptor type out of range",SQL_ERROR},
-    {"ISO 9075","S1092","S1","Option type out of range",SQL_ERROR},
-    {"ISO 9075","S1093","S1","Inavlid parameter number",SQL_ERROR},
-    {"ISO 9075","S1094","S1","Invalid scale value",SQL_ERROR},
-    {"ISO 9075","S1095","S1","Function type out of range",SQL_ERROR},
-    {"ISO 9075","S1096","S1","Information type out of range",SQL_ERROR},
-    {"ISO 9075","S1097","S1","Column type out of range",SQL_ERROR},
-    {"ISO 9075","S1098","S1","Scope type out of range",SQL_ERROR},
-    {"ISO 9075","S1099","S1","Nullable type out of range",SQL_ERROR},
-    {"ISO 9075","S1100","S1","Uniqueness option type out of range",SQL_ERROR},
-    {"ISO 9075","S1101","S1","Accuracy option type out of range",SQL_ERROR},
-    {"ISO 9075","S1103","S1","Direction option out of range",SQL_ERROR},
-    {"ISO 9075","S1104","S1","Invalid precision value",SQL_ERROR},
-    {"ISO 9075","S1105","S1","Invalid parameter type",SQL_ERROR},
-    {"ISO 9075","S1106","S1","Fetch type out of range",SQL_ERROR},
-    {"ISO 9075","S1107","S1","Row value out of range",SQL_ERROR},
-    {"ISO 9075","S1108","S1","Concurrency option out of range",SQL_ERROR},
-    {"ISO 9075","S1109","S1","Invalid cursor position",SQL_ERROR},
-    {"ISO 9075","S1110","S1","Invalid driver completion",SQL_ERROR},
-    {"ISO 9075","S1111","S1","Invalid bookmark value",SQL_ERROR},
-    {"ISO 9075","S1C00","S1","Driver not capable",SQL_ERROR},
-    {"ISO 9075","S1T00","S1","Timeout expired",SQL_ERROR}
-};
-
-/*!
-    \internal
-    \brief  This is a static table of all SQL, diagnostic, state information.
-    
-            This static table is referenced using a corresponding numeric
-            identifier \sa MDiagnostic::DIA. The information in this table is used
-            to format diagnostic messages.
-        
-            The number of elements in here should ALWAYS be (MDiagnostic::DIA_MAX - 1).
-    
-    \sa     MDiagnostic::DIA 
-            MDIAGNOSTIC_STATE
-*/
-MYODBC_STATE MYODBCStatesV3[]=
-{
-    {"ISO 9075","01000","01","General warning",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01001","01","Cursor operation conflict",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01002","01","Disconnect error",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01003","01","NULL value eliminated in set
function",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01004","01","String data right-truncated",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01006","01","Privilege not revoked",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01007","01","Privilege not granted",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S00","01","Invalid connection string
attribute",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S01","01","Error in row",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S02","01","Option value changed",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S06","01","Attempt to fetch before the result set returned the first
rowset",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S07","01","Fractional truncation",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S08","01","Error saving File DSN",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","01S09","01","Invalid keyword",SQL_SUCCESS_WITH_INFO},
-    {"ISO 9075","07001","07","Wrong number of parameters",SQL_ERROR},
-    {"ISO 9075","07002","07","COUNT field incorrect",SQL_ERROR},
-    {"ISO 9075","07005","07","Prepared statement not a cursor-specification",SQL_ERROR},
-    {"ISO 9075","07006","07","Restricted data type attribute violation",SQL_ERROR},
-    {"ISO 9075","07009","07","Invalid descriptor index",SQL_ERROR},
-    {"ISO 9075","07S01","07","Invalid use of default parameter",SQL_ERROR},
-    {"ISO 9075","08001","08","Client unable to establish connection",SQL_ERROR},
-    {"ISO 9075","08002","08","Connection name in use",SQL_ERROR},
-    {"ISO 9075","08003","08","Connection does not exist",SQL_ERROR},
-    {"ISO 9075","08004","08","Server rejected the connection",SQL_ERROR},
-    {"ISO 9075","08007","08","Connection failure during transaction",SQL_ERROR},
-    {"ISO 9075","08S01","08","Communication link failure",SQL_ERROR},
-    {"ISO 9075","21S01","21","Insert value list does not match column list",SQL_ERROR},
-    {"ISO 9075","21S02","21","Degree of derived table does not match column
list",SQL_ERROR},
-    {"ISO 9075","22001","22","String data right-truncated",SQL_ERROR},
-    {"ISO 9075","22002","22","Indicator variable required but not supplied",SQL_ERROR},
-    {"ISO 9075","22003","22","Numeric value out of range",SQL_ERROR},
-    {"ISO 9075","22007","22","Invalid datetime format",SQL_ERROR},
-    {"ISO 9075","22008","22","Datetime field overflow",SQL_ERROR},
-    {"ISO 9075","22012","22","Division by zero",SQL_ERROR},
-    {"ISO 9075","22015","22","Interval field overflow",SQL_ERROR},
-    {"ISO 9075","22018","22","Invalid character value for cast specification",SQL_ERROR},
-    {"ISO 9075","22019","22","Invalid escape character",SQL_ERROR},
-    {"ISO 9075","22025","22","Invalid escape sequence",SQL_ERROR},
-    {"ISO 9075","22026","22","String data length mismatch",SQL_ERROR},
-    {"ISO 9075","23000","23","Integrity constraint violation",SQL_ERROR},
-    {"ISO 9075","24000","24","Invalid cursor state",SQL_ERROR},
-    {"ISO 9075","25000","25","Invalid transaction state",SQL_ERROR},
-    {"ISO 9075","25S01","25","Transaction state",SQL_ERROR},
-    {"ISO 9075","25S02","25","Transaction is still active",SQL_ERROR},
-    {"ISO 9075","25S03","25","Transaction is rolled back",SQL_ERROR},
-    {"ISO 9075","28000","28","Invalid authorization specification",SQL_ERROR},
-    {"ISO 9075","34000","34","Invalid cursor name",SQL_ERROR},
-    {"ISO 9075","3C000","3C","Duplicate cursor name",SQL_ERROR},
-    {"ISO 9075","3D000","3D","Invalid catalog name",SQL_ERROR},
-    {"ISO 9075","3F000","3F","Invalid schema name",SQL_ERROR},
-    {"ISO 9075","40001","40","Serialization failure",SQL_ERROR},
-    {"ISO 9075","40002","40","Integrity constraint violation",SQL_ERROR},
-    {"ISO 9075","40003","40","Statement completion unknown",SQL_ERROR},
-    {"ISO 9075","42000","42","Syntax error or access violation",SQL_ERROR},
-    {"ISO 9075","42S01","42","Base table or view already exists",SQL_ERROR},
-    {"ISO 9075","42S02","42","Base table or view not found",SQL_ERROR},
-    {"ISO 9075","42S11","42","Index already exists",SQL_ERROR},
-    {"ISO 9075","42S12","42","Index not found",SQL_ERROR},
-    {"ISO 9075","42S21","42","Column already exists",SQL_ERROR},
-    {"ISO 9075","42S22","42","Column not found",SQL_ERROR},
-    {"ISO 9075","44000","44","WITH CHECK OPTION violation",SQL_ERROR},
-    {"ISO 9075","HY000","HY","General error",SQL_ERROR},
-    {"ISO 9075","HY001","HY","Memory allocation error",SQL_ERROR},
-    {"ISO 9075","HY003","HY","Invalid application buffer type",SQL_ERROR},
-    {"ISO 9075","HY004","HY","Invalid SQL data type",SQL_ERROR},
-    {"ISO 9075","HY007","HY","Associated statement is not prepared",SQL_ERROR},
-    {"ISO 9075","HY008","HY","Operation canceled",SQL_ERROR},
-    {"ISO 9075","HY009","HY","Invalid use of null pointer",SQL_ERROR},
-    {"ISO 9075","HY010","HY","Function sequence error",SQL_ERROR},
-    {"ISO 9075","HY011","HY","Attribute cannot be set now",SQL_ERROR},
-    {"ISO 9075","HY012","HY","Invalid transaction operation code",SQL_ERROR},
-    {"ISO 9075","HY013","HY","Memory management error",SQL_ERROR},
-    {"ISO 9075","HY014","HY","Limit on the number of handles exceeded",SQL_ERROR},
-    {"ISO 9075","HY015","HY","No cursor name available",SQL_ERROR},
-    {"ISO 9075","HY016","HY","Cannot modify an implementation row descriptor",SQL_ERROR},
-    {"ISO 9075","HY017","HY","Invalid use of an automatically allocated descriptor
handle",SQL_ERROR},
-    {"ISO 9075","HY018","HY","Server declined cancel request",SQL_ERROR},
-    {"ISO 9075","HY019","HY","Non-character and non-binary data sent in
pieces",SQL_ERROR},
-    {"ISO 9075","HY020","HY","Attempt to concatenate a null value",SQL_ERROR},
-    {"ISO 9075","HY021","HY","Inconsistent descriptor information",SQL_ERROR},
-    {"ISO 9075","HY024","HY","Invalid attribute value",SQL_ERROR},
-    {"ISO 9075","HY090","HY","Invalid string or buffer length",SQL_ERROR},
-    {"ISO 9075","HY091","HY","Invalid descriptor field identifier",SQL_ERROR},
-    {"ISO 9075","HY092","HY","Invalid attribute/option identifier",SQL_ERROR},
-    {"ISO 9075","HY095","HY","Function type out of range",SQL_ERROR},
-    {"ISO 9075","HY096","HY","Invalid information type",SQL_ERROR},
-    {"ISO 9075","HY097","HY","Column type out of range",SQL_ERROR},
-    {"ISO 9075","HY098","HY","Scope type out of range",SQL_ERROR},
-    {"ISO 9075","HY099","HY","Nullable type out of range",SQL_ERROR},
-    {"ISO 9075","HY100","HY","Uniqueness option type out of range",SQL_ERROR},
-    {"ISO 9075","HY101","HY","Accuracy option type out of range",SQL_ERROR},
-    {"ISO 9075","HY103","HY","Invalid retrieval code",SQL_ERROR},
-    {"ISO 9075","HY104","HY","Invalid precision or scale value",SQL_ERROR},
-    {"ISO 9075","HY105","HY","Invalid parameter type",SQL_ERROR},
-    {"ISO 9075","HY106","HY","Fetch type out of range",SQL_ERROR},
-    {"ISO 9075","HY107","HY","Row value out of range",SQL_ERROR},
-    {"ISO 9075","HY109","HY","Invalid cursor position",SQL_ERROR},
-    {"ISO 9075","HY110","HY","Invalid driver completion",SQL_ERROR},
-    {"ISO 9075","HY111","HY","Invalid bookmark value",SQL_ERROR},
-    {"ISO 9075","HYC00","HY","Optional feature not implemented",SQL_ERROR},
-    {"ISO 9075","HYT00","HY","Timeout expired",SQL_ERROR},
-    {"ISO 9075","HYT01","HY","Connection timeout expired",SQL_ERROR},
-    {"ODBC 3.0","IM001","IM","Driver does not support this function",SQL_ERROR},
-    {"ODBC 3.0","IM002","IM","Data source name not found and no default driver
specified",SQL_ERROR},
-    {"ODBC 3.0","IM003","IM","Specified driver could not be loaded",SQL_ERROR},
-    {"ODBC 3.0","IM004","IM","Driver's SQLAllocHandle on SQL_HANDLE_ENV
failed",SQL_ERROR},
-    {"ODBC 3.0","IM005","IM","Driver's SQLAllocHandle on SQL_HANDLE_DBC
failed",SQL_ERROR},
-    {"ODBC 3.0","IM006","IM","Driver's SQLSetConnectAttr failed",SQL_ERROR},
-    {"ODBC 3.0","IM007","IM","No data source or driver specified; dialog
prohibited",SQL_ERROR},
-    {"ODBC 3.0","IM008","IM","Dialog failed",SQL_ERROR},
-    {"ODBC 3.0","IM009","IM","Unable to load translation DLL",SQL_ERROR},
-    {"ODBC 3.0","IM010","IM","Data source name too long",SQL_ERROR},
-    {"ODBC 3.0","IM011","IM","Driver name too long",SQL_ERROR},
-    {"ODBC 3.0","IM012","IM","DRIVER keyword syntax error",SQL_ERROR},
-    {"ODBC 3.0","IM013","IM","Trace file error",SQL_ERROR},
-    {"ODBC 3.0","IM014","IM","Invalid name of File DSN",SQL_ERROR},
-    {"ODBC 3.0","IM015","IM","Corrupt file data source",SQL_ERROR}
-};
-
-
 void *MYODBCC::getMem( size_t nBytes )
 {
     return malloc( nBytes );

Modified: trunk/SDK/C/include/MYODBCC.h
===================================================================
--- trunk/SDK/C/include/MYODBCC.h	2006-10-06 16:49:50 UTC (rev 576)
+++ trunk/SDK/C/include/MYODBCC.h	2006-10-06 18:52:43 UTC (rev 577)
@@ -111,25 +111,6 @@
 #endif
 
 /*!
-    \internal
-    \brief  State information.
-
-            This is used to generate a static 'table' of all state information.
-
-    \sa     MDiagnostic
-*/
-typedef struct tMYODBC_STATE
-{
-  QString   stringClassOrigin;  /*!< SQL_DIAG_CLASS_ORIGIN  */
-  QString   stringSQLState;     /*!< SQL_DIAG_SQLSTATE      */
-  QString   stringClass;
-  QString   stringText;
-  SQLRETURN nReturnCode;        /*!< SQLRETURN              */
-
-} MYODBC_STATE;
-
-
-/*!
     \brief  C API portability and convenience.
 
             This class is basically just a namespace for us to play in. From
@@ -139,6 +120,7 @@
 class MYODBCC
 {
 public:
+
     /*!
         \brief  Get some memory.
 

Modified: trunk/SDK/MYSQLPlus/Library/MDiagnostic.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MDiagnostic.cpp	2006-10-06 16:49:50 UTC (rev 576)
+++ trunk/SDK/MYSQLPlus/Library/MDiagnostic.cpp	2006-10-06 18:52:43 UTC (rev 577)
@@ -1,5 +1,393 @@
 #include "MDiagnostic.h"
 
+MDIAGNOSTIC_STATE MDiagnosticStatesV2[]=
+{
+    {"SQL-92","01","000","General warning",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","002","Disconnect error",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","003","NULL value eliminated in set function",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","004","Data truncated",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","006","Privilege not revoked",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","S00","Invalid connection string attribute",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","S01","Error in row",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","S02","Option value changed",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","S03","No rows updated or delete",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","01","S04","More than one row updated or deleted",SQL_SUCCESS_WITH_INFO},
+    {"SQL-92","07","001","Wrong number of parameters",SQL_ERROR},
+    {"SQL-92","07","006","Restricted data type attribute violation",SQL_ERROR},
+    {"SQL-92","08","001","Unable to connect to data source",SQL_ERROR},
+    {"SQL-92","08","002","Connection in use",SQL_ERROR},
+    {"SQL-92","08","003","Connection not open",SQL_ERROR},
+    {"SQL-92","08","004","Data source rejected establishment of connection",SQL_ERROR},
+    {"SQL-92","08","007","Connection failure during transaction",SQL_ERROR},
+    {"SQL-92","08","S01","Communication link failure",SQL_ERROR},
+    {"SQL-92","21","S01","Insert value list does not match column list",SQL_ERROR},
+    {"SQL-92","21","S02","Degree of derived table does not match column list",SQL_ERROR},
+    {"SQL-92","22","001","String data right-truncated",SQL_ERROR},
+    {"SQL-92","22","003","Numeric value out of range",SQL_ERROR},
+    {"SQL-92","22","005","Error in assignment",SQL_ERROR},
+    {"SQL-92","22","008","Datetime field overflow",SQL_ERROR},
+    {"SQL-92","22","012","Division by zero",SQL_ERROR},
+    {"SQL-92","22","026","String data length mismatch",SQL_ERROR},
+    {"SQL-92","23","000","Integrity constraint violation",SQL_ERROR},
+    {"SQL-92","24","000","Invalid cursor state",SQL_ERROR},
+    {"SQL-92","25","000","Invalid transaction state",SQL_ERROR},
+    {"SQL-92","28","000","Invalid authorization specification",SQL_ERROR},
+    {"SQL-92","34","000","Invalid cursor name",SQL_ERROR},
+    {"SQL-92","37","000","Syntax error or access violation",SQL_ERROR},
+    {"SQL-92","3C","000","Duplicate cursor name",SQL_ERROR},
+    {"SQL-92","3F","000","Invalid schema name",SQL_ERROR},
+    {"SQL-92","40","001","Serialization failure",SQL_ERROR},
+    {"SQL-92","42","000","Syntax error or access violation",SQL_ERROR},
+    {"SQL-92","70","100","Operation aborted",SQL_ERROR},
+    {"SQL-92","IM","001","Driver does not support this function",SQL_ERROR},
+    {"SQL-92","IM","002","Data source name not found and no default driver
specified",SQL_ERROR},
+    {"SQL-92","IM","003","Specified driver could not be loaded",SQL_ERROR},
+    {"SQL-92","IM","004","Driver's SQLAllocEnv failed",SQL_ERROR},
+    {"SQL-92","IM","005","Driver's SQLAllocConnect failed",SQL_ERROR},
+    {"SQL-92","IM","006","Driver's SQLSetConnectOption failed",SQL_ERROR},
+    {"SQL-92","IM","007","No data source or driver specified; dialog
prohibited",SQL_ERROR},
+    {"SQL-92","IM","008","Dialog failed",SQL_ERROR},
+    {"SQL-92","IM","009","Unable to load translation DLL",SQL_ERROR},
+    {"SQL-92","IM","010","Data source name too long",SQL_ERROR},
+    {"SQL-92","IM","011","Driver name too long",SQL_ERROR},
+    {"SQL-92","IM","012","DRIVER keyword syntax error",SQL_ERROR},
+    {"SQL-92","IM","013","Trace file error",SQL_ERROR},
+    {"SQL-92","S0","001","Base table or view already exists",SQL_ERROR},
+    {"SQL-92","S0","002","Base table not found",SQL_ERROR},
+    {"SQL-92","S0","011","Index already exists",SQL_ERROR},
+    {"SQL-92","S0","012","Index not found",SQL_ERROR},
+    {"SQL-92","S0","021","Column already exists",SQL_ERROR},
+    {"SQL-92","S0","022","Column not found",SQL_ERROR},
+    {"SQL-92","S0","023","No default for column",SQL_ERROR},
+    {"SQL-92","S1","000","General error",SQL_ERROR},
+    {"SQL-92","S1","001","Memory allocation error",SQL_ERROR},
+    {"SQL-92","S1","002","Invalid column number",SQL_ERROR},
+    {"SQL-92","S1","003","Program type out of range",SQL_ERROR},
+    {"SQL-92","S1","004","SQL data type out of range",SQL_ERROR},
+    {"SQL-92","S1","008","Operation canceled",SQL_ERROR},
+    {"SQL-92","S1","009","Invalid argument value",SQL_ERROR},
+    {"SQL-92","S1","010","Function sequence error",SQL_ERROR},
+    {"SQL-92","S1","011","Operation invalid at this time",SQL_ERROR},
+    {"SQL-92","S1","012","Invalid transaction operation code specified",SQL_ERROR},
+    {"SQL-92","S1","015","No cursor name available",SQL_ERROR},
+    {"SQL-92","S1","090","Invalid string or buffer length",SQL_ERROR},
+    {"SQL-92","S1","091","Descriptor type out of range",SQL_ERROR},
+    {"SQL-92","S1","092","Option type out of range",SQL_ERROR},
+    {"SQL-92","S1","093","Inavlid parameter number",SQL_ERROR},
+    {"SQL-92","S1","094","Invalid scale value",SQL_ERROR},
+    {"SQL-92","S1","095","Function type out of range",SQL_ERROR},
+    {"SQL-92","S1","096","Information type out of range",SQL_ERROR},
+    {"SQL-92","S1","097","Column type out of range",SQL_ERROR},
+    {"SQL-92","S1","098","Scope type out of range",SQL_ERROR},
+    {"SQL-92","S1","099","Nullable type out of range",SQL_ERROR},
+    {"SQL-92","S1","100","Uniqueness option type out of range",SQL_ERROR},
+    {"SQL-92","S1","101","Accuracy option type out of range",SQL_ERROR},
+    {"SQL-92","S1","103","Direction option out of range",SQL_ERROR},
+    {"SQL-92","S1","104","Invalid precision value",SQL_ERROR},
+    {"SQL-92","S1","105","Invalid parameter type",SQL_ERROR},
+    {"SQL-92","S1","106","Fetch type out of range",SQL_ERROR},
+    {"SQL-92","S1","107","Row value out of range",SQL_ERROR},
+    {"SQL-92","S1","108","Concurrency option out of range",SQL_ERROR},
+    {"SQL-92","S1","109","Invalid cursor position",SQL_ERROR},
+    {"SQL-92","S1","110","Invalid driver completion",SQL_ERROR},
+    {"SQL-92","S1","111","Invalid bookmark value",SQL_ERROR},
+    {"SQL-92","S1","C00","Driver not capable",SQL_ERROR},
+    {"SQL-92","S1","T00","Timeout expired",SQL_ERROR}
+};
+
+MDIAGNOSTIC_STATE MDiagnosticStatesV3[]=
+{
+    {"ISO 9075","01","000","General warning",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","001","Cursor operation conflict",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","002","Disconnect error",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","003","NULL value eliminated in set
function",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","004","String data right-truncated",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","006","Privilege not revoked",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","007","Privilege not granted",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S00","Invalid connection string attribute",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S01","Error in row",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S02","Option value changed",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S06","Attempt to fetch before the result set returned the first
rowset",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S07","Fractional truncation",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S08","Error saving File DSN",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","01","S09","Invalid keyword",SQL_SUCCESS_WITH_INFO},
+    {"ISO 9075","07","001","Wrong number of parameters",SQL_ERROR},
+    {"ISO 9075","07","002","COUNT field incorrect",SQL_ERROR},
+    {"ISO 9075","07","005","Prepared statement not a cursor-specification",SQL_ERROR},
+    {"ISO 9075","07","006","Restricted data type attribute violation",SQL_ERROR},
+    {"ISO 9075","07","009","Invalid descriptor index",SQL_ERROR},
+    {"ISO 9075","07","S01","Invalid use of default parameter",SQL_ERROR},
+    {"ISO 9075","08","001","Client unable to establish connection",SQL_ERROR},
+    {"ISO 9075","08","002","Connection name in use",SQL_ERROR},
+    {"ISO 9075","08","003","Connection does not exist",SQL_ERROR},
+    {"ISO 9075","08","004","Server rejected the connection",SQL_ERROR},
+    {"ISO 9075","08","007","Connection failure during transaction",SQL_ERROR},
+    {"ISO 9075","08","S01","Communication link failure",SQL_ERROR},
+    {"ISO 9075","21","S01","Insert value list does not match column list",SQL_ERROR},
+    {"ISO 9075","21","S02","Degree of derived table does not match column
list",SQL_ERROR},
+    {"ISO 9075","22","001","String data right-truncated",SQL_ERROR},
+    {"ISO 9075","22","002","Indicator variable required but not supplied",SQL_ERROR},
+    {"ISO 9075","22","003","Numeric value out of range",SQL_ERROR},
+    {"ISO 9075","22","007","Invalid datetime format",SQL_ERROR},
+    {"ISO 9075","22","008","Datetime field overflow",SQL_ERROR},
+    {"ISO 9075","22","012","Division by zero",SQL_ERROR},
+    {"ISO 9075","22","015","Interval field overflow",SQL_ERROR},
+    {"ISO 9075","22","018","Invalid character value for cast specification",SQL_ERROR},
+    {"ISO 9075","22","019","Invalid escape character",SQL_ERROR},
+    {"ISO 9075","22","025","Invalid escape sequence",SQL_ERROR},
+    {"ISO 9075","22","026","String data length mismatch",SQL_ERROR},
+    {"ISO 9075","23","000","Integrity constraint violation",SQL_ERROR},
+    {"ISO 9075","24","000","Invalid cursor state",SQL_ERROR},
+    {"ISO 9075","25","000","Invalid transaction state",SQL_ERROR},
+    {"ISO 9075","25","S01","Transaction state",SQL_ERROR},
+    {"ISO 9075","25","S02","Transaction is still active",SQL_ERROR},
+    {"ISO 9075","25","S03","Transaction is rolled back",SQL_ERROR},
+    {"ISO 9075","28","000","Invalid authorization specification",SQL_ERROR},
+    {"ISO 9075","34","000","Invalid cursor name",SQL_ERROR},
+    {"ISO 9075","3C","000","Duplicate cursor name",SQL_ERROR},
+    {"ISO 9075","3D","000","Invalid catalog name",SQL_ERROR},
+    {"ISO 9075","3F","000","Invalid schema name",SQL_ERROR},
+    {"ISO 9075","40","001","Serialization failure",SQL_ERROR},
+    {"ISO 9075","40","002","Integrity constraint violation",SQL_ERROR},
+    {"ISO 9075","40","003","Statement completion unknown",SQL_ERROR},
+    {"ISO 9075","42","000","Syntax error or access violation",SQL_ERROR},
+    {"ISO 9075","42","S01","Base table or view already exists",SQL_ERROR},
+    {"ISO 9075","42","S02","Base table or view not found",SQL_ERROR},
+    {"ISO 9075","42","S11","Index already exists",SQL_ERROR},
+    {"ISO 9075","42","S12","Index not found",SQL_ERROR},
+    {"ISO 9075","42","S21","Column already exists",SQL_ERROR},
+    {"ISO 9075","42","S22","Column not found",SQL_ERROR},
+    {"ISO 9075","44","000","WITH CHECK OPTION violation",SQL_ERROR},
+    {"ISO 9075","HY","000","General error",SQL_ERROR},
+    {"ISO 9075","HY","001","Memory allocation error",SQL_ERROR},
+    {"ISO 9075","HY","003","Invalid application buffer type",SQL_ERROR},
+    {"ISO 9075","HY","004","Invalid SQL data type",SQL_ERROR},
+    {"ISO 9075","HY","007","Associated statement is not prepared",SQL_ERROR},
+    {"ISO 9075","HY","008","Operation canceled",SQL_ERROR},
+    {"ISO 9075","HY","009","Invalid use of null pointer",SQL_ERROR},
+    {"ISO 9075","HY","010","Function sequence error",SQL_ERROR},
+    {"ISO 9075","HY","011","Attribute cannot be set now",SQL_ERROR},
+    {"ISO 9075","HY","012","Invalid transaction operation code",SQL_ERROR},
+    {"ISO 9075","HY","013","Memory management error",SQL_ERROR},
+    {"ISO 9075","HY","014","Limit on the number of handles exceeded",SQL_ERROR},
+    {"ISO 9075","HY","015","No cursor name available",SQL_ERROR},
+    {"ISO 9075","HY","016","Cannot modify an implementation row descriptor",SQL_ERROR},
+    {"ISO 9075","HY","017","Invalid use of an automatically allocated descriptor
handle",SQL_ERROR},
+    {"ISO 9075","HY","018","Server declined cancel request",SQL_ERROR},
+    {"ISO 9075","HY","019","Non-character and non-binary data sent in pieces",SQL_ERROR},
+    {"ISO 9075","HY","020","Attempt to concatenate a null value",SQL_ERROR},
+    {"ISO 9075","HY","021","Inconsistent descriptor information",SQL_ERROR},
+    {"ISO 9075","HY","024","Invalid attribute value",SQL_ERROR},
+    {"ISO 9075","HY","090","Invalid string or buffer length",SQL_ERROR},
+    {"ISO 9075","HY","091","Invalid descriptor field identifier",SQL_ERROR},
+    {"ISO 9075","HY","092","Invalid attribute/option identifier",SQL_ERROR},
+    {"ISO 9075","HY","095","Function type out of range",SQL_ERROR},
+    {"ISO 9075","HY","096","Invalid information type",SQL_ERROR},
+    {"ISO 9075","HY","097","Column type out of range",SQL_ERROR},
+    {"ISO 9075","HY","098","Scope type out of range",SQL_ERROR},
+    {"ISO 9075","HY","099","Nullable type out of range",SQL_ERROR},
+    {"ISO 9075","HY","100","Uniqueness option type out of range",SQL_ERROR},
+    {"ISO 9075","HY","101","Accuracy option type out of range",SQL_ERROR},
+    {"ISO 9075","HY","103","Invalid retrieval code",SQL_ERROR},
+    {"ISO 9075","HY","104","Invalid precision or scale value",SQL_ERROR},
+    {"ISO 9075","HY","105","Invalid parameter type",SQL_ERROR},
+    {"ISO 9075","HY","106","Fetch type out of range",SQL_ERROR},
+    {"ISO 9075","HY","107","Row value out of range",SQL_ERROR},
+    {"ISO 9075","HY","109","Invalid cursor position",SQL_ERROR},
+    {"ISO 9075","HY","110","Invalid driver completion",SQL_ERROR},
+    {"ISO 9075","HY","111","Invalid bookmark value",SQL_ERROR},
+    {"ISO 9075","HY","C00","Optional feature not implemented",SQL_ERROR},
+    {"ISO 9075","HY","T00","Timeout expired",SQL_ERROR},
+    {"ISO 9075","HY","T01","Connection timeout expired",SQL_ERROR},
+    {"ODBC 3.0","IM","001","Driver does not support this function",SQL_ERROR},
+    {"ODBC 3.0","IM","002","Data source name not found and no default driver
specified",SQL_ERROR},
+    {"ODBC 3.0","IM","003","Specified driver could not be loaded",SQL_ERROR},
+    {"ODBC 3.0","IM","004","Driver's SQLAllocHandle on SQL_HANDLE_ENV failed",SQL_ERROR},
+    {"ODBC 3.0","IM","005","Driver's SQLAllocHandle on SQL_HANDLE_DBC failed",SQL_ERROR},
+    {"ODBC 3.0","IM","006","Driver's SQLSetConnectAttr failed",SQL_ERROR},
+    {"ODBC 3.0","IM","007","No data source or driver specified; dialog
prohibited",SQL_ERROR},
+    {"ODBC 3.0","IM","008","Dialog failed",SQL_ERROR},
+    {"ODBC 3.0","IM","009","Unable to load translation DLL",SQL_ERROR},
+    {"ODBC 3.0","IM","010","Data source name too long",SQL_ERROR},
+    {"ODBC 3.0","IM","011","Driver name too long",SQL_ERROR},
+    {"ODBC 3.0","IM","012","DRIVER keyword syntax error",SQL_ERROR},
+    {"ODBC 3.0","IM","013","Trace file error",SQL_ERROR},
+    {"ODBC 3.0","IM","014","Invalid name of File DSN",SQL_ERROR},
+    {"ODBC 3.0","IM","015","Corrupt file data source",SQL_ERROR}
+};
+
+int MDiagnosticStates3To2[][] =
+{
+DIA_01000
+DIA_01001
+DIA_01002
+DIA_01003
+DIA_01004
+DIA_01006
+DIA_01007
+DIA_01S00
+DIA_01S01
+DIA_01S02
+DIA_01S06
+DIA_01S07
+DIA_01S08
+DIA_01S09
+DIA_07001
+DIA_07002
+DIA_07005
+DIA_07006
+DIA_07009
+DIA_07S01
+DIA_08001
+DIA_08002
+DIA_08003
+DIA_08004
+DIA_08007
+DIA_08S01
+DIA_21S01
+DIA_21S02
+DIA_22001
+DIA_22002
+DIA_22003
+DIA_22007
+DIA_22008
+DIA_22012
+DIA_22015
+DIA_22018
+DIA_22019
+DIA_22025
+DIA_22026
+DIA_23000
+DIA_24000
+DIA_25000
+DIA_25S01
+DIA_25S02
+DIA_25S03
+DIA_28000
+DIA_34000
+DIA_3C000
+DIA_3D000
+DIA_3F000
+DIA_40001
+DIA_40002
+DIA_40003
+DIA_42000
+DIA_42S01
+DIA_42S02
+DIA_42S11
+DIA_42S12
+DIA_42S21
+DIA_42S22
+DIA_44000
+DIA_HY000
+DIA_HY001
+DIA_HY003
+DIA_HY004
+DIA_HY007
+DIA_HY008
+DIA_HY009
+DIA_HY010
+DIA_HY011
+DIA_HY012
+DIA_HY013
+DIA_HY014
+DIA_HY015
+DIA_HY016
+DIA_HY017
+DIA_HY018
+DIA_HY019
+DIA_HY020
+DIA_HY021
+DIA_HY024
+DIA_HY090
+DIA_HY091
+DIA_HY092
+DIA_HY095
+DIA_HY096
+DIA_HY097
+DIA_HY098
+DIA_HY099
+DIA_HY100
+DIA_HY101
+DIA_HY103
+DIA_HY104
+DIA_HY105
+DIA_HY106
+DIA_HY107
+DIA_HY109
+DIA_HY110
+DIA_HY111
+DIA_HYC00
+DIA_HYT00
+DIA_HYT01
+DIA_IM001
+DIA_IM002
+DIA_IM003
+DIA_IM004
+DIA_IM005
+DIA_IM006
+DIA_IM007
+DIA_IM008
+DIA_IM009
+DIA_IM010
+DIA_IM011
+DIA_IM012
+DIA_IM013
+DIA_IM014
+DIA_IM015
+};
+
+    01S03 01001   
+    01S04 01001   
+    22003 HY019   
+    22008 22007   
+    22005 22018   
+    24000 07005   
+    37000 42000   
+    70100 HY018   
+    S0001 42S01   
+    S0002 42S02   
+    S0011 42S11   
+    S0012 42S12   
+    S0021 42S21   
+    S0022 42S22   
+    S0023 42S23   
+    S1000 HY000   
+    S1001 HY001   
+
+    S1002 07009 ODBC 2.x SQLSTATE S1002 is mapped to ODBC 3.x SQLSTATE 07009 if the
underlying function is SQLBindCol, SQLColAttribute, SQLExtendedFetch, SQLFetch,
SQLFetchScroll, or SQLGetData. 
+    S1003 HY003   
+    S1004 HY004   
+    S1008 HY008   
+    S1009 HY009 Returned for an invalid use of a null pointer. 
+    S1009 HY024 Returned for an invalid attribute value. 
+    S1009 HY092 Returned for updating or deleting data by a call to SQLSetPos, or adding,
updating, or deleting data by a call to SQLBulkOperations, when the concurrency is
read-only. 
+    S1010 HY007
+    HY010 SQLSTATE S1010 is mapped to SQLSTATE HY007 when SQLDescribeCol is called prior
to calling SQLPrepare, SQLExecDirect, or a catalog function for the StatementHandle.
Otherwise, SQLSTATE S1010 is mapped to SQLSTATE HY010. 
+    S1011 HY011   
+    S1012 HY012   
+    S1090 HY090   
+    S1091 HY091   
+    S1092 HY092   
+    S1093 07009 ODBC 3.x SQLSTATE 07009 is mapped to ODBC 2.x SQLSTATE S1093 if the
underlying function is SQLBindParameter or SQLDescribeParam. 
+    S1096 HY096   
+    S1097 HY097   
+    S1098 HY098   
+    S1099 HY099   
+    S1100 HY100   
+    S1101 HY101   
+    S1103 HY103   
+    S1104 HY104   
+    S1105 HY105   
+    S1106 HY106   
+    S1107 HY107   
+    S1108 HY108   
+    S1109 HY109   
+    S1110 HY110   
+    S1111 HY111   
+    S1C00 HYC00   
+    S1T00 HYT00 
+
 /*!
     \brief  Allocates a new diagnostics structure.
 

Modified: trunk/SDK/MYSQLPlus/Library/MDiagnostic.h
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MDiagnostic.h	2006-10-06 16:49:50 UTC (rev 576)
+++ trunk/SDK/MYSQLPlus/Library/MDiagnostic.h	2006-10-06 18:52:43 UTC (rev 577)
@@ -32,29 +32,6 @@
 
 /*!
     \internal
-    \brief  This is used to generate a static 'table' of all state
-            information and corresponds to numeric state values (MDiagnostic::DIA).
-
-            The static 'table' of state information generated using this
-            is found in \sa MDiagnostic.cpp as MDiagnostic_pStates. The state 
-            information is then referenced/indexed using DIA.
-
-    \sa     DIA
-*/
-typedef struct tMDIAGNOSTIC_STATE
-{
-  QString   stringClassOrigin;  /*!< SQL_DIAG_CLASS_ORIGIN  */
-  QString   stringSQLState;     /*!< SQL_DIAG_SQLSTATE      */
-  QString   stringClass;
-  QString   stringText;
-  SQLRETURN nReturnCode;        /*!< SQLRETURN              */
-
-} MDIAGNOSTIC_STATE;
-
-extern MDIAGNOSTIC_STATE MDiagnostic_pStates[];
-
-/*!
-    \internal
     \brief  This is the main handle for diagnostic information.
     
             This contains the diagnostic header fields and 0 - n 
@@ -81,217 +58,140 @@
 
 public:
     /*!
-        \brief These are the numeric constants used to indicated SQL states.
+        \brief  Diagnostic states.
 
-        ODBC Error Codes
+                These roughly match the ODBC v3 SQL States. These differ from the ODBC v3
SQL States
+                in some areas to allow for accurate mapping to ODBC v2 SQL States.
Basically; some
+                ODBC v2 SQL States do not exist in ODBC v3 so we have extra states here
to account
+                for them.
 
-        SQLGetDiagRec or SQLGetDiagField returns SQLSTATE values as defined by 
-        X/Open Data Management: Structured Query Language (SQL), Version 2 
-        (March 1995). SQLSTATE values are strings that contain five characters. 
-        The following lists SQLSTATE values that a driver can return for 
-        SQLGetDiagRec.
+                These can be used to index into \sa MDiagnosticStatesXRef where we can
get our v2
+                or v3 state details such as SQL State; origin, class, and description.
 
-        The character string value returned for an SQLSTATE consists of a 
-        two-character class value followed by a three-character subclass value. 
-        A class value of "01" indicates a warning and is accompanied by a return 
-        code of SQL_SUCCESS_WITH_INFO. Class values other than "01," except 
-        for the class "IM," indicate an error and are accompanied by a return 
-        value of SQL_ERROR. The class "IM" is specific to warnings and errors 
-        that derive from the implementation of ODBC itself. The subclass value 
-        "000" in any class indicates that there is no subclass for that SQLSTATE. 
-        The assignment of class and subclass values is defined by SQL-92.
-
-        \sa MDiagnostic_pStates 
-            MDIAGNOSTIC_STATE
+        \sa     MDiagnosticStatesXRef
     */    
-    enum DIA
+    enum STATE
     {
-        DIA_01000=0,/* General warning                                                 
*/
-        DIA_01001,  /* Cursor operation conflict                                       
*/
-        DIA_01002,  /* Disconnect error                                                
*/
-        DIA_01003,  /* NULL value eliminated in set function                           
*/
-        DIA_01004,  /* String data, right-truncated                                    
*/
-        DIA_01006,  /* Privilege not revoked                                           
*/
-        DIA_01007,  /* Privilege not granted                                           
*/
-        DIA_01S00,  /* Invalid connection string attribute                             
*/
-        DIA_01S01,  /* Error in row                                                    
*/
-        DIA_01S02,  /* Option value changed                                            
*/
-        DIA_01S06,  /* Attempt to fetch before the result set returned the first rowset
*/
-        DIA_01S07,  /* Fractional truncation                                           
*/
-        DIA_01S08,  /* Error saving File DSN                                           
*/
-        DIA_01S09,  /* Invalid keyword                                                 
*/
-        DIA_07001,  /* Wrong number of parameters                                      
*/
-        DIA_07002,  /* COUNT field incorrect                                           
*/
-        DIA_07005,  /* Prepared statement not a cursor-specification                   
*/
-        DIA_07006,  /* Restricted data type attribute violation                        
*/
-        DIA_07009,  /* Invalid descriptor index                                        
*/
-        DIA_07S01,  /* Invalid use of default parameter                                
*/
-        DIA_08001,  /* Client unable to establish connection                           
*/
-        DIA_08002,  /* Connection name in use                                          
*/
-        DIA_08003,  /* Connection does not exist                                       
*/
-        DIA_08004,  /* Server rejected the connection                                  
*/
-        DIA_08007,  /* Connection failure during transaction                           
*/
-        DIA_08S01,  /* Communication link failure                                      
*/
-        DIA_21S01,  /* Insert value list does not match column list                    
*/
-        DIA_21S02,  /* Degree of derived table does not match column list              
*/
-        DIA_22001,  /* String data, right-truncated                                    
*/
-        DIA_22002,  /* Indicator variable required but not supplied                    
*/
-        DIA_22003,  /* Numeric value out of range                                      
*/
-        DIA_22007,  /* Invalid datetime format                                         
*/
-        DIA_22008,  /* Datetime field overflow                                         
*/
-        DIA_22012,  /* Division by zero                                                
*/
-        DIA_22015,  /* Interval field overflow                                         
*/
-        DIA_22018,  /* Invalid character value for cast specification                  
*/
-        DIA_22019,  /* Invalid escape character                                        
*/
-        DIA_22025,  /* Invalid escape sequence                                         
*/
-        DIA_22026,  /* String data, length mismatch                                    
*/
-        DIA_23000,  /* Integrity constraint violation                                  
*/
-        DIA_24000,  /* Invalid cursor state                                            
*/
-        DIA_25000,  /* Invalid transaction state                                       
*/
-        DIA_25S01,  /* Transaction state                                               
*/
-        DIA_25S02,  /* Transaction is still active                                     
*/
-        DIA_25S03,  /* Transaction is rolled back                                      
*/
-        DIA_28000,  /* Invalid authorization specification                             
*/
-        DIA_34000,  /* Invalid cursor name                                             
*/
-        DIA_3C000,  /* Duplicate cursor name                                           
*/
-        DIA_3D000,  /* Invalid catalog name                                            
*/
-        DIA_3F000,  /* Invalid schema name                                             
*/
-        DIA_40001,  /* Serialization failure                                           
*/
-        DIA_40002,  /* Integrity constraint violation                                  
*/
-        DIA_40003,  /* Statement completion unknown                                    
*/
-        DIA_42000,  /* Syntax error or access violation                                
*/
-        DIA_42S01,  /* Base table or view already exists                               
*/
-        DIA_42S02,  /* Base table or view not found                                    
*/
-        DIA_42S11,  /* Index already exists                                            
*/
-        DIA_42S12,  /* Index not found                                                 
*/
-        DIA_42S21,  /* Column already exists                                           
*/
-        DIA_42S22,  /* Column not found                                                
*/
-        DIA_44000,  /* WITH CHECK OPTION violation                                     
*/
-        DIA_HY000,  /* General error                                                   
*/
-        DIA_HY001,  /* Memory allocation error                                         
*/
-        DIA_HY003,  /* Invalid application buffer type                                 
*/
-        DIA_HY004,  /* Invalid SQL data type                                           
*/
-        DIA_HY007,  /* Associated statement is not prepared                            
*/
-        DIA_HY008,  /* Operation canceled                                              
*/
-        DIA_HY009,  /* Invalid use of null pointer                                     
*/
-        DIA_HY010,  /* Function sequence error                                         
*/
-        DIA_HY011,  /* Attribute cannot be set now                                     
*/
-        DIA_HY012,  /* Invalid transaction operation code                              
*/
-        DIA_HY013,  /* Memory management error                                         
*/
-        DIA_HY014,  /* Limit on the number of handles exceeded                         
*/
-        DIA_HY015,  /* No cursor name available                                        
*/
-        DIA_HY016,  /* Cannot modify an implementation row descriptor                  
*/
-        DIA_HY017,  /* Invalid use of an automatically allocated descriptor handle     
*/
-        DIA_HY018,  /* Server declined cancel request                                  
*/
-        DIA_HY019,  /* Non-character and non-binary data sent in pieces                
*/
-        DIA_HY020,  /* Attempt to concatenate a null value                             
*/
-        DIA_HY021,  /* Inconsistent descriptor information                             
*/
-        DIA_HY024,  /* Invalid attribute value                                         
*/
-        DIA_HY090,  /* Invalid string or buffer length                                 
*/
-        DIA_HY091,  /* Invalid descriptor field identifier                             
*/
-        DIA_HY092,  /* Invalid attribute/option identifier                             
*/
-        DIA_HY095,  /* Function type out of range                                      
*/
-        DIA_HY096,  /* Invalid information type                                        
*/
-        DIA_HY097,  /* Column type out of range                                        
*/
-        DIA_HY098,  /* Scope type out of range                                         
*/
-        DIA_HY099,  /* Nullable type out of range                                      
*/
-        DIA_HY100,  /* Uniqueness option type out of range                             
*/
-        DIA_HY101,  /* Accuracy option type out of range                               
*/
-        DIA_HY103,  /* Invalid retrieval code                                          
*/
-        DIA_HY104,  /* Invalid precision or scale value                                
*/
-        DIA_HY105,  /* Invalid parameter type                                          
*/
-        DIA_HY106,  /* Fetch type out of range                                         
*/
-        DIA_HY107,  /* Row value out of range                                          
*/
-        DIA_HY109,  /* Invalid cursor position                                         
*/
-        DIA_HY110,  /* Invalid driver completion                                       
*/
-        DIA_HY111,  /* Invalid bookmark value                                          
*/
-        DIA_HYC00,  /* Optional feature not implemented                                
*/
-        DIA_HYT00,  /* Timeout expired                                                 
*/
-        DIA_HYT01,  /* Connection timeout expired                                      
*/
-        DIA_IM001,  /* Driver does not support this function                           
*/
-        DIA_IM002,  /* Data source name not found and no default driver specified      
*/
-        DIA_IM003,  /* Specified driver could not be loaded                            
*/
-        DIA_IM004,  /* Driver's SQLAllocHandle on SQL_HANDLE_ENV failed                
*/
-        DIA_IM005,  /* Driver's SQLAllocHandle on SQL_HANDLE_DBC failed                
*/
-        DIA_IM006,  /* Driver's SQLSetConnectAttr failed                               
*/
-        DIA_IM007,  /* No data source or driver specified; dialog prohibited           
*/
-        DIA_IM008,  /* Dialog failed                                                   
*/
-        DIA_IM009,  /* Unable to load translation DLL                                  
*/
-        DIA_IM010,  /* Data source name too long                                       
*/
-        DIA_IM011,  /* Driver name too long                                            
*/
-        DIA_IM012,  /* DRIVER keyword syntax error                                     
*/
-        DIA_IM013,  /* Trace file error                                                
*/
-        DIA_IM014,  /* Invalid name of File DSN                                        
*/
-        DIA_IM015,  /* Corrupt file data source                                        
*/
-        DIA_MAX
+        STATE_01000=0,/* General warning                                                 
*/
+        STATE_01001,  /* Cursor operation conflict                                       
*/
+        STATE_01002,  /* Disconnect error                                                
*/
+        STATE_01003,  /* NULL value eliminated in set function                           
*/
+        STATE_01004,  /* String data, right-truncated                                    
*/
+        STATE_01006,  /* Privilege not revoked                                           
*/
+        STATE_01007,  /* Privilege not granted                                           
*/
+        STATE_01S00,  /* Invalid connection string attribute                             
*/
+        STATE_01S01,  /* Error in row                                                    
*/
+        STATE_01S02,  /* Option value changed                                            
*/
+        STATE_01S06,  /* Attempt to fetch before the result set returned the first rowset
*/
+        STATE_01S07,  /* Fractional truncation                                           
*/
+        STATE_01S08,  /* Error saving File DSN                                           
*/
+        STATE_01S09,  /* Invalid keyword                                                 
*/
+        STATE_07001,  /* Wrong number of parameters                                      
*/
+        STATE_07002,  /* COUNT field incorrect                                           
*/
+        STATE_07005,  /* Prepared statement not a cursor-specification                   
*/
+        STATE_07006,  /* Restricted data type attribute violation                        
*/
+        STATE_07009,  /* Invalid descriptor index                                        
*/
+        STATE_07S01,  /* Invalid use of default parameter                                
*/
+        STATE_08001,  /* Client unable to establish connection                           
*/
+        STATE_08002,  /* Connection name in use                                          
*/
+        STATE_08003,  /* Connection does not exist                                       
*/
+        STATE_08004,  /* Server rejected the connection                                  
*/
+        STATE_08007,  /* Connection failure during transaction                           
*/
+        STATE_08S01,  /* Communication link failure                                      
*/
+        STATE_21S01,  /* Insert value list does not match column list                    
*/
+        STATE_21S02,  /* Degree of derived table does not match column list              
*/
+        STATE_22001,  /* String data, right-truncated                                    
*/
+        STATE_22002,  /* Indicator variable required but not supplied                    
*/
+        STATE_22003,  /* Numeric value out of range                                      
*/
+        STATE_22007,  /* Invalid datetime format                                         
*/
+        STATE_22008,  /* Datetime field overflow                                         
*/
+        STATE_22012,  /* Division by zero                                                
*/
+        STATE_22015,  /* Interval field overflow                                         
*/
+        STATE_22018,  /* Invalid character value for cast specification                  
*/
+        STATE_22019,  /* Invalid escape character                                        
*/
+        STATE_22025,  /* Invalid escape sequence                                         
*/
+        STATE_22026,  /* String data, length mismatch                                    
*/
+        STATE_23000,  /* Integrity constraint violation                                  
*/
+        STATE_24000,  /* Invalid cursor state                                            
*/
+        STATE_25000,  /* Invalid transaction state                                       
*/
+        STATE_25S01,  /* Transaction state                                               
*/
+        STATE_25S02,  /* Transaction is still active                                     
*/
+        STATE_25S03,  /* Transaction is rolled back                                      
*/
+        STATE_28000,  /* Invalid authorization specification                             
*/
+        STATE_34000,  /* Invalid cursor name                                             
*/
+        STATE_3C000,  /* Duplicate cursor name                                           
*/
+        STATE_3D000,  /* Invalid catalog name                                            
*/
+        STATE_3F000,  /* Invalid schema name                                             
*/
+        STATE_40001,  /* Serialization failure                                           
*/
+        STATE_40002,  /* Integrity constraint violation                                  
*/
+        STATE_40003,  /* Statement completion unknown                                    
*/
+        STATE_42000,  /* Syntax error or access violation                                
*/
+        STATE_42S01,  /* Base table or view already exists                               
*/
+        STATE_42S02,  /* Base table or view not found                                    
*/
+        STATE_42S11,  /* Index already exists                                            
*/
+        STATE_42S12,  /* Index not found                                                 
*/
+        STATE_42S21,  /* Column already exists                                           
*/
+        STATE_42S22,  /* Column not found                                                
*/
+        STATE_44000,  /* WITH CHECK OPTION violation                                     
*/
+        STATE_HY000,  /* General error                                                   
*/
+        STATE_HY001,  /* Memory allocation error                                         
*/
+        STATE_HY003,  /* Invalid application buffer type                                 
*/
+        STATE_HY004,  /* Invalid SQL data type                                           
*/
+        STATE_HY007,  /* Associated statement is not prepared                            
*/
+        STATE_HY008,  /* Operation canceled                                              
*/
+        STATE_HY009,  /* Invalid use of null pointer                                     
*/
+        STATE_HY010,  /* Function sequence error                                         
*/
+        STATE_HY011,  /* Attribute cannot be set now                                     
*/
+        STATE_HY012,  /* Invalid transaction operation code                              
*/
+        STATE_HY013,  /* Memory management error                                         
*/
+        STATE_HY014,  /* Limit on the number of handles exceeded                         
*/
+        STATE_HY015,  /* No cursor name available                                        
*/
+        STATE_HY016,  /* Cannot modify an implementation row descriptor                  
*/
+        STATE_HY017,  /* Invalid use of an automatically allocated descriptor handle     
*/
+        STATE_HY018,  /* Server declined cancel request                                  
*/
+        STATE_HY019,  /* Non-character and non-binary data sent in pieces                
*/
+        STATE_HY020,  /* Attempt to concatenate a null value                             
*/
+        STATE_HY021,  /* Inconsistent descriptor information                             
*/
+        STATE_HY024,  /* Invalid attribute value                                         
*/
+        STATE_HY090,  /* Invalid string or buffer length                                 
*/
+        STATE_HY091,  /* Invalid descriptor field identifier                             
*/
+        STATE_HY092,  /* Invalid attribute/option identifier                             
*/
+        STATE_HY095,  /* Function type out of range                                      
*/
+        STATE_HY096,  /* Invalid information type                                        
*/
+        STATE_HY097,  /* Column type out of range                                        
*/
+        STATE_HY098,  /* Scope type out of range                                         
*/
+        STATE_HY099,  /* Nullable type out of range                                      
*/
+        STATE_HY100,  /* Uniqueness option type out of range                             
*/
+        STATE_HY101,  /* Accuracy option type out of range                               
*/
+        STATE_HY103,  /* Invalid retrieval code                                          
*/
+        STATE_HY104,  /* Invalid precision or scale value                                
*/
+        STATE_HY105,  /* Invalid parameter type                                          
*/
+        STATE_HY106,  /* Fetch type out of range                                         
*/
+        STATE_HY107,  /* Row value out of range                                          
*/
+        STATE_HY109,  /* Invalid cursor position                                         
*/
+        STATE_HY110,  /* Invalid driver completion                                       
*/
+        STATE_HY111,  /* Invalid bookmark value                                          
*/
+        STATE_HYC00,  /* Optional feature not implemented                                
*/
+        STATE_HYT00,  /* Timeout expired                                                 
*/
+        STATE_HYT01,  /* Connection timeout expired                                      
*/
+        STATE_IM001,  /* Driver does not support this function                           
*/
+        STATE_IM002,  /* Data source name not found and no default driver specified      
*/
+        STATE_IM003,  /* Specified driver could not be loaded                            
*/
+        STATE_IM004,  /* Driver's SQLAllocHandle on SQL_HANDLE_ENV failed                
*/
+        STATE_IM005,  /* Driver's SQLAllocHandle on SQL_HANDLE_DBC failed                
*/
+        STATE_IM006,  /* Driver's SQLSetConnectAttr failed                               
*/
+        STATE_IM007,  /* No data source or driver specified; dialog prohibited           
*/
+        STATE_IM008,  /* Dialog failed                                                   
*/
+        STATE_IM009,  /* Unable to load translation DLL                                  
*/
+        STATE_IM010,  /* Data source name too long                                       
*/
+        STATE_IM011,  /* Driver name too long                                            
*/
+        STATE_IM012,  /* DRIVER keyword syntax error                                     
*/
+        STATE_IM013,  /* Trace file error                                                
*/
+        STATE_IM014,  /* Invalid name of File DSN                                        
*/
+        STATE_IM015,  /* Corrupt file data source                                        
*/
+        STATE_MAX
     };
 
-
-
-
-01S03 01001   
-01S04 01001   
-22003 HY019   
-22008 22007   
-22005 22018   
-24000 07005   
-37000 42000   
-70100 HY018   
-S0001 42S01   
-S0002 42S02   
-S0011 42S11   
-S0012 42S12   
-S0021 42S21   
-S0022 42S22   
-S0023 42S23   
-S1000 HY000   
-S1001 HY001   
-S1002 07009 ODBC 2.x SQLSTATE S1002 is mapped to ODBC 3.x SQLSTATE 07009 if the
underlying function is SQLBindCol, SQLColAttribute, SQLExtendedFetch, SQLFetch,
SQLFetchScroll, or SQLGetData. 
-S1003 HY003   
-S1004 HY004   
-S1008 HY008   
-S1009 HY009 Returned for an invalid use of a null pointer. 
-S1009 HY024 Returned for an invalid attribute value. 
-S1009 HY092 Returned for updating or deleting data by a call to SQLSetPos, or adding,
updating, or deleting data by a call to SQLBulkOperations, when the concurrency is
read-only. 
-S1010 HY007
-HY010 SQLSTATE S1010 is mapped to SQLSTATE HY007 when SQLDescribeCol is called prior to
calling SQLPrepare, SQLExecDirect, or a catalog function for the StatementHandle.
Otherwise, SQLSTATE S1010 is mapped to SQLSTATE HY010. 
-S1011 HY011   
-S1012 HY012   
-S1090 HY090   
-S1091 HY091   
-S1092 HY092   
-S1093 07009 ODBC 3.x SQLSTATE 07009 is mapped to ODBC 2.x SQLSTATE S1093 if the
underlying function is SQLBindParameter or SQLDescribeParam. 
-S1096 HY096   
-S1097 HY097   
-S1098 HY098   
-S1099 HY099   
-S1100 HY100   
-S1101 HY101   
-S1103 HY103   
-S1104 HY104   
-S1105 HY105   
-S1106 HY106   
-S1107 HY107   
-S1108 HY108   
-S1109 HY109   
-S1110 HY110   
-S1111 HY111   
-S1C00 HYC00   
-S1T00 HYT00 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
     MDiagnostic( QObject *pObjectParent = NULL );
     ~MDiagnostic();
 
@@ -304,8 +204,8 @@
     QStringList getDiagnostics();
 
     /* doers */
-    SQLRETURN   doAppend( DIA nState, SQLINTEGER nNative = 0, const QString
&stringMessage = QString::null );
-    SQLRETURN   doAppend( DIA nState, SQLINTEGER nNative, const QString
&stringMessage, SQLINTEGER nRowNumber, SQLINTEGER nColumnNumber );
+    SQLRETURN   doAppend( STATE nState, SQLINTEGER nNative = 0, const QString
&stringMessage = QString::null );
+    SQLRETURN   doAppend( STATE nState, SQLINTEGER nNative, const QString
&stringMessage, SQLINTEGER nRowNumber, SQLINTEGER nColumnNumber );
     void        doClear();
 
 protected:
@@ -358,8 +258,6 @@
     /* these values are copied by new records */
     QString   stringConnectionName;     /*!< This is dbc->server.                  
                                      */
     QString   stringServerName;         /*!< This is dbc->dsn. Same as
SQL_DATA_SOURCE_NAME in SQLGetInfo().              */
-
-
 };
 
 

Modified: trunk/SDK/MYSQLPlus/Library/MInternal.h
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MInternal.h	2006-10-06 16:49:50 UTC (rev 576)
+++ trunk/SDK/MYSQLPlus/Library/MInternal.h	2006-10-06 18:52:43 UTC (rev 577)
@@ -72,3 +72,314 @@
 
 #endif
 
+/*!
+    \brief  ODBC v2 SQL STATES
+
+            This enumerates values in MDiagnosticStatesV2. These make our xref table
easier to
+            understand.
+
+    \note
+            This must be in sync with MDiagnosticStatesV2!
+
+    \sa     MDiagnosticStatesV2
+*/
+enum MDIAGNOSTIC_STATE2
+{
+    MDIAGNOSTIC_STATE2_01000 = 0,
+    MDIAGNOSTIC_STATE2_01002,
+    MDIAGNOSTIC_STATE2_01003,
+    MDIAGNOSTIC_STATE2_01004,
+    MDIAGNOSTIC_STATE2_01006,
+    MDIAGNOSTIC_STATE2_01S00,
+    MDIAGNOSTIC_STATE2_01S01,
+    MDIAGNOSTIC_STATE2_01S02,
+    MDIAGNOSTIC_STATE2_01S03,
+    MDIAGNOSTIC_STATE2_01S04,
+    MDIAGNOSTIC_STATE2_07001,
+    MDIAGNOSTIC_STATE2_07006,
+    MDIAGNOSTIC_STATE2_08001,
+    MDIAGNOSTIC_STATE2_08002,
+    MDIAGNOSTIC_STATE2_08003,
+    MDIAGNOSTIC_STATE2_08004,
+    MDIAGNOSTIC_STATE2_08007,
+    MDIAGNOSTIC_STATE2_08S01,
+    MDIAGNOSTIC_STATE2_21S01,
+    MDIAGNOSTIC_STATE2_21S02,
+    MDIAGNOSTIC_STATE2_22001,
+    MDIAGNOSTIC_STATE2_22003,
+    MDIAGNOSTIC_STATE2_22005,
+    MDIAGNOSTIC_STATE2_22008,
+    MDIAGNOSTIC_STATE2_22012,
+    MDIAGNOSTIC_STATE2_22026,
+    MDIAGNOSTIC_STATE2_23000,
+    MDIAGNOSTIC_STATE2_24000,
+    MDIAGNOSTIC_STATE2_25000,
+    MDIAGNOSTIC_STATE2_28000,
+    MDIAGNOSTIC_STATE2_34000,
+    MDIAGNOSTIC_STATE2_37000,
+    MDIAGNOSTIC_STATE2_3C000,
+    MDIAGNOSTIC_STATE2_3F000,
+    MDIAGNOSTIC_STATE2_40001,
+    MDIAGNOSTIC_STATE2_42000,
+    MDIAGNOSTIC_STATE2_70100,
+    MDIAGNOSTIC_STATE2_IM001,
+    MDIAGNOSTIC_STATE2_IM002,
+    MDIAGNOSTIC_STATE2_IM003,
+    MDIAGNOSTIC_STATE2_IM004,
+    MDIAGNOSTIC_STATE2_IM005,
+    MDIAGNOSTIC_STATE2_IM006,
+    MDIAGNOSTIC_STATE2_IM007,
+    MDIAGNOSTIC_STATE2_IM008,
+    MDIAGNOSTIC_STATE2_IM009,
+    MDIAGNOSTIC_STATE2_IM010,
+    MDIAGNOSTIC_STATE2_IM011,
+    MDIAGNOSTIC_STATE2_IM012,
+    MDIAGNOSTIC_STATE2_IM013,
+    MDIAGNOSTIC_STATE2_S0001,
+    MDIAGNOSTIC_STATE2_S0002,
+    MDIAGNOSTIC_STATE2_S0011,
+    MDIAGNOSTIC_STATE2_S0012,
+    MDIAGNOSTIC_STATE2_S0021,
+    MDIAGNOSTIC_STATE2_S0022,
+    MDIAGNOSTIC_STATE2_S0023,
+    MDIAGNOSTIC_STATE2_S1000,
+    MDIAGNOSTIC_STATE2_S1001,
+    MDIAGNOSTIC_STATE2_S1002,
+    MDIAGNOSTIC_STATE2_S1003,
+    MDIAGNOSTIC_STATE2_S1004,
+    MDIAGNOSTIC_STATE2_S1008,
+    MDIAGNOSTIC_STATE2_S1009,
+    MDIAGNOSTIC_STATE2_S1010,
+    MDIAGNOSTIC_STATE2_S1011,
+    MDIAGNOSTIC_STATE2_S1012,
+    MDIAGNOSTIC_STATE2_S1015,
+    MDIAGNOSTIC_STATE2_S1090,
+    MDIAGNOSTIC_STATE2_S1091,
+    MDIAGNOSTIC_STATE2_S1092,
+    MDIAGNOSTIC_STATE2_S1093,
+    MDIAGNOSTIC_STATE2_S1094,
+    MDIAGNOSTIC_STATE2_S1095,
+    MDIAGNOSTIC_STATE2_S1096,
+    MDIAGNOSTIC_STATE2_S1097,
+    MDIAGNOSTIC_STATE2_S1098,
+    MDIAGNOSTIC_STATE2_S1099,
+    MDIAGNOSTIC_STATE2_S1100,
+    MDIAGNOSTIC_STATE2_S1101,
+    MDIAGNOSTIC_STATE2_S1103,
+    MDIAGNOSTIC_STATE2_S1104,
+    MDIAGNOSTIC_STATE2_S1105,
+    MDIAGNOSTIC_STATE2_S1106,
+    MDIAGNOSTIC_STATE2_S1107,
+    MDIAGNOSTIC_STATE2_S1108,
+    MDIAGNOSTIC_STATE2_S1109,
+    MDIAGNOSTIC_STATE2_S1110,
+    MDIAGNOSTIC_STATE2_S1111,
+    MDIAGNOSTIC_STATE2_S1C00,
+    MDIAGNOSTIC_STATE2_S1T00
+};
+
+/*!
+    \brief  ODBC v3 SQL MDIAGNOSTIC_STATES
+
+            This enumerates values in MDiagnosticStatesV3. These make our xref table
easier to
+            understand.
+
+    \note
+            This must be in sync with MDiagnosticStatesV3!
+
+    \sa     MDiagnosticStatesV3
+*/
+enum MDIAGNOSTIC_STATE3
+{
+    MDIAGNOSTIC_STATE3_01000 = 0,
+    MDIAGNOSTIC_STATE3_01001,
+    MDIAGNOSTIC_STATE3_01002,
+    MDIAGNOSTIC_STATE3_01003,
+    MDIAGNOSTIC_STATE3_01004,
+    MDIAGNOSTIC_STATE3_01006,
+    MDIAGNOSTIC_STATE3_01007,
+    MDIAGNOSTIC_STATE3_01S00,
+    MDIAGNOSTIC_STATE3_01S01,
+    MDIAGNOSTIC_STATE3_01S02,
+    MDIAGNOSTIC_STATE3_01S06,
+    MDIAGNOSTIC_STATE3_01S07,
+    MDIAGNOSTIC_STATE3_01S08,
+    MDIAGNOSTIC_STATE3_01S09,
+    MDIAGNOSTIC_STATE3_07001,
+    MDIAGNOSTIC_STATE3_07002,
+    MDIAGNOSTIC_STATE3_07005,
+    MDIAGNOSTIC_STATE3_07006,
+    MDIAGNOSTIC_STATE3_07009,
+    MDIAGNOSTIC_STATE3_07S01,
+    MDIAGNOSTIC_STATE3_08001,
+    MDIAGNOSTIC_STATE3_08002,
+    MDIAGNOSTIC_STATE3_08003,
+    MDIAGNOSTIC_STATE3_08004,
+    MDIAGNOSTIC_STATE3_08007,
+    MDIAGNOSTIC_STATE3_08S01,
+    MDIAGNOSTIC_STATE3_21S01,
+    MDIAGNOSTIC_STATE3_21S02,
+    MDIAGNOSTIC_STATE3_22001,
+    MDIAGNOSTIC_STATE3_22002,
+    MDIAGNOSTIC_STATE3_22003,
+    MDIAGNOSTIC_STATE3_22007,
+    MDIAGNOSTIC_STATE3_22008,
+    MDIAGNOSTIC_STATE3_22012,
+    MDIAGNOSTIC_STATE3_22015,
+    MDIAGNOSTIC_STATE3_22018,
+    MDIAGNOSTIC_STATE3_22019,
+    MDIAGNOSTIC_STATE3_22025,
+    MDIAGNOSTIC_STATE3_22026,
+    MDIAGNOSTIC_STATE3_23000,
+    MDIAGNOSTIC_STATE3_24000,
+    MDIAGNOSTIC_STATE3_25000,
+    MDIAGNOSTIC_STATE3_25S01,
+    MDIAGNOSTIC_STATE3_25S02,
+    MDIAGNOSTIC_STATE3_25S03,
+    MDIAGNOSTIC_STATE3_28000,
+    MDIAGNOSTIC_STATE3_34000,
+    MDIAGNOSTIC_STATE3_3C000,
+    MDIAGNOSTIC_STATE3_3D000,
+    MDIAGNOSTIC_STATE3_3F000,
+    MDIAGNOSTIC_STATE3_40001,
+    MDIAGNOSTIC_STATE3_40002,
+    MDIAGNOSTIC_STATE3_40003,
+    MDIAGNOSTIC_STATE3_42000,
+    MDIAGNOSTIC_STATE3_42S01,
+    MDIAGNOSTIC_STATE3_42S02,
+    MDIAGNOSTIC_STATE3_42S11,
+    MDIAGNOSTIC_STATE3_42S12,
+    MDIAGNOSTIC_STATE3_42S21,
+    MDIAGNOSTIC_STATE3_42S22,
+    MDIAGNOSTIC_STATE3_44000,
+    MDIAGNOSTIC_STATE3_HY000,
+    MDIAGNOSTIC_STATE3_HY001,
+    MDIAGNOSTIC_STATE3_HY003,
+    MDIAGNOSTIC_STATE3_HY004,
+    MDIAGNOSTIC_STATE3_HY007,
+    MDIAGNOSTIC_STATE3_HY008,
+    MDIAGNOSTIC_STATE3_HY009,
+    MDIAGNOSTIC_STATE3_HY010,
+    MDIAGNOSTIC_STATE3_HY011,
+    MDIAGNOSTIC_STATE3_HY012,
+    MDIAGNOSTIC_STATE3_HY013,
+    MDIAGNOSTIC_STATE3_HY014,
+    MDIAGNOSTIC_STATE3_HY015,
+    MDIAGNOSTIC_STATE3_HY016,
+    MDIAGNOSTIC_STATE3_HY017,
+    MDIAGNOSTIC_STATE3_HY018,
+    MDIAGNOSTIC_STATE3_HY019,
+    MDIAGNOSTIC_STATE3_HY020,
+    MDIAGNOSTIC_STATE3_HY021,
+    MDIAGNOSTIC_STATE3_HY024,
+    MDIAGNOSTIC_STATE3_HY090,
+    MDIAGNOSTIC_STATE3_HY091,
+    MDIAGNOSTIC_STATE3_HY092,
+    MDIAGNOSTIC_STATE3_HY095,
+    MDIAGNOSTIC_STATE3_HY096,
+    MDIAGNOSTIC_STATE3_HY097,
+    MDIAGNOSTIC_STATE3_HY098,
+    MDIAGNOSTIC_STATE3_HY099,
+    MDIAGNOSTIC_STATE3_HY100,
+    MDIAGNOSTIC_STATE3_HY101,
+    MDIAGNOSTIC_STATE3_HY103,
+    MDIAGNOSTIC_STATE3_HY104,
+    MDIAGNOSTIC_STATE3_HY105,
+    MDIAGNOSTIC_STATE3_HY106,
+    MDIAGNOSTIC_STATE3_HY107,
+    MDIAGNOSTIC_STATE3_HY109,
+    MDIAGNOSTIC_STATE3_HY110,
+    MDIAGNOSTIC_STATE3_HY111,
+    MDIAGNOSTIC_STATE3_HYC00,
+    MDIAGNOSTIC_STATE3_HYT00,
+    MDIAGNOSTIC_STATE3_HYT01,
+    MDIAGNOSTIC_STATE3_IM001,
+    MDIAGNOSTIC_STATE3_IM002,
+    MDIAGNOSTIC_STATE3_IM003,
+    MDIAGNOSTIC_STATE3_IM004,
+    MDIAGNOSTIC_STATE3_IM005,
+    MDIAGNOSTIC_STATE3_IM006,
+    MDIAGNOSTIC_STATE3_IM007,
+    MDIAGNOSTIC_STATE3_IM008,
+    MDIAGNOSTIC_STATE3_IM009,
+    MDIAGNOSTIC_STATE3_IM010,
+    MDIAGNOSTIC_STATE3_IM011,
+    MDIAGNOSTIC_STATE3_IM012,
+    MDIAGNOSTIC_STATE3_IM013,
+    MDIAGNOSTIC_STATE3_IM014,
+    MDIAGNOSTIC_STATE3_IM015
+};
+
+/*!
+    \internal
+    \brief  State information.
+
+            ODBC Error Codes
+    
+            SQLGetDiagRec or SQLGetDiagField returns SQLSTATE values as defined by 
+            X/Open Data Management: Structured Query Language (SQL), Version 2 
+            (March 1995). SQLSTATE values are strings that contain five characters. 
+            The following lists SQLSTATE values that a driver can return for 
+            SQLGetDiagRec.
+    
+            The character string value returned for an SQLSTATE consists of a 
+            two-character class value followed by a three-character subclass value. 
+            A class value of "01" indicates a warning and is accompanied by a return 
+            code of SQL_SUCCESS_WITH_INFO. Class values other than "01," except 
+            for the class "IM," indicate an error and are accompanied by a return 
+            value of SQL_ERROR. The class "IM" is specific to warnings and errors 
+            that derive from the implementation of ODBC itself. The subclass value 
+            "000" in any class indicates that there is no subclass for that SQLSTATE. 
+            The assignment of class and subclass values is defined by SQL-92.
+
+            This is used to generate a static 'table' of all state information.
+
+    \sa     MDiagnosticStatesV2
+            MDiagnosticStatesV3
+*/
+typedef struct tMDIAGNOSTIC_STATE
+{
+  QString   stringOrigin;       /*!< Standards specification. SQL_DIAG_CLASS_ORIGIN   
     */
+  QString   stringClass;        /*!< Two digit class. First part of SQL_DIAG_SQLSTATE.
     */
+  QString   stringSubClass;     /*!< Three digit subclass. Last part of
SQL_DIAG_SQLSTATE.  */
+  QString   stringText;         /*!< State description.                               
     */
+  SQLRETURN nReturnCode;        /*!< SQLRETURN                                        
     */
+
+} MDIAGNOSTIC_STATE;
+
+/*!
+    \internal
+    \brief  ODBC v2 SQL States Table
+
+            Access this using the MDIAGNOSTIC_STATE2 index.
+
+    \sa     MDIAGNOSTIC_STATE
+*/
+extern MDIAGNOSTIC_STATE MDiagnosticStatesV2[];
+
+/*!
+    \internal
+    \brief  ODBC v3 SQL States Table
+
+            Access this using the MDIAGNOSTIC_STATE3 index.
+
+    \sa     MDIAGNOSTIC_STATE
+*/
+extern MDIAGNOSTIC_STATE MDiagnosticStatesV3[];
+
+/*!
+    \internal
+    \brief  ODBC SQL States XRef Table
+
+            This is used to XRef our state to an ODBC v3 or ODBC v2 state. The
+            first column is the ODBC v3 state and the second column is the 
+            ODBC v2 state.
+
+            Access this using the MDiagnostic::STATE index.
+
+    \sa     MDiagnosticStatesV2
+            MDiagnosticStatesV3
+*/
+extern int MDiagnosticStatesXRef[][];
+
+

Thread
Connector/ODBC 5 commit: r577 - in trunk/SDK: C/Library C/include MYSQLPlus/Librarypharvey6 Oct