aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/odbc/convert.c2
-rw-r--r--src/interfaces/odbc/qresult.c3
-rw-r--r--src/interfaces/odbc/results.c2
-rw-r--r--src/interfaces/odbc/socket.h7
4 files changed, 11 insertions, 3 deletions
diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c
index 72cb6feb0e5..1389c7ca3a4 100644
--- a/src/interfaces/odbc/convert.c
+++ b/src/interfaces/odbc/convert.c
@@ -120,7 +120,7 @@ struct tm *tim;
st.d = tim->tm_mday;
st.y = tim->tm_year + 1900;
- mylog("copy_and_convert: field_type = %d, fctype = %d, value = '%s', cbValueMax=%d\n", field_type, fCType, value, cbValueMax);
+ mylog("copy_and_convert: field_type = %d, fctype = %d, value = '%s', cbValueMax=%d\n", field_type, fCType, (value==NULL)?"<NULL>":value, cbValueMax);
if ( ! value) {
/* handle a null just by returning SQL_NULL_DATA in pcbValue, */
diff --git a/src/interfaces/odbc/qresult.c b/src/interfaces/odbc/qresult.c
index 714063516e0..cae730d8ae2 100644
--- a/src/interfaces/odbc/qresult.c
+++ b/src/interfaces/odbc/qresult.c
@@ -186,7 +186,8 @@ QR_fetch_tuples(QResultClass *self, ConnectionClass *conn, char *cursor)
if (conn != NULL) {
self->conn = conn;
- mylog("QR_fetch_tuples: cursor = '%s', self->cursor=%u\n", cursor, self->cursor);
+ mylog("QR_fetch_tuples: cursor = '%s', self->cursor=%u\n",
+ (cursor==NULL)?"":cursor, self->cursor);
if (self->cursor)
free(self->cursor);
diff --git a/src/interfaces/odbc/results.c b/src/interfaces/odbc/results.c
index 5d9dfc30fbb..6bac9d0ede5 100644
--- a/src/interfaces/odbc/results.c
+++ b/src/interfaces/odbc/results.c
@@ -855,7 +855,7 @@ mylog("SQLFetch: stmt = %u, stmt->result= %u\n", stmt, stmt->result);
value = QR_get_value_backend_row(res, stmt->currTuple, lf);
}
- mylog("value = '%s'\n", value);
+ mylog("value = '%s'\n", (value==NULL)?"<NULL>":value);
retval = copy_and_convert_field_bindinfo(stmt, type, value, lf);
diff --git a/src/interfaces/odbc/socket.h b/src/interfaces/odbc/socket.h
index d57d012a48f..50418f9942f 100644
--- a/src/interfaces/odbc/socket.h
+++ b/src/interfaces/odbc/socket.h
@@ -23,6 +23,13 @@
#include <arpa/inet.h>
#define closesocket(xxx) close(xxx)
#define SOCKETFD int
+#ifndef INADDR_NONE
+#ifndef _IN_ADDR_T
+#define _IN_ADDR_T
+typedef unsigned int in_addr_t;
+#endif
+#define INADDR_NONE ((in_addr_t)-1)
+#endif
#else
#include <winsock.h>
#define SOCKETFD SOCKET