getpid() instead of _getpid()
authorHiroshi Inoue <inoue@tpf.co.jp>
Fri, 20 Oct 2006 12:00:32 +0000 (12:00 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Fri, 20 Oct 2006 12:00:32 +0000 (12:00 +0000)
SQLGetInfo(SQL_NULL_COLLATION) now returns SQL_NC_HIGH instead of SQL_NC_END

info.c
mylog.c
psqlodbc.h
version.h

diff --git a/info.c b/info.c
index 7a15981b1b1e8cfa30c59b5ae94095f9ed023508..658a2d3a3f2c4145a0846076e82e0711205213f4 100644 (file)
--- a/info.c
+++ b/info.c
@@ -506,7 +506,10 @@ mylog("CONVERT_FUNCTIONS=" FORMAT_ULEN "\n", value);
        case SQL_NULL_COLLATION:        /* ODBC 2.0 */
            /* where are nulls sorted? */
            len = 2;
-           value = SQL_NC_END;
+           if (PG_VERSION_GE(conn, 7.2))
+               value = SQL_NC_HIGH;
+           else
+               value = SQL_NC_END;
            break;
 
        case SQL_NUMERIC_FUNCTIONS:     /* ODBC 1.0 */
diff --git a/mylog.c b/mylog.c
index efcf3b3a803f1cfbc8e897f30c8115b442fb756a..fccf675ade1ae758716763aacc40d7ce3de3148f 100644 (file)
--- a/mylog.c
+++ b/mylog.c
@@ -35,14 +35,14 @@ void        generate_filename(const char *, const char *, char *);
 void
 generate_filename(const char *dirname, const char *prefix, char *filename)
 {
-   int         pid = 0;
+   int pid = 0;
 
 #ifndef WIN32
    struct passwd *ptr = 0;
 
    ptr = getpwuid(getuid());
 #endif
-   pid = _getpid();
+   pid = getpid();
    if (dirname == 0 || filename == 0)
        return;
 
@@ -112,6 +112,10 @@ logs_on_off(int cnopen, int mylog_onoff, int qlog_onoff)
    LEAVE_MYLOG_CS;
 }
 
+#ifdef LOGGING_PROCESS_TIME
+#include <mmsystem.h>
+   static  DWORD   start_time = 0;
+#endif /* LOGGING_PROCESS_TIME */
 #ifdef MY_LOG
 static FILE *MLOGFP = NULL;
 void
@@ -122,6 +126,10 @@ mylog(char *fmt,...)
 
    if (!mylog_on)  return;
    ENTER_MYLOG_CS;
+#ifdef LOGGING_PROCESS_TIME
+   if (!start_time)
+       start_time = timeGetTime();
+#endif /* LOGGING_PROCESS_TIME */
    va_start(args, fmt);
 
    if (!MLOGFP)
@@ -135,12 +143,19 @@ mylog(char *fmt,...)
 #ifdef WIN_MULTITHREAD_SUPPORT
 #ifdef WIN32
    if (MLOGFP)
-       fprintf(MLOGFP, "[%d]", GetCurrentThreadId());
+#ifdef LOGGING_PROCESS_TIME
+   {
+       DWORD   proc_time = timeGetTime() - start_time;
+       fprintf(MLOGFP, "[%u-%d.%03d]", GetCurrentThreadId(), proc_time / 1000, proc_time % 1000);
+   }
+#else
+       fprintf(MLOGFP, "[%u]", GetCurrentThreadId());
+#endif /* LOGGING_PROCESS_TIME */
 #endif /* WIN32 */
 #endif /* WIN_MULTITHREAD_SUPPORT */
 #if defined(POSIX_MULTITHREAD_SUPPORT)
    if (MLOGFP)
-       fprintf(MLOGFP, "[%u]", pthread_self());
+       fprintf(MLOGFP, "[%lu]", pthread_self());
 #endif /* POSIX_MULTITHREAD_SUPPORT */
    if (MLOGFP)
        vfprintf(MLOGFP, fmt, args);
index 7ad5675284edf9cb180b59d682df6b5025c4dc8c..c78cb46140b41241ef88d1df9c60ab6ff930fc5a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Comments:       See "notice.txt" for copyright and license information.
  *
- * $Id: psqlodbc.h,v 1.112 2006/10/17 16:18:56 hinoue Exp $
+ * $Id: psqlodbc.h,v 1.113 2006/10/20 12:00:32 hinoue Exp $
  *
  */
 
@@ -130,7 +130,7 @@ typedef unsigned long long ULONG_PTR;
 #define    FORMAT_LPTR "%lld"  /* LONG_PTR */
 #define    FORMAT_ULPTR    "%llu"  /* ULONG_PTR */
 #else
-#error neither long nor long long is define
+#error appropriate long pointer type not foun
 #endif /* SIZE_OF_VOID_P */
 #if (SIZE_OF_VOID_P == 8)
 #define    FORMAT_INTEGER  "%d"    /* SQLINTEGER */
index 3b6a263e61de871d60322ed3642643d9a62a9fed..e2c42189da7e55cb94ee9f179b63116236059a9b 100644 (file)
--- a/version.h
+++ b/version.h
@@ -11,6 +11,6 @@
 
 #define POSTGRESDRIVERVERSION      "08.02.0104"
 #define POSTGRES_RESOURCE_VERSION  "08.02.0104\0"
-#define PG_DRVFILE_VERSION     8,2,01,04
+#define PG_DRVFILE_VERSION     8,2,01,04 
 
 #endif