Changeset: e03889731af1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e03889731af1
Modified Files:
        clients/odbc/driver/SQLGetConnectAttr.c
        clients/odbc/driver/SQLGetConnectOption.c
        clients/odbc/driver/SQLGetDescField.c
        clients/odbc/driver/SQLGetDiagField.c
        clients/odbc/driver/SQLGetEnvAttr.c
        clients/odbc/driver/SQLGetInfo.c
        clients/odbc/driver/SQLGetStmtAttr.c
Branch: Oct2014
Log Message:

More debugging information.


diffs (245 lines):

diff --git a/clients/odbc/driver/SQLGetConnectAttr.c 
b/clients/odbc/driver/SQLGetConnectAttr.c
--- a/clients/odbc/driver/SQLGetConnectAttr.c
+++ b/clients/odbc/driver/SQLGetConnectAttr.c
@@ -153,9 +153,10 @@ SQLGetConnectAttr(SQLHDBC ConnectionHand
                  SQLINTEGER *StringLengthPtr)
 {
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetConnectAttr " PTRFMT " %s\n",
+       ODBCLOG("SQLGetConnectAttr " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
                PTRFMTCAST ConnectionHandle,
-               translateConnectAttribute(Attribute));
+               translateConnectAttribute(Attribute),
+               PTRFMTCAST ValuePtr, BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidDbc((ODBCDbc *) ConnectionHandle))
@@ -197,9 +198,10 @@ SQLGetConnectAttrW(SQLHDBC ConnectionHan
        SQLINTEGER n;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetConnectAttrW " PTRFMT " %s\n",
+       ODBCLOG("SQLGetConnectAttrW " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
                PTRFMTCAST ConnectionHandle,
-               translateConnectAttribute(Attribute));
+               translateConnectAttribute(Attribute),
+               PTRFMTCAST ValuePtr, BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidDbc(dbc))
diff --git a/clients/odbc/driver/SQLGetConnectOption.c 
b/clients/odbc/driver/SQLGetConnectOption.c
--- a/clients/odbc/driver/SQLGetConnectOption.c
+++ b/clients/odbc/driver/SQLGetConnectOption.c
@@ -98,8 +98,9 @@ SQLGetConnectOption(SQLHDBC ConnectionHa
        ODBCDbc *dbc = (ODBCDbc *) ConnectionHandle;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetConnectOption " PTRFMT " %s\n",
-               PTRFMTCAST ConnectionHandle, translateConnectOption(Option));
+       ODBCLOG("SQLGetConnectOption " PTRFMT " %s " PTRFMT "\n",
+               PTRFMTCAST ConnectionHandle, translateConnectOption(Option),
+               PTRFMTCAST ValuePtr);
 #endif
 
        if (!isValidDbc(dbc))
@@ -127,8 +128,9 @@ SQLGetConnectOptionW(SQLHDBC ConnectionH
        SQLPOINTER ptr;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetConnectOptionW " PTRFMT " %s\n",
-               PTRFMTCAST ConnectionHandle, translateConnectOption(Option));
+       ODBCLOG("SQLGetConnectOptionW " PTRFMT " %s " PTRFMT "\n",
+               PTRFMTCAST ConnectionHandle, translateConnectOption(Option),
+               PTRFMTCAST ValuePtr);
 #endif
 
        if (!isValidDbc(dbc))
diff --git a/clients/odbc/driver/SQLGetDescField.c 
b/clients/odbc/driver/SQLGetDescField.c
--- a/clients/odbc/driver/SQLGetDescField.c
+++ b/clients/odbc/driver/SQLGetDescField.c
@@ -288,9 +288,10 @@ SQLGetDescField(SQLHDESC DescriptorHandl
                SQLINTEGER *StringLengthPtr)
 {
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetDescField " PTRFMT " %d %s\n",
+       ODBCLOG("SQLGetDescField " PTRFMT " %d %s " PTRFMT " %d " PTRFMT "\n",
                PTRFMTCAST DescriptorHandle, (int) RecordNumber,
-               translateFieldIdentifier(FieldIdentifier));
+               translateFieldIdentifier(FieldIdentifier),
+               PTRFMTCAST ValuePtr, BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidDesc((ODBCDesc *) DescriptorHandle))
@@ -335,9 +336,10 @@ SQLGetDescFieldW(SQLHDESC DescriptorHand
        SQLINTEGER n;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetDescFieldW " PTRFMT " %d %s\n",
+       ODBCLOG("SQLGetDescFieldW " PTRFMT " %d %s " PTRFMT " %d " PTRFMT "\n",
                PTRFMTCAST DescriptorHandle, (int) RecordNumber,
-               translateFieldIdentifier(FieldIdentifier));
+               translateFieldIdentifier(FieldIdentifier),
+               PTRFMTCAST ValuePtr, BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidDesc(desc))
diff --git a/clients/odbc/driver/SQLGetDiagField.c 
b/clients/odbc/driver/SQLGetDiagField.c
--- a/clients/odbc/driver/SQLGetDiagField.c
+++ b/clients/odbc/driver/SQLGetDiagField.c
@@ -205,6 +205,50 @@ SQLGetDiagField_(SQLSMALLINT HandleType,
        return SQL_NO_DATA;
 }
 
+#ifdef ODBCDEBUG
+static char *
+translateDiagIdentifier(SQLSMALLINT DiagIdentifier)
+{
+       static char unknown[32];
+
+       switch (DiagIdentifier) {
+       case SQL_DIAG_CLASS_ORIGIN:
+               return "SQL_DIAG_CLASS_ORIGIN";
+       case SQL_DIAG_COLUMN_NUMBER:
+               return "SQL_DIAG_COLUMN_NUMBER";
+       case SQL_DIAG_CONNECTION_NAME:
+               return "SQL_DIAG_CONNECTION_NAME";
+       case SQL_DIAG_CURSOR_ROW_COUNT:
+               return "SQL_DIAG_CURSOR_ROW_COUNT";
+       case SQL_DIAG_DYNAMIC_FUNCTION:
+               return "SQL_DIAG_DYNAMIC_FUNCTION";
+       case SQL_DIAG_DYNAMIC_FUNCTION_CODE:
+               return "SQL_DIAG_DYNAMIC_FUNCTION_CODE";
+       case SQL_DIAG_MESSAGE_TEXT:
+               return "SQL_DIAG_MESSAGE_TEXT";
+       case SQL_DIAG_NATIVE:
+               return "SQL_DIAG_NATIVE";
+       case SQL_DIAG_NUMBER:
+               return "SQL_DIAG_NUMBER";
+       case SQL_DIAG_RETURNCODE:
+               return "SQL_DIAG_RETURNCODE";
+       case SQL_DIAG_ROW_COUNT:
+               return "SQL_DIAG_ROW_COUNT";
+       case SQL_DIAG_ROW_NUMBER:
+               return "SQL_DIAG_ROW_NUMBER";
+       case SQL_DIAG_SERVER_NAME:
+               return "SQL_DIAG_SERVER_NAME";
+       case SQL_DIAG_SQLSTATE:
+               return "SQL_DIAG_SQLSTATE";
+       case SQL_DIAG_SUBCLASS_ORIGIN:
+               return "SQL_DIAG_SUBCLASS_ORIGIN";
+       default:
+               snprintf(unknown, sizeof(unknown), "unknown (%d)", 
DiagIdentifier);
+               return unknown;
+       }
+}
+#endif
+
 SQLRETURN SQL_API
 SQLGetDiagField(SQLSMALLINT HandleType,
                SQLHANDLE Handle,
@@ -215,10 +259,12 @@ SQLGetDiagField(SQLSMALLINT HandleType,
                SQLSMALLINT *StringLengthPtr)
 {
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetDiagField %s " PTRFMT " %d %d %d\n",
+       ODBCLOG("SQLGetDiagField %s " PTRFMT " %d %s " PTRFMT " %d " PTRFMT 
"\n",
                HandleType == SQL_HANDLE_ENV ? "Env" : HandleType == 
SQL_HANDLE_DBC ? "Dbc" : HandleType == SQL_HANDLE_STMT ? "Stmt" : "Desc",
-               PTRFMTCAST Handle, (int) RecNumber, (int) DiagIdentifier,
-               (int) BufferLength);
+               PTRFMTCAST Handle, (int) RecNumber, 
+               translateDiagIdentifier(DiagIdentifier),
+               PTRFMTCAST DiagInfoPtr,
+               (int) BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        return SQLGetDiagField_(HandleType,
@@ -262,10 +308,12 @@ SQLGetDiagFieldW(SQLSMALLINT HandleType,
        SQLSMALLINT n;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetDiagFieldW %s " PTRFMT " %d %d %d\n",
+       ODBCLOG("SQLGetDiagFieldW %s " PTRFMT " %d %s " PTRFMT " %d " PTRFMT 
"\n",
                HandleType == SQL_HANDLE_ENV ? "Env" : HandleType == 
SQL_HANDLE_DBC ? "Dbc" : HandleType == SQL_HANDLE_STMT ? "Stmt" : "Desc",
-               PTRFMTCAST Handle, (int) RecNumber, (int) DiagIdentifier,
-               (int) BufferLength);
+               PTRFMTCAST Handle, (int) RecNumber, 
+               translateDiagIdentifier(DiagIdentifier),
+               PTRFMTCAST DiagInfoPtr,
+               BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        switch (DiagIdentifier) {
diff --git a/clients/odbc/driver/SQLGetEnvAttr.c 
b/clients/odbc/driver/SQLGetEnvAttr.c
--- a/clients/odbc/driver/SQLGetEnvAttr.c
+++ b/clients/odbc/driver/SQLGetEnvAttr.c
@@ -52,9 +52,10 @@ SQLGetEnvAttr(SQLHENV EnvironmentHandle,
        ODBCEnv *env = (ODBCEnv *) EnvironmentHandle;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetEnvAttr " PTRFMT " %s\n",
+       ODBCLOG("SQLGetEnvAttr " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
                PTRFMTCAST EnvironmentHandle,
-               translateEnvAttribute(Attribute));
+               translateEnvAttribute(Attribute),
+               PTRFMTCAST ValuePtr, BufferLength, PTRFMTCAST StringLengthPtr);
 #endif
 
        (void) BufferLength;    /* Stefan: unused!? */
diff --git a/clients/odbc/driver/SQLGetInfo.c b/clients/odbc/driver/SQLGetInfo.c
--- a/clients/odbc/driver/SQLGetInfo.c
+++ b/clients/odbc/driver/SQLGetInfo.c
@@ -1573,8 +1573,10 @@ SQLGetInfo(SQLHDBC ConnectionHandle,
        ODBCDbc *dbc = (ODBCDbc *) ConnectionHandle;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetInfo " PTRFMT " %s\n",
-               PTRFMTCAST ConnectionHandle, translateInfoType(InfoType));
+       ODBCLOG("SQLGetInfo " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
+               PTRFMTCAST ConnectionHandle, translateInfoType(InfoType),
+               PTRFMTCAST InfoValuePtr, BufferLength, 
+               PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidDbc(dbc))
@@ -1616,8 +1618,10 @@ SQLGetInfoW(SQLHDBC ConnectionHandle,
        SQLSMALLINT n;
 
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetInfoW " PTRFMT " %s\n",
-               PTRFMTCAST ConnectionHandle, translateInfoType(InfoType));
+       ODBCLOG("SQLGetInfoW " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
+               PTRFMTCAST ConnectionHandle, translateInfoType(InfoType),
+               PTRFMTCAST InfoValuePtr, BufferLength, 
+               PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidDbc(dbc))
diff --git a/clients/odbc/driver/SQLGetStmtAttr.c 
b/clients/odbc/driver/SQLGetStmtAttr.c
--- a/clients/odbc/driver/SQLGetStmtAttr.c
+++ b/clients/odbc/driver/SQLGetStmtAttr.c
@@ -195,8 +195,10 @@ SQLGetStmtAttr(SQLHSTMT StatementHandle,
               SQLINTEGER *StringLengthPtr)
 {
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetStmtAttr " PTRFMT " %s\n",
-               PTRFMTCAST StatementHandle, translateStmtAttribute(Attribute));
+       ODBCLOG("SQLGetStmtAttr " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
+               PTRFMTCAST StatementHandle, translateStmtAttribute(Attribute),
+               PTRFMTCAST ValuePtr, BufferLength,
+               PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidStmt((ODBCStmt *) StatementHandle))
@@ -233,8 +235,10 @@ SQLGetStmtAttrW(SQLHSTMT StatementHandle
                SQLINTEGER *StringLengthPtr)
 {
 #ifdef ODBCDEBUG
-       ODBCLOG("SQLGetStmtAttrW " PTRFMT " %s\n",
-               PTRFMTCAST StatementHandle, translateStmtAttribute(Attribute));
+       ODBCLOG("SQLGetStmtAttrW " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
+               PTRFMTCAST StatementHandle, translateStmtAttribute(Attribute),
+               PTRFMTCAST ValuePtr, BufferLength,
+               PTRFMTCAST StringLengthPtr);
 #endif
 
        if (!isValidStmt((ODBCStmt *) StatementHandle))
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to