Implement myprintf() which prints logs according to printf format and make logs a...
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 16 Aug 2017 02:23:51 +0000 (11:23 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 16 Aug 2017 02:23:51 +0000 (11:23 +0900)
19 files changed:
bind.c
connection.c
convert.c
descriptor.c
dlg_specific.c
execute.c
info.c
mylog.c
mylog.h
odbcapi.c
odbcapi30.c
odbcapi30w.c
odbcapiw.c
options.c
parse.c
pgapi30.c
results.c
statement.c
win_unicode.c

diff --git a/bind.c b/bind.c
index effafedd56908242a0f26cba6415df0f94b652af..d92695664a488f043cf98d2b9b996e112f33916c 100644 (file)
--- a/bind.c
+++ b/bind.c
@@ -136,7 +136,7 @@ PGAPI_BindParameter(HSTMT hstmt,
        SC_recycle_statement(stmt);
 
    MYLOG(0, "%s: ipar=%d, paramType=%d, fCType=%d, fSqlType=%d, cbColDef=" FORMAT_ULEN ", ibScale=%d,", func, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale);
-   MYLOG(0, "rgbValue=%p(" FORMAT_LEN "), pcbValue=%p\n", rgbValue, cbValueMax, pcbValue);
+   MYPRINTF(0, "rgbValue=%p(" FORMAT_LEN "), pcbValue=%p\n", rgbValue, cbValueMax, pcbValue);
 
    return SQL_SUCCESS;
 }
@@ -201,7 +201,7 @@ PGAPI_BindCol(HSTMT hstmt,
                    break;
                default:
                    SC_set_error(stmt, STMT_PROGRAM_TYPE_OUT_OF_RANGE, "Bind column 0 is not of type SQL_C_BOOKMARK", func);
-MYLOG(1, "Bind column 0 is type %d not of type SQL_C_BOOKMARK", fCType);
+MYLOG(1, "Bind column 0 is type %d not of type SQL_C_BOOKMARK\n", fCType);
                    ret = SQL_ERROR;
                    goto cleanup;
            }
@@ -810,7 +810,7 @@ void    ARD_unbind_cols(ARDFields *self, BOOL freeall)
 {
    Int2    lf;
 
-MYLOG(1, "ARD_unbind_cols freeall=%d allocated=%d bindings=%p", freeall, self->allocated, self->bindings);
+MYLOG(1, "ARD_unbind_cols freeall=%d allocated=%d bindings=%p\n", freeall, self->allocated, self->bindings);
    for (lf = 1; lf <= self->allocated; lf++)
        reset_a_column_binding(self, lf);
    if (freeall)
@@ -825,7 +825,7 @@ void    GDATA_unbind_cols(GetDataInfo *self, BOOL freeall)
 {
    Int2    lf;
 
-MYLOG(1, "GDATA_unbind_cols freeall=%d allocated=%d gdata=%p", freeall, self->allocated, self->gdata);
+MYLOG(1, "GDATA_unbind_cols freeall=%d allocated=%d gdata=%p\n", freeall, self->allocated, self->gdata);
    if (self->fdata.ttlbuf)
    {
        free(self->fdata.ttlbuf);
index 60629e3076f4e2214ac6e34ec3dd4c62fb3ff4c6..d93fdfd6c2297ad2fbf713b0a6efa984ee7e7a28 100644 (file)
@@ -806,7 +806,7 @@ handle_pgres_error(ConnectionClass *self, const PGresult *pgres,
    char       *errmsg = NULL;
    size_t      errmsglen;
 
-   MYLOG(1, "handle_pgres_error");
+   MYLOG(1, "handle_pgres_error\n");
 
    if (res && pgres)
    {
@@ -963,7 +963,7 @@ static char CC_initial_log(ConnectionClass *self, const char *func)
 #endif /* _MSC_VER */
        );
    qlog(vermsg);
-   MYLOG(0, "%s", vermsg);
+   MYLOG(0, "%s\n", vermsg);
    qlog("Global Options: fetch=%d, unknown_sizes=%d, max_varchar_size=%d, max_longvarchar_size=%d\n",
         ci->drivers.fetch_max,
         ci->drivers.unknown_sizes,
index ed36471ff0c662f2acdad881f85123fbf7e77236..c283bb81b8da00e9fc2557c7f9182c3f9f9ec694 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1502,7 +1502,7 @@ MYLOG(1, "2stime fr=%d\n", std_time.fr);
                {
                    if (sscanf(vp, "%hi", &shortv) != 1)
                        break;
-                   MYLOG(0, " %hi", shortv);
+                   MYPRINTF(0, " %hi", shortv);
                    nval++;
                    if (nval < maxc)
                        short_array[i + 1] = shortv;
@@ -1516,7 +1516,7 @@ MYLOG(1, "2stime fr=%d\n", std_time.fr);
                    if (*vp == '\0')
                        break;
                }
-               MYLOG(0, ") nval = %i\n", nval);
+               MYPRINTF(0, ") nval = %i\n", nval);
                if (maxc > 0)
                    short_array[0] = nval;
 
@@ -1776,11 +1776,8 @@ MYLOG(1, "2stime fr=%d\n", std_time.fr);
                else
                    *((UCHAR *) rgbValue + bind_row) = atoi(neut_str);
 
-               /*
-                * MYLOG(0, "SQL_C_BIT: bind_row = %d val = %d, cb = %d,
-                * rgb=%d\n", bind_row, atoi(neut_str), cbValueMax,
-                * *((UCHAR *)rgbValue));
-                */
+                MYLOG(99, "SQL_C_BIT: bind_row = " FORMAT_POSIROW " val = %d, cb = " FORMAT_LEN ", rgb=%d\n",
+                   bind_row, atoi(neut_str), cbValueMax, *((UCHAR *)rgbValue));
                break;
 
            case SQL_C_STINYINT:
@@ -1931,7 +1928,7 @@ MYLOG(1, "SQL_C_VARBOOKMARK value=%d\n", ival);
                result = char2guid(neut_str, &g);
                if (COPY_OK != result)
                {
-                   MYLOG(0, "Could not convert to SQL_C_GUID");
+                   MYLOG(0, "Could not convert to SQL_C_GUID\n");
                    return  COPY_UNSUPPORTED_TYPE;
                }
                len = sizeof(g);
@@ -3922,7 +3919,7 @@ MYLOG(1, "C_NUMERIC [prec=%d scale=%d]", ns->precision, ns->scale);
     * digit is at calv[0]
     */
 
-MYLOG(1, " len2=%d", len);
+MYPRINTF(1, " len2=%d", len);
 
    /* build the final output string. */
    newlen = 0;
index 0d0d9f69a72f0adeb2f2f571a5c61b4b6820c671..16d0514224df2ce08ae3d6906bd1ca1d729fff1d 100644 (file)
@@ -190,13 +190,12 @@ void  DC_Constructor(DescriptorClass *self, BOOL embedded, StatementClass *stmt)
 
 static void ARDFields_free(ARDFields * self)
 {
-MYLOG(1, "ARDFields_free %p bookmark=%p", self, self->bookmark);
+MYLOG(1, "ARDFields_free %p bookmark=%p\n", self, self->bookmark);
    if (self->bookmark)
    {
        free(self->bookmark);
        self->bookmark = NULL;
    }
-MYLOG(1, " hey");
    /*
     * the memory pointed to by the bindings is not deallocated by the
     * driver but by the application that uses that driver, so we don't
@@ -565,13 +564,13 @@ MYLOG(1, "src=%p target=%p type=%d", src, target, srchd->desc_type);
                targethd->desc_type = srchd->desc_type;
            }
            ard_src = &(src->ardf);
-MYLOG(1, " rowset_size=" FORMAT_LEN " bind_size=%d ope_ptr=%p off_ptr=%p\n",
+MYPRINTF(1, " rowset_size=" FORMAT_LEN " bind_size=%d ope_ptr=%p off_ptr=%p\n",
 ard_src->size_of_rowset, ard_src->bind_size,
 ard_src->row_operation_ptr, ard_src->row_offset_ptr);
            ard_tgt = &(target->ardf);
-MYLOG(1, " target=%p", ard_tgt);
+MYPRINTF(1, " target=%p", ard_tgt);
            ARDFields_copy(ard_src, ard_tgt);
-MYLOG(1, " offset_ptr=%p\n", ard_tgt->row_offset_ptr);
+MYPRINTF(1, " offset_ptr=%p\n", ard_tgt->row_offset_ptr);
            break;
        case SQL_ATTR_APP_PARAM_DESC:
            if (!targethd->type_defined)
index 77d467db5d45eae1173f825addbeb019b54ce1da..05477ef7cdd4a4cc7ecd5e2b21e240a405982ffa 100644 (file)
@@ -313,7 +313,7 @@ MYLOG(1, "force_abbrev=%d abbrev=%d\n", ci->force_abbrev_connstr, abbrev);
    /* extra info */
    hlen = strlen(connect_string);
    nlen = MAX_CONNECT_STRING - hlen;
-MYLOG(1, "hlen=" FORMAT_SSIZE_T, hlen);
+MYLOG(1, "hlen=" FORMAT_SSIZE_T "\n", hlen);
    if (!abbrev)
    {
        char    protocol_and[16];
index ad52c9f509d85c0e11ab563959a30eb3d1b54f89..67614a79475cb457da7c4f47d7af2570aaa73f6c 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -1423,7 +1423,7 @@ MYLOG(1, "i=%d allocated=%d num_p=%d\n", i, apdopts->allocated, num_p);
 MYLOG(1, "i=%d", i);
        if (apdopts->parameters[i].data_at_exec)
        {
-MYLOG(1, " at exec buffer=%p", apdopts->parameters[i].buffer);
+MYPRINTF(1, " at exec buffer=%p", apdopts->parameters[i].buffer);
            estmt->data_at_exec--;
            estmt->current_exec_param = i;
            estmt->put_data = FALSE;
@@ -1435,7 +1435,7 @@ MYLOG(1, " at exec buffer=%p", apdopts->parameters[i].buffer);
                    SQLULEN offset = apdopts->param_offset_ptr ? *apdopts->param_offset_ptr : 0;
                    SQLLEN  perrow = apdopts->param_bind_type > 0 ? apdopts->param_bind_type : apdopts->parameters[i].buflen;
 
-MYLOG(1, " offset=" FORMAT_LEN " perrow=" FORMAT_LEN, offset, perrow);
+MYPRINTF(1, " offset=" FORMAT_LEN " perrow=" FORMAT_LEN, offset, perrow);
                    *prgbValue = apdopts->parameters[i].buffer + offset + estmt->exec_current_row * perrow;
                }
                else
@@ -1443,7 +1443,7 @@ MYLOG(1, " offset=" FORMAT_LEN " perrow=" FORMAT_LEN, offset, perrow);
            }
            break;
        }
-MYLOG(1, "\n");
+MYPRINTF(1, "\n");
    }
 
    retval = SQL_NEED_DATA;
diff --git a/info.c b/info.c
index 3118b9e45487cbc2f1ce3840228e4c4b7870dc49..2858a5cc34d58c4844dff1b83cd5cfe17d033f6b 100644 (file)
--- a/info.c
+++ b/info.c
@@ -4174,7 +4174,7 @@ PGAPI_ForeignKeys_old(HSTMT hstmt,
    {
        char    *escSchemaName;
 
-       MYLOG(0, "%s: entering Foreign Key Case #2", func);
+       MYLOG(0, "%s: entering Foreign Key Case #2\n", func);
        escFkTableName = simpleCatalogEscape((SQLCHAR *) fk_table_needed, SQL_NTS, conn);
        schema_str(schema_needed, sizeof(schema_needed), szFkTableOwner, cbFkTableOwner, TABLE_IS_VALID(szFkTableName, cbFkTableName), conn);
        escSchemaName = simpleCatalogEscape((SQLCHAR *) schema_needed, SQL_NTS, conn);
@@ -4771,7 +4771,7 @@ PGAPI_ForeignKeys_old(HSTMT hstmt,
 
                set_tuplefield_string(&tuple[FKS_TRIGGER_NAME], trig_args);
 
-               MYLOG(0, " defer_type = %d\n", defer_type);
+               MYPRINTF(0, " defer_type = %d\n", defer_type);
                set_tuplefield_int2(&tuple[FKS_DEFERRABILITY], defer_type);
 
                if (pkey_alloced)
@@ -5804,7 +5804,7 @@ PGAPI_ForeignKeys_new(HSTMT hstmt,
     */
    if (NULL != fk_table_needed)
    {
-       MYLOG(0, "%s: entering Foreign Key Case #2", func);
+       MYLOG(0, "%s: entering Foreign Key Case #2\n", func);
        escTableName = simpleCatalogEscape((SQLCHAR *) fk_table_needed, SQL_NTS, conn);
        schema_str(schema_needed, sizeof(schema_needed), szFkTableOwner, cbFkTableOwner, TABLE_IS_VALID(szFkTableName, cbFkTableName), conn);
        relqual = "\n   and  conrelid = c.oid";
diff --git a/mylog.c b/mylog.c
index f031fedec95a6437b6d02612c20dc15fc17756a5..2bd364eb3ae493635dc4ed09ff076cc40e0311c2 100644 (file)
--- a/mylog.c
+++ b/mylog.c
@@ -237,13 +237,12 @@ static void MLOG_open()
    }
 }
 
-DLL_DECLARE int
-mylog(const char *fmt,...)
+static int
+mylog_misc(unsigned int option, const char *fmt, va_list args)
 {
-   va_list     args;
+   // va_list      args;
    int     gerrno;
-
-   if (!mylog_on)  return 0;
+   BOOL    log_threadid = option;
 
    gerrno = GENERAL_ERRNO;
    ENTER_MYLOG_CS;
@@ -251,7 +250,7 @@ mylog(const char *fmt,...)
    if (!start_time)
        start_time = timeGetTime();
 #endif /* LOGGING_PROCESS_TIME */
-   va_start(args, fmt);
+   // va_start(args, fmt);
 
    if (!MLOGFP)
    {
@@ -262,6 +261,8 @@ mylog(const char *fmt,...)
 
    if (MLOGFP)
    {
+       if (log_threadid)
+       {
 #ifdef WIN_MULTITHREAD_SUPPORT
 #ifdef LOGGING_PROCESS_TIME
        DWORD   proc_time = timeGetTime() - start_time;
@@ -273,15 +274,44 @@ mylog(const char *fmt,...)
 #if defined(POSIX_MULTITHREAD_SUPPORT)
        fprintf(MLOGFP, "[%lu]", pthread_self());
 #endif /* POSIX_MULTITHREAD_SUPPORT */
+       }
        vfprintf(MLOGFP, fmt, args);
    }
 
-   va_end(args);
+   // va_end(args);
    LEAVE_MYLOG_CS;
    GENERAL_ERRNO_SET(gerrno);
 
    return 1;
 }
+
+DLL_DECLARE int
+mylog(const char *fmt,...)
+{
+   int ret = 0;
+   unsigned int option = 1;
+   va_list args;
+
+   if (!mylog_on)  return ret;
+
+   va_start(args, fmt);
+   ret = mylog_misc(option, fmt, args);
+   va_end(args);
+   return  ret;
+}
+
+DLL_DECLARE int
+myprintf(const char *fmt,...)
+{
+   int ret = 0;
+   va_list args;
+
+   va_start(args, fmt);
+   ret = mylog_misc(FALSE, fmt, args); 
+   va_end(args);
+   return  ret;
+}
+
 static void mylog_initialize(void)
 {
    INIT_MYLOG_CS;
diff --git a/mylog.h b/mylog.h
index 7492304c490ef71c4094cdffeddee715f83d16f0..e4cd3120a76795ce2e27423b4d8802fee4db86fc 100644 (file)
--- a/mylog.h
+++ b/mylog.h
@@ -38,15 +38,19 @@ extern "C" {
 #endif
 
 DLL_DECLARE int mylog(const char *fmt,...) __attribute__((format(printf, 1, 2)));
+DLL_DECLARE int myprintf(const char *fmt,...) __attribute__((format(printf, 1, 2)));
 
 extern int qlog(char *fmt,...);
 
 #ifdef __GNUC__
 #define    MYLOG(level, fmt, ...)  (level < get_mylog() ? mylog((fmt), ##__VA_ARGS__) : 0)
+#define    MYPRINTF(level, fmt, ...) (level < get_mylog() ? myprintf((fmt), ##__VA_ARGS__) : 0)
 #elif  defined WIN32 && _MSC_VER > 1800
 #define    MYLOG(level, fmt, ...) (level < get_mylog() ? mylog(fmt, __VA_ARGS__) : (printf || printf((fmt), __VA_ARGS__)))
+#define    MYPRINTF(level, fmt, ...) (level < get_mylog() ? myprintf(fmt, __VA_ARGS__) : (printf || printf((fmt), __VA_ARGS__)))
 #else
 #define    MYLOG(level, ...) (level < get_mylog() ? mylog(__VA_ARGS__) : 0)
+#define    MYPRINTF(level, ...) (level < get_mylog() ? myprintf(__VA_ARGS__) : 0)
 #endif /* __GNUC__ */
 
 int    get_qlog(void);
index dcb055670b59ed0ea2b4be2f8a00b9375fae77c1..a40400d77db4425842f82dda91f0c6bf14afa260 100644 (file)
--- a/odbcapi.c
+++ b/odbcapi.c
@@ -60,7 +60,7 @@ SQLBindCol(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLBindCol]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
    StartRollbackState(stmt);
@@ -74,7 +74,7 @@ SQLBindCol(HSTMT StatementHandle,
 RETCODE        SQL_API
 SQLCancel(HSTMT StatementHandle)
 {
-   MYLOG(0, "[SQLCancel]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    /* Not that neither ENTER_STMT_CS nor StartRollbackState is called */
    /* SC_clear_error((StatementClass *) StatementHandle); maybe this neither */
    if (SC_connection_lost_check((StatementClass *) StatementHandle, __FUNCTION__))
@@ -106,7 +106,7 @@ SQLColumns(HSTMT StatementHandle,
    ConnInfo *ci = &(SC_get_conn(stmt)->connInfo);
    UWORD   flag    = PODBC_SEARCH_PUBLIC_SCHEMA;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -183,7 +183,7 @@ SQLConnect(HDBC ConnectionHandle,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
 
-   MYLOG(0, "[SQLConnect]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -206,7 +206,7 @@ SQLDriverConnect(HDBC hdbc,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[SQLDriverConnect]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -226,7 +226,7 @@ SQLBrowseConnect(HDBC hdbc,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[SQLBrowseConnect]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -243,7 +243,7 @@ SQLDataSources(HENV EnvironmentHandle,
               SQLCHAR *Description, SQLSMALLINT BufferLength2,
               SQLSMALLINT *NameLength2)
 {
-   MYLOG(0, "[SQLDataSources]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
 
    /*
     * return PGAPI_DataSources(EnvironmentHandle, Direction, ServerName,
@@ -263,7 +263,7 @@ SQLDescribeCol(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLDescribeCol]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -286,7 +286,7 @@ SQLDisconnect(HDBC ConnectionHandle)
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
 
-   MYLOG(0, "[%s for %p]", func, ConnectionHandle);
+   MYLOG(0, "[%s for %p]\n", func, ConnectionHandle);
 #ifdef _HANDLE_ENLIST_IN_DTC_
    if (CC_is_in_global_trans(conn))
        CALL_DtcOnDisconnect(conn);
@@ -308,7 +308,7 @@ SQLExecDirect(HSTMT StatementHandle,
    StatementClass *stmt = (StatementClass *) StatementHandle;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -336,7 +336,7 @@ SQLExecute(HSTMT StatementHandle)
    StatementClass *stmt = (StatementClass *) StatementHandle;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -367,7 +367,7 @@ SQLFetch(HSTMT StatementHandle)
    SQLUSMALLINT *rowStatusArray = irdopts->rowStatusArray;
    SQLULEN *pcRow = irdopts->rowsFetched;
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -393,7 +393,7 @@ SQLFreeStmt(HSTMT StatementHandle,
    StatementClass *stmt = (StatementClass *) StatementHandle;
    ConnectionClass *conn = NULL;
 
-   MYLOG(0, "[SQLFreeStmt]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
 
    if (stmt)
    {
@@ -433,7 +433,7 @@ SQLGetCursorName(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLGetCursorName]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
    StartRollbackState(stmt);
@@ -454,7 +454,7 @@ SQLGetData(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLGetData]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -475,7 +475,7 @@ SQLGetFunctions(HDBC ConnectionHandle,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
 
-   MYLOG(0, "[SQLGetFunctions]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -501,7 +501,7 @@ SQLGetInfo(HDBC ConnectionHandle,
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
-   MYLOG(0, "[%s(30)]", func);
+   MYLOG(0, "[%s(30)]\n", func);
    if ((ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
                BufferLength, StringLength)) == SQL_ERROR)
        CC_log_error("SQLGetInfo(30)", "", conn);
@@ -518,7 +518,7 @@ SQLGetTypeInfo(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check((StatementClass *) StatementHandle, __FUNCTION__))
        return SQL_ERROR;
 
@@ -544,7 +544,7 @@ SQLNumResultCols(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLNumResultCols]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -564,7 +564,7 @@ SQLParamData(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLParamData]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -585,7 +585,7 @@ SQLPrepare(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLPrepare]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -611,7 +611,7 @@ SQLPutData(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLPutData]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -630,7 +630,7 @@ SQLRowCount(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLRowCount]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -652,7 +652,7 @@ SQLSetCursorName(HSTMT StatementHandle,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[SQLSetCursorName]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
    StartRollbackState(stmt);
@@ -670,7 +670,7 @@ SQLSetParam(HSTMT StatementHandle,
            SQLSMALLINT ParameterScale, PTR ParameterValue,
            SQLLEN *StrLen_or_Ind)
 {
-   MYLOG(0, "[SQLSetParam]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    SC_clear_error((StatementClass *) StatementHandle);
 
    /*
@@ -696,7 +696,7 @@ SQLSpecialColumns(HSTMT StatementHandle,
    StatementClass *stmt = (StatementClass *) StatementHandle;
    SQLCHAR *ctName = CatalogName, *scName = SchemaName, *tbName = TableName;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -762,7 +762,7 @@ SQLStatistics(HSTMT StatementHandle,
    StatementClass *stmt = (StatementClass *) StatementHandle;
    SQLCHAR *ctName = CatalogName, *scName = SchemaName, *tbName = TableName;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -829,7 +829,7 @@ SQLTables(HSTMT StatementHandle,
    SQLCHAR *ctName = CatalogName, *scName = SchemaName, *tbName = TableName;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -904,7 +904,7 @@ SQLColumnPrivileges(HSTMT hstmt,
        *tbName = szTableName, *clName = szColumnName;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -979,7 +979,7 @@ SQLDescribeParam(HSTMT hstmt,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[SQLDescribeParam]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1007,7 +1007,7 @@ SQLExtendedFetch(HSTMT hstmt,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[SQLExtendedFetch]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1054,7 +1054,7 @@ SQLForeignKeys(HSTMT hstmt,
        *pktbName = szPkTableName, *fkctName = szFkCatalogName,
        *fkscName = szFkSchemaName, *fktbName = szFkTableName;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1139,7 +1139,7 @@ SQLMoreResults(HSTMT hstmt)
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[SQLMoreResults]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1164,7 +1164,7 @@ SQLNativeSql(HDBC hdbc,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[SQLNativeSql]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -1182,7 +1182,7 @@ SQLNumParams(HSTMT hstmt,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[SQLNumParams]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1211,7 +1211,7 @@ SQLPrimaryKeys(HSTMT hstmt,
    SQLCHAR *ctName = szCatalogName, *scName = szSchemaName,
        *tbName = szTableName;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1281,7 +1281,7 @@ SQLProcedureColumns(HSTMT hstmt,
        *prName = szProcName, *clName = szColumnName;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1360,7 +1360,7 @@ SQLProcedures(HSTMT hstmt,
        *prName = szProcName;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1425,7 +1425,7 @@ SQLSetPos(HSTMT hstmt,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[SQLSetPos]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1455,7 +1455,7 @@ SQLTablePrivileges(HSTMT hstmt,
        *tbName = szTableName;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1525,7 +1525,7 @@ SQLBindParameter(HSTMT hstmt,
    RETCODE ret;
    StatementClass *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[SQLBindParameter]");
+   MYLOG(0, "[%s]\n", __FUNCTION__);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
    StartRollbackState(stmt);
index db67621cf3989b8d7e6244d5ae4f16c242162e55..d30e4c83a7103b1216b40cefadec8526624cd9a6 100644 (file)
@@ -38,7 +38,7 @@ SQLAllocHandle(SQLSMALLINT HandleType,
    RETCODE     ret;
    ConnectionClass *conn;
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
    switch (HandleType)
    {
        case SQL_HANDLE_ENV:
@@ -86,7 +86,7 @@ SQLBindParam(HSTMT StatementHandle,
    StatementClass  *stmt = (StatementClass *) StatementHandle;
    int         BufferLength = 512;     /* Is it OK ? */
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
    StartRollbackState(stmt);
@@ -104,7 +104,7 @@ SQLCloseCursor(HSTMT StatementHandle)
    StatementClass  *stmt = (StatementClass *) StatementHandle;
    RETCODE ret;
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -137,7 +137,7 @@ SQLColAttribute(SQLHSTMT StatementHandle,
    RETCODE ret;
    StatementClass  *stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -174,7 +174,7 @@ SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle,
    CSTR    func = "SQLEndTran";
    RETCODE ret;
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
    switch (HandleType)
    {
        case SQL_HANDLE_ENV:
@@ -254,7 +254,7 @@ SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
    StatementClass *stmt;
    ConnectionClass *conn = NULL;
 
-   MYLOG(0, "[[%s]]", func);
+   MYLOG(0, "[[%s]]\n", func);
 
    switch (HandleType)
    {
@@ -300,7 +300,7 @@ SQLGetDescField(SQLHDESC DescriptorHandle,
 {
    RETCODE ret;
 
-   MYLOG(0, "[[SQLGetDescField]]\n");
+   MYLOG(0, "[[%s]]\n", __FUNCTION__);
    ret = PGAPI_GetDescField(DescriptorHandle, RecNumber, FieldIdentifier,
            Value, BufferLength, StringLength);
    return ret;
@@ -315,7 +315,7 @@ SQLGetDescRec(SQLHDESC DescriptorHandle,
              SQLLEN *Length, SQLSMALLINT *Precision,
              SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
 {
-   MYLOG(0, "[[SQLGetDescRec]]\n");
+   MYLOG(0, "[[%s]]\n", __FUNCTION__);
    MYLOG(0, "Error not implemented\n");
    return SQL_ERROR;
 }
@@ -345,7 +345,7 @@ SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
 {
    RETCODE ret;
 
-   MYLOG(0, "[[SQLGetDiagRec]]\n");
+   MYLOG(0, "[[%s]]\n", __FUNCTION__);
    ret = PGAPI_GetDiagRec(HandleType, Handle, RecNumber, Sqlstate,
            NativeError, MessageText, BufferLength, TextLength);
    return ret;
@@ -361,7 +361,7 @@ SQLGetEnvAttr(HENV EnvironmentHandle,
    RETCODE ret;
    EnvironmentClass *env = (EnvironmentClass *) EnvironmentHandle;
 
-   MYLOG(0, "[[SQLGetEnvAttr]] %d\n", Attribute);
+   MYLOG(0, "[[%s]] %d\n", __FUNCTION__, Attribute);
    ENTER_ENV_CS(env);
    ret = SQL_SUCCESS;
    switch (Attribute)
@@ -395,7 +395,7 @@ SQLGetConnectAttr(HDBC ConnectionHandle,
 {
    RETCODE ret;
 
-   MYLOG(0, "[[SQLGetConnectAttr]] %d\n", Attribute);
+   MYLOG(0, "[[%s]] %d\n", __FUNCTION__, Attribute);
    CC_examine_global_transaction((ConnectionClass*) ConnectionHandle);
    ENTER_CONN_CS((ConnectionClass *) ConnectionHandle);
    CC_clear_error((ConnectionClass *) ConnectionHandle);
@@ -435,7 +435,7 @@ SQLSetConnectAttr(HDBC ConnectionHandle,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
 
-   MYLOG(0, "[[SQLSetConnectAttr]] %d\n", Attribute);
+   MYLOG(0, "[[%s]] %d\n", __FUNCTION__, Attribute);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -453,7 +453,7 @@ SQLSetDescField(SQLHDESC DescriptorHandle,
 {
    RETCODE     ret;
 
-   MYLOG(0, "[[SQLSetDescField]] h=%p rec=%d field=%d val=%p\n", DescriptorHandle, RecNumber, FieldIdentifier, Value);
+   MYLOG(0, "[[%s]] h=%p rec=%d field=%d val=%p\n", __FUNCTION__, DescriptorHandle, RecNumber, FieldIdentifier, Value);
    ret = PGAPI_SetDescField(DescriptorHandle, RecNumber, FieldIdentifier,
                Value, BufferLength);
    return ret;
@@ -485,7 +485,7 @@ SQLSetEnvAttr(HENV EnvironmentHandle,
    RETCODE ret;
    EnvironmentClass *env = (EnvironmentClass *) EnvironmentHandle;
 
-   MYLOG(0, "[[SQLSetEnvAttr]] att=%d," FORMAT_ULEN "\n", Attribute, (SQLULEN) Value);
+   MYLOG(0, "[[%s]] att=%d," FORMAT_ULEN "\n", __FUNCTION__, Attribute, (SQLULEN) Value);
    ENTER_ENV_CS(env);
    switch (Attribute)
    {
index 50261d099d6e6d0ed9878f6fdff4cbe74d351cdb..35153391a84e2095e2df6d5ef2bfaff32c6630f3 100644 (file)
@@ -34,7 +34,7 @@ SQLGetStmtAttrW(SQLHSTMT hstmt,
    RETCODE ret;
    StatementClass  *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    ENTER_STMT_CS((StatementClass *) hstmt);
    SC_clear_error((StatementClass *) hstmt);
    StartRollbackState(stmt);
@@ -55,7 +55,7 @@ SQLSetStmtAttrW(SQLHSTMT hstmt,
    RETCODE ret;
    StatementClass  *stmt = (StatementClass *) hstmt;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
    StartRollbackState(stmt);
@@ -76,7 +76,7 @@ SQLGetConnectAttrW(HDBC hdbc,
    CSTR func = "SQLGetConnectAttrW";
    RETCODE ret;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    CC_examine_global_transaction((ConnectionClass *) hdbc);
    ENTER_CONN_CS((ConnectionClass *) hdbc);
    CC_clear_error((ConnectionClass *) hdbc);
@@ -96,7 +96,7 @@ SQLSetConnectAttrW(HDBC hdbc,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -119,7 +119,7 @@ SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber,
         char    *uval = NULL;
    BOOL    val_alloced = FALSE;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (BufferLength > 0 || SQL_NTS == BufferLength)
    {
        switch (FieldIdentifier)
@@ -162,7 +162,7 @@ SQLGetDescFieldW(SQLHDESC hdesc, SQLSMALLINT iRecord, SQLSMALLINT iField,
    SQLINTEGER      blen = 0, bMax, *pcbV;
         char    *rgbV = NULL, *rgbVt;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    switch (iField)
    {
        case SQL_DESC_BASE_COLUMN_NAME:
@@ -231,7 +231,7 @@ SQLGetDiagRecW(SQLSMALLINT fHandleType,
         SQLSMALLINT    buflen, tlen;
         char    qstr_ansi[8], *mtxt = NULL;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    buflen = 0;
         if (szErrorMsg && cbErrorMsgMax > 0)
    {
@@ -289,7 +289,7 @@ SQLColAttributeW(SQLHSTMT   hstmt,
    SQLSMALLINT *rgbL, blen = 0, bMax;
         char    *rgbD = NULL, *rgbDt;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -434,7 +434,7 @@ SQLGetDescRecW(SQLHDESC DescriptorHandle,
              SQLLEN *Length, SQLSMALLINT *Precision,
              SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
 {
-   MYLOG(0, "[[SQLGetDescRecW]]\n");
+   MYLOG(0, "[[%s]]\n", __FUNCTION__);
    MYLOG(0, "Error not implemented\n");
    return SQL_ERROR;
 }
index befb038e0a072bb5a02e3efbee8f3f108e915882..c2393f1280775e230376eed84aaf05f047799a94 100644 (file)
@@ -43,7 +43,7 @@ SQLColumnsW(HSTMT StatementHandle,
    UWORD   flag = PODBC_SEARCH_PUBLIC_SCHEMA;
    ConnInfo    *ci;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -98,7 +98,7 @@ SQLConnectW(HDBC ConnectionHandle,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -138,7 +138,7 @@ SQLDriverConnectW(HDBC hdbc,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -209,7 +209,7 @@ SQLBrowseConnectW(HDBC          hdbc,
    RETCODE ret;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -246,7 +246,7 @@ SQLDataSourcesW(HENV EnvironmentHandle,
                SQLSMALLINT *NameLength2)
 {
    CSTR func = "SQLDataSourcesW";
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    /*
    return PGAPI_DataSources(EnvironmentHandle, Direction, ServerName,
        BufferLength1, NameLength1, Description, BufferLength2,
@@ -268,7 +268,7 @@ SQLDescribeColW(HSTMT StatementHandle,
    SQLSMALLINT buflen, nmlen;
    char    *clName = NULL, *clNamet = NULL;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -330,7 +330,7 @@ SQLExecDirectW(HSTMT StatementHandle,
    StatementClass  *stmt = (StatementClass *) StatementHandle;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -362,7 +362,7 @@ SQLGetCursorNameW(HSTMT StatementHandle,
    char    *crName = NULL, *crNamet;
    SQLSMALLINT clen, buflen;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (BufferLength > 0)
        buflen = BufferLength * 3;
    else
@@ -417,7 +417,7 @@ SQLGetInfoW(HDBC ConnectionHandle,
    ENTER_CONN_CS(conn);
    CC_set_in_unicode_driver(conn);
    CC_clear_error(conn);
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if ((ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
                             BufferLength, StringLength)) == SQL_ERROR)
        CC_log_error("SQLGetInfoW", "", conn);
@@ -435,7 +435,7 @@ SQLPrepareW(HSTMT StatementHandle,
    char    *stxt;
    SQLLEN  slen;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -464,7 +464,7 @@ SQLSetCursorNameW(HSTMT StatementHandle,
    char    *crName;
    SQLLEN  nlen;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    crName = ucs2_to_utf8(CursorName, NameLength, &nlen, FALSE);
    ENTER_STMT_CS(stmt);
    SC_clear_error(stmt);
@@ -493,7 +493,7 @@ SQLSpecialColumnsW(HSTMT StatementHandle,
    ConnectionClass *conn;
    BOOL lower_id;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -539,7 +539,7 @@ SQLStatisticsW(HSTMT StatementHandle,
    ConnectionClass *conn;
    BOOL lower_id;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -586,7 +586,7 @@ SQLTablesW(HSTMT StatementHandle,
    BOOL lower_id;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -642,7 +642,7 @@ SQLColumnPrivilegesW(HSTMT          hstmt,
    BOOL    lower_id;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -702,7 +702,7 @@ SQLForeignKeysW(HSTMT           hstmt,
    ConnectionClass *conn;
    BOOL    lower_id;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -759,7 +759,7 @@ SQLNativeSqlW(HDBC          hdbc,
    SQLINTEGER  buflen, olen;
    ConnectionClass *conn = (ConnectionClass *) hdbc;
 
-   MYLOG(0, "[%s}", func);
+   MYLOG(0, "[%s}\n", func);
    CC_examine_global_transaction(conn);
    ENTER_CONN_CS(conn);
    CC_clear_error(conn);
@@ -822,7 +822,7 @@ SQLPrimaryKeysW(HSTMT           hstmt,
    ConnectionClass *conn;
    BOOL    lower_id;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -872,7 +872,7 @@ SQLProcedureColumnsW(HSTMT          hstmt,
    BOOL    lower_id;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    conn = SC_get_conn(stmt);
    lower_id = SC_is_lower_case(stmt, conn);
    ctName = ucs2_to_utf8(szCatalogName, cbCatalogName, &nmlen1, lower_id);
@@ -924,7 +924,7 @@ SQLProceduresW(HSTMT        hstmt,
    BOOL    lower_id;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -975,7 +975,7 @@ SQLTablePrivilegesW(HSTMT           hstmt,
    BOOL    lower_id;
    UWORD   flag = 0;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
@@ -1016,7 +1016,7 @@ SQLGetTypeInfoW(SQLHSTMT  StatementHandle,
    RETCODE ret;
    StatementClass * stmt = (StatementClass *) StatementHandle;
 
-   MYLOG(0, "[%s]", func);
+   MYLOG(0, "[%s]\n", func);
    if (SC_connection_lost_check(stmt, __FUNCTION__))
        return SQL_ERROR;
 
index ae1b58cf3e416a4a784f914e71f667f63208c82b..4f12e0f502806a7a09a7d0c145e0570079987ef5 100644 (file)
--- a/options.c
+++ b/options.c
@@ -79,7 +79,7 @@ set_statement_option(ConnectionClass *conn,
            }
            if (setval != vParam)
                changed = TRUE;
-           MYLOG(0, "-> " FORMAT_LEN "\n", setval);
+           MYPRINTF(0, "-> " FORMAT_LEN "\n", setval);
            break;
 
        case SQL_CURSOR_TYPE:
@@ -123,7 +123,7 @@ set_statement_option(ConnectionClass *conn,
            }
            if (setval != vParam)
                changed = TRUE;
-           MYLOG(0, "-> " FORMAT_LEN "\n", setval);
+           MYPRINTF(0, "-> " FORMAT_LEN "\n", setval);
            break;
 
        case SQL_KEYSET_SIZE:   /* ignored, but saved and returned  */
@@ -547,7 +547,7 @@ PGAPI_GetConnectOption(HDBC hdbc,
 #endif /* SQL_ATTR_CONNECTION_DEAD */
            MYLOG(0, "CONNECTION_DEAD status=%d", conn->status);
            *((SQLUINTEGER *) pvParam) = CC_not_connected(conn);
-           MYLOG(0, " val=%d\n", *((SQLUINTEGER *) pvParam));
+           MYPRINTF(0, " val=%d\n", *((SQLUINTEGER *) pvParam));
                         break;
 
        case SQL_ATTR_ANSI_APP:
diff --git a/parse.c b/parse.c
index 0855515be7490129844ddeecc4112fd06c247441..ba1fe00f72dcea5483f2d02b1b1f5292ee31f8b8 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -613,14 +613,14 @@ MYLOG(1, "has_multi_table ntab=%d", stmt->ntab);
                    reloid = greloid;
                else if (reloid != greloid)
                {
-MYLOG(1, " dohhhhhh");
+MYPRINTF(1, " DOHHH i=%d %u!=%u ", i, reloid, greloid);
                    multi_table = TRUE;
                    break;
                }
            }
        }
    }
-MYLOG(1, " multi=%d\n", multi_table);
+MYPRINTF(1, " multi=%d\n", multi_table);
    return multi_table;
 }
 /*
@@ -667,7 +667,7 @@ MYLOG(0, "updatable=%d tab=%d fields=%d", updatable, stmt->ntab, num_fields);
        else if (has_multi_table(stmt))
            updatable = FALSE;
    }
-MYLOG(0, "->%d\n", updatable);
+MYPRINTF(0, "->%d\n", updatable);
    if (stmt->updatable < 0)
        SC_set_updatable(stmt, updatable);
    for (i = 0; i < num_fields; i++)
@@ -1352,11 +1352,11 @@ parse_the_statement(StatementClass *stmt, BOOL check_hasoids, BOOL sqlsvr_check)
                    if (stmt->from_pos < 0 &&
                        (!strnicmp(pptr, "from", 4)))
                    {
-                       MYLOG(0, "First ");
+                       MYLOG(0, "First From\n");
                        stmt->from_pos = pptr - stmt->statement;
                    }
-
-                   MYLOG(0, "FROM\n");
+                   else
+                       MYLOG(0, "FROM\n");
                    continue;
                }
            } /* in_select && unquoted && blevel == 0 */
index c955cd55ad58a3e64feb59207e28848edcbd81bd..ba27b7b40ed94b3983fe323fec40227986c2309e 100644 (file)
--- a/pgapi30.c
+++ b/pgapi30.c
@@ -90,7 +90,7 @@ PGAPI_GetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
    int     rtnctype = SQL_C_CHAR;
    CSTR func = "PGAPI_GetDiagField";
 
-   MYLOG(0, "%s entering rec=%d", func, RecNumber);
+   MYLOG(0, "%s entering rec=%d\n", func, RecNumber);
    switch (HandleType)
    {
        case SQL_HANDLE_ENV:
index 888642faf1f581efac40b1769604a981f041ae60..58ad2c2f17b35a78bfb84d6b596883bf427cdaee 100644 (file)
--- a/results.c
+++ b/results.c
@@ -688,9 +688,11 @@ MYLOG(1, "answering bookmark info\n");
            /* otherwise same as column name -- FALL THROUGH!!! */
 
        case SQL_DESC_NAME:
-MYLOG(1, "fi=%p", fi);
-if (fi)
-MYLOG(1, " (%s,%s)", PRINT_NAME(fi->column_alias), PRINT_NAME(fi->column_name));
+           MYLOG(1, "fi=%p (alias, name)=", fi);
+           if (fi)
+               MYPRINTF(1, "(%s,%s)\n", PRINT_NAME(fi->column_alias), PRINT_NAME(fi->column_name));
+           else
+               MYPRINTF(1, "NULL\n");
            p = fi ? (NAME_IS_NULL(fi->column_alias) ? SAFE_NAME(fi->column_name) : GET_NAME(fi->column_alias)) : QR_get_fieldname(res, col_idx);
 
            MYLOG(0, "%s: COLUMN_NAME = '%s'\n", func, p);
@@ -992,7 +994,7 @@ PGAPI_GetData(HSTMT hstmt,
            case SQL_C_VARBOOKMARK:
                break;
            default:
-MYLOG(1, "GetData Column 0 is type %d not of type SQL_C_BOOKMARK", target_type);
+MYLOG(1, "GetData Column 0 is type %d not of type SQL_C_BOOKMARK\n", target_type);
                SC_set_error(stmt, STMT_PROGRAM_TYPE_OUT_OF_RANGE, "Column 0 is not of type SQL_C_BOOKMARK", func);
                return SQL_ERROR;
        }
@@ -1229,6 +1231,7 @@ getNthValid(const QResultClass *res, SQLLEN sta, UWORD orientation,
 MYLOG(1, "get " FORMAT_ULEN "th Valid data from " FORMAT_LEN " to %s [dlt=%d]", nth, sta, orientation == SQL_FETCH_PRIOR ? "backward" : "forward", res->dl_count);
    if (0 == res->dl_count)
    {
+       MYPRINTF(1, "\n");
        if (SQL_FETCH_PRIOR == orientation)
        {
            if (sta + 1 >= (SQLLEN) nth)
@@ -1261,9 +1264,10 @@ MYLOG(1, "get " FORMAT_ULEN "th Valid data from " FORMAT_LEN " to %s [dlt=%d]",
        {
            *nearest = sta + 1 - nth;
            delsta = (-1);
+           MYPRINTF(1, "deleted ");
            for (i = res->dl_count - 1; i >=0 && *nearest <= deleted[i]; i--)
            {
-MYLOG(1, "deleted[" FORMAT_LEN "]=" FORMAT_LEN "\n", i, deleted[i]);
+               MYPRINTF(1, "[" FORMAT_LEN "]=" FORMAT_LEN " ", i, deleted[i]);
                if (sta >= deleted[i])
                {
                    (*nearest)--;
@@ -1271,7 +1275,7 @@ MYLOG(1, "deleted[" FORMAT_LEN "]=" FORMAT_LEN "\n", i, deleted[i]);
                        delsta = i;
                }
            }
-MYLOG(1, "nearest=" FORMAT_LEN "\n", *nearest);
+           MYPRINTF(1, "nearest=" FORMAT_LEN "\n", *nearest);
            if (*nearest < 0)
            {
                *nearest = -1;
@@ -1282,6 +1286,7 @@ MYLOG(1, "nearest=" FORMAT_LEN "\n", *nearest);
        }
        else
        {
+           MYPRINTF(1, "\n");
            *nearest = sta - 1 + nth;
            delsta = res->dl_count;
            if (!QR_once_reached_eof(res))
@@ -1312,7 +1317,7 @@ MYLOG(1, "nearest=" FORMAT_LEN "\n", *nearest);
            if (0 == (keyset->status & (CURS_SELF_DELETING | CURS_SELF_DELETED | CURS_OTHER_DELETED)))
            {
                *nearest = i;
-MYLOG(1, " nearest=" FORMAT_LEN "\n", *nearest);
+MYPRINTF(1, " nearest=" FORMAT_LEN "\n", *nearest);
                if (++count == nth)
                    return count;
            }
@@ -1327,14 +1332,14 @@ MYLOG(1, " nearest=" FORMAT_LEN "\n", *nearest);
            if (0 == (keyset->status & (CURS_SELF_DELETING | CURS_SELF_DELETED | CURS_OTHER_DELETED)))
            {
                *nearest = i;
-MYLOG(1, " nearest=" FORMAT_LEN "\n", *nearest);
+MYPRINTF(1, " nearest=" FORMAT_LEN "\n", *nearest);
                if (++count == nth)
                    return count;
            }
        }
        *nearest = num_tuples;
    }
-MYLOG(1, " nearest not found\n");
+MYPRINTF(1, " nearest not found\n");
    return -(SQLLEN)count;
 }
 
@@ -2752,7 +2757,7 @@ DiscardRollback(StatementClass *stmt, QResultClass *res)
    KeySet  *keyset;
    BOOL    kres_is_valid;
 
-MYLOG(1, "DiscardRollback");
+MYLOG(1, "DiscardRollback\n");
    if (QR_get_cursor(res))
    {
        CommitAdded(res);
@@ -2815,6 +2820,7 @@ UndoRollback(StatementClass *stmt, QResultClass *res, BOOL partial)
        int     doubtp;
        int j;
 
+       MYLOG(1, "");
        for (i = 0, doubtp = 0; i < res->rb_count; i++)
        {
            keys.status = 0;
@@ -2822,7 +2828,7 @@ UndoRollback(StatementClass *stmt, QResultClass *res, BOOL partial)
            keys.offset = rollback[i].offset;
            keys.oid = rollback[i].oid;
            texist = tupleExists(stmt, &keys);
-MYLOG(1, "texist[%d]=%d", i, texist);
+MYPRINTF(1, "texist[%d]=%d", i, texist);
            if (SQL_ADD == rollback[i].option)
            {
                if (texist)
@@ -2840,10 +2846,10 @@ MYLOG(1, "texist[%d]=%d", i, texist);
                if (doubtp == i)
                    doubtp = i + 1;
            }
-MYLOG(1, " doubtp=%d\n", doubtp);
+MYPRINTF(1, " (doubtp=%d)", doubtp);
        }
        rollbp = i;
-MYLOG(1, " doubtp=%d,rollbp=%d\n", doubtp, rollbp);
+MYPRINTF(1, " doubtp=%d,rollbp=%d\n", doubtp, rollbp);
        do
        {
            rollbps = rollbp;
@@ -2944,11 +2950,11 @@ MYLOG(1, " index=" FORMAT_LEN " status=%hx", index, status);
                continue;
            else
            {
-MYLOG(1, " (%u, %u)", wkey->blocknum,  wkey->offset);
+MYPRINTF(1, " (%u, %u)", wkey->blocknum,  wkey->offset);
                wkey->blocknum = rollback[i].blocknum;
                wkey->offset = rollback[i].offset;
                wkey->oid = rollback[i].oid;
-MYLOG(1, "->(%u, %u)\n", wkey->blocknum, wkey->offset);
+MYPRINTF(1, "->(%u, %u)", wkey->blocknum, wkey->offset);
                wkey->status &= ~KEYSET_INFO_PUBLIC;
                if (SQL_DELETE == rollback[i].option)
                    wkey->status &= ~CURS_SELF_DELETING;
@@ -2974,6 +2980,7 @@ MYLOG(1, "->(%u, %u)\n", wkey->blocknum, wkey->offset);
            }
        }
    }
+   MYPRINTF(1, "\n");
    res->rb_count = rollbp;
    if (0 == rollbp)
    {
@@ -4786,11 +4793,11 @@ RETCODE spos_callback(RETCODE retcode, void *para)
    else if (SC_get_IRDF(s->stmt)->rowsFetched)
        *(SC_get_IRDF(s->stmt)->rowsFetched) = s->processed;
    res->recent_processed_row_count = s->stmt->diag_row_count = s->processed;
-if (opts)
-{
-MYLOG(1, "processed=" FORMAT_POSIROW " ret=%d rowset=" FORMAT_LEN, s->processed, ret, opts->size_of_rowset_odbc2);
-MYLOG(1, "," FORMAT_LEN "\n", opts->size_of_rowset);
-}
+   if (opts) /* logging */
+   {
+       MYLOG(1, "processed=" FORMAT_POSIROW " ret=%d rowset=" FORMAT_LEN, s->processed, ret, opts->size_of_rowset_odbc2);
+       MYPRINTF(1, "," FORMAT_LEN "\n", opts->size_of_rowset);
+   }
 
    return ret;
 }
index 35d5cbadefaf02986aff37561c7565a4856fc2bd..c277ab1313abff3d68631f675aff6acca552e2fa 100644 (file)
@@ -519,7 +519,7 @@ SC_init_Result(StatementClass *self)
 {
    self->result = self->curres = NULL;
    self->curr_param_result = 0;
-   MYLOG(0, "SC_init_Result(%p)", self);
+   MYLOG(0, "SC_init_Result(%p)\n", self);
 }
 
 void
@@ -527,7 +527,7 @@ SC_set_Result(StatementClass *self, QResultClass *res)
 {
    if (res != self->result)
    {
-       MYLOG(0, "SC_set_Result(%p, %p)", self, res);
+       MYLOG(0, "SC_set_Result(%p, %p)\n", self, res);
        QR_Destructor(self->result);
        self->result = self->curres = res;
        if (NULL != res)
@@ -597,7 +597,7 @@ MYLOG(1, "%p->SC_set_rowstart " FORMAT_LEN "->" FORMAT_LEN "(%s) ", stmt, stmt->
    if (res != NULL)
    {
        BOOL    valid = QR_has_valid_base(res);
-MYLOG(1, ":(%p)QR is %s", res, QR_has_valid_base(res) ? "valid" : "unknown");
+MYPRINTF(1, ":(%p)QR is %s", res, QR_has_valid_base(res) ? "valid" : "unknown");
 
        if (valid)
        {
@@ -616,10 +616,10 @@ MYLOG(1, ":(%p)QR is %s", res, QR_has_valid_base(res) ? "valid" : "unknown");
        }
        if (!QR_get_cursor(res))
            res->key_base = start;
-MYLOG(1, ":(%p)QR result=" FORMAT_LEN "(%s)", res, QR_get_rowstart_in_cache(res), QR_has_valid_base(res) ? "valid" : "unknown");
+MYPRINTF(1, ":(%p)QR result=" FORMAT_LEN "(%s)", res, QR_get_rowstart_in_cache(res), QR_has_valid_base(res) ? "valid" : "unknown");
    }
    stmt->rowset_start = start;
-MYLOG(1, ":stmt result=" FORMAT_LEN "\n", stmt->rowset_start);
+MYPRINTF(1, ":stmt result=" FORMAT_LEN "\n", stmt->rowset_start);
 }
 void
 SC_inc_rowset_start(StatementClass *stmt, SQLLEN inc)
index 733cd8cf78d0f7a044174f455989dae04cd3e512..7e80e4b117743431584e0ab570e1b05b107aa1c4 100644 (file)
@@ -132,7 +132,7 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen, BOOL lowe
 {
    char *  utf8str;
    int len = 0;
-/*MYLOG(0, "ucs2_to_utf8 %p ilen=%d ", ucs2str, ilen);*/
+MYLOG(0, "ucs2_to_utf8 %p ilen=%d ", ucs2str, ilen);
 
    if (!ucs2str)
    {
@@ -147,7 +147,7 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen, BOOL lowe
    }
    if (ilen < 0)
        ilen = ucs2strlen(ucs2str);
-MYLOG(0, " newlen=" FORMAT_LEN, ilen);
+MYPRINTF(0, " newlen=" FORMAT_LEN, ilen);
    utf8str = (char *) malloc(ilen * 4 + 1);
    if (utf8str)
    {
@@ -226,7 +226,7 @@ MYLOG(0, " newlen=" FORMAT_LEN, ilen);
        if (olen)
            *olen = len;
    }
-MYLOG(0, " %s:olen=%d utf8str=%s\n", __FUNCTION__, len, utf8str ? utf8str : "");
+MYPRINTF(0, " %s:olen=%d utf8str=%s\n", __FUNCTION__, len, utf8str ? utf8str : "");
    return utf8str;
 }
 
@@ -263,10 +263,10 @@ utf8_to_ucs2_lf(const char *utf8str, SQLLEN ilen, BOOL lfconv,
    SQLULEN     rtn, ocount, wcode;
    const UCHAR *str;
 
-/*MYLOG(0, "utf8_to_ucs2 ilen=%d bufcount=%d", ilen, bufcount);*/
+MYLOG(1, "utf8_to_ucs2 ilen=%d bufcount=%d", ilen, bufcount);
    if (!utf8str)
        return 0;
-/*MYLOG(0, " string=%s\n", utf8str);*/
+MYPRINTF(1, " string=%s\n", utf8str);
 
    if (!bufcount)
        ucs2str = NULL;
@@ -390,7 +390,7 @@ cleanup:
    }
    if (ocount < bufcount && ucs2str)
        ucs2str[ocount] = 0;
-/*MYLOG(0, " ocount=%d\n", ocount);*/
+MYPRINTF(1, " ocount=%d\n", ocount);
    return rtn;
 }
 
@@ -539,7 +539,7 @@ SQLULEN utf8_to_ucs4_lf(const char *utf8str, SQLLEN ilen, BOOL lfconv,
 MYLOG(0, " %s:ilen=" FORMAT_LEN " bufcount=" FORMAT_ULEN "\n", __FUNCTION__, ilen, bufcount);
    if (!utf8str)
        return 0;
-/*MYLOG(0, " string=%s\n", utf8str);*/
+MYLOG(99, " string=%s\n", utf8str);
 
    if (!bufcount)
        ucs4str = NULL;