Changeset b7e6cec in tol


Ignore:
Timestamp:
Feb 15, 2011, 8:16:13 AM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
70fd0e0
Parents:
ac1601a
Message:

TRACE_DEEP

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3196 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/dbdrivers/libtolodbc.c

    rac1601a rb7e6cec  
    5959#define MAX_TEXT_FIELD_LENGTH 2048
    6060
     61//#define TRACE_DEEP 1
     62
    6163typedef struct odbcdx {
    6264  //  char *alias;
    … …  
    109111      }
    110112      else if(rc==SQL_SUCCESS_WITH_INFO) {
    111 #if defined(_DEBUG)
     113#if defined(_DEBUG) || defined(TRACE_DEEP)
    112114        if(MsgLen>SQL_MAX_MESSAGE_LENGTH)
    113115          stdOutWriter("The *MessageText buffer was too small to hold the "
    … …  
    118120      }
    119121      else if(rc==SQL_INVALID_HANDLE) {
    120 #if defined(_DEBUG)
     122#if defined(_DEBUG) || defined(TRACE_DEEP)
    121123        stdOutWriter("The handle indicated by HandleType and Handle was not "
    122124                     "a valid handle.\n");
    … …  
    186188  odbcd *dbd;
    187189  char *alias, *user, *pwd;
     190#ifdef TRACE_DEEP
     191  printf( "Entering odbc_Open\n");
     192#endif
    188193
    189194  dbd = (odbcd*)malloc(sizeof(odbcd));
    … …  
    202207
    203208  // 1.1: SQLAllocHandle(ENV)
     209#ifdef TRACE_DEEP
     210  printf( "1.1: SQLAllocHandle(ENV)\n");
     211#endif
    204212  status =  SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &(dbd->henv));
    205213  if(!checkSQLRet(status, dbd, __LINE__, GET_DIAG_ENV)) {
    … …  
    208216
    209217  // 1.2: SQLSetEnvAttr
     218#ifdef TRACE_DEEP
     219  printf( "1.2: SQLSetEnvAttr\n");
     220#endif
    210221  status = SQLSetEnvAttr(dbd->henv, SQL_ATTR_ODBC_VERSION,
    211222                         (long *)SQL_OV_ODBC2, 0);
    … …  
    216227
    217228  // 1.3: SQLAllocHandle(DBC)
    218   status = SQLAllocHandle(SQL_HANDLE_DBC, dbd->henv, &(dbd->hdbc));
     229#ifdef TRACE_DEEP
     230  printf( "1.3: SQLAllocHandle(DBC)\n");
     231#endif
     232   status = SQLAllocHandle(SQL_HANDLE_DBC, dbd->henv, &(dbd->hdbc));
    219233  if(!checkSQLRet(status, dbd, __LINE__, GET_DIAG_DBC)) {
    220234    closeODBC(dbd, 1); //"1" -> last step done: SQLAllocHandle SQLHENV
    … …  
    223237
    224238  // 1.4: SQLConnect
     239#ifdef TRACE_DEEP
     240  printf( "1.4: SQLConnect\n");
     241  printf( "(%s,%s,%s)\n", alias, user, pwd );
     242#endif
    225243  status = SQLConnect(dbd->hdbc,
    226244                      (SQLCHAR*) alias, SQL_NTS,
    227245                      (SQLCHAR*) user, SQL_NTS,
    228246                      (SQLCHAR*) pwd, SQL_NTS);
     247#ifdef TRACE_DEEP
     248  printf( "Status from SQLConnect: %d\n", status );
     249#endif
    229250  if(!checkSQLRet(status, dbd, __LINE__, GET_DIAG_DBC)) {
    230251    closeODBC(dbd, 2); //"2"-> last step done: SQLAllocHandle of SQLHDBC
Note: See TracChangeset for help on using the changeset viewer.