if (strcmp(QR_get_fieldname(qres, 0), TRANSACTION_ISOLATION) == 0)
{
conn->server_isolation = isolation_str_to_enum(QR_get_value_backend_text(qres, 0, 0));
- MYLOG(0, "isolation %d to be %d\n", conn->server_isolation, conn->isolation);
+ MYLOG(0, "isolation " FORMAT_UINTEGER " to be " FORMAT_UINTEGER "\n", conn->server_isolation, conn->isolation);
if (0 == conn->isolation)
conn->isolation = conn->server_isolation;
if (0 == conn->default_isolation)
isolation = self->server_isolation;
}
QR_Destructor(res);
-MYLOG(0, "isolation=%d\n", isolation);
+MYLOG(0, "isolation=" FORMAT_UINTEGER "\n", isolation);
return isolation;
}
qp->from_pos = stmt->from_pos;
qp->where_pos = stmt->where_pos;
}
-MYLOG(DETAIL_LOG_LEVEL, "type=%d concur=%d\n", stmt->options.cursor_type, stmt->options.scroll_concurrency);
+MYLOG(DETAIL_LOG_LEVEL, "type=" FORMAT_UINTEGER " concur=" FORMAT_UINTEGER "\n", stmt->options.cursor_type, stmt->options.scroll_concurrency);
}
SC_miscinfo_clear(stmt);
targethd->desc_type = srchd->desc_type;
}
ard_src = &(src->ardf);
-MYPRINTF(DETAIL_LOG_LEVEL, " rowset_size=" FORMAT_LEN " bind_size=%d ope_ptr=%p off_ptr=%p\n",
+MYPRINTF(DETAIL_LOG_LEVEL, " rowset_size=" FORMAT_LEN " bind_size=" FORMAT_UINTEGER " 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);
ConnectionClass *conn = (ConnectionClass *) hdbc;
RETCODE result;
- MYLOG(0, "entering...cbSqlStrIn=%d\n", cbSqlStrIn);
+ MYLOG(0, "entering...cbSqlStrIn=" FORMAT_INTEGER "\n", cbSqlStrIn);
ptr = (cbSqlStrIn == 0) ? "" : make_string(szSqlStrIn, cbSqlStrIn, NULL, 0);
if (!ptr)
length = strlen((char *) s);
else
{
- MYLOG(0, "invalid length=%d\n", len);
+ MYLOG(0, "invalid length=" FORMAT_INTEGER "\n", len);
return NULL;
}
if (buf)
RETCODE ret;
EnvironmentClass *env = (EnvironmentClass *) EnvironmentHandle;
- MYLOG(0, "Entering %d\n", Attribute);
+ MYLOG(0, "Entering " FORMAT_INTEGER "\n", Attribute);
ENTER_ENV_CS(env);
ret = SQL_SUCCESS;
switch (Attribute)
{
RETCODE ret;
- MYLOG(0, "Entering %d\n", Attribute);
+ MYLOG(0, "Entering " FORMAT_UINTEGER "\n", Attribute);
CC_examine_global_transaction((ConnectionClass*) ConnectionHandle);
ENTER_CONN_CS((ConnectionClass *) ConnectionHandle);
CC_clear_error((ConnectionClass *) ConnectionHandle);
RETCODE ret;
StatementClass *stmt = (StatementClass *) StatementHandle;
- MYLOG(0, "Entering Handle=%p %d\n", StatementHandle, Attribute);
+ MYLOG(0, "Entering Handle=%p " FORMAT_INTEGER "\n", StatementHandle, Attribute);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
RETCODE ret;
ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
- MYLOG(0, "Entering %d\n", Attribute);
+ MYLOG(0, "Entering " FORMAT_INTEGER "\n", Attribute);
CC_examine_global_transaction(conn);
ENTER_CONN_CS(conn);
CC_clear_error(conn);
RETCODE ret;
EnvironmentClass *env = (EnvironmentClass *) EnvironmentHandle;
- MYLOG(0, "Entering att=%d," FORMAT_ULEN "\n", Attribute, (SQLULEN) Value);
+ MYLOG(0, "Entering att=" FORMAT_INTEGER "," FORMAT_ULEN "\n", Attribute, (SQLULEN) Value);
ENTER_ENV_CS(env);
switch (Attribute)
{
StatementClass *stmt = (StatementClass *) StatementHandle;
RETCODE ret;
- MYLOG(0, "Entering Handle=%p %d," FORMAT_ULEN "\n", StatementHandle, Attribute, (SQLULEN) Value);
+ MYLOG(0, "Entering Handle=%p " FORMAT_INTEGER "," FORMAT_ULEN "\n", StatementHandle, Attribute, (SQLULEN) Value);
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
StartRollbackState(stmt);
#endif /* SQL_ATTR_CONNECTION_DEAD */
MYLOG(0, "CONNECTION_DEAD status=%d", conn->status);
*((SQLUINTEGER *) pvParam) = CC_not_connected(conn);
- MYPRINTF(0, " val=%d\n", *((SQLUINTEGER *) pvParam));
+ MYPRINTF(0, " val=" FORMAT_UINTEGER "\n", *((SQLUINTEGER *) pvParam));
break;
case SQL_ATTR_ANSI_APP:
*((SQLUINTEGER *) pvParam) = CC_is_in_ansi_app(conn);
- MYLOG(0, "ANSI_APP val=%d\n", *((SQLUINTEGER *) pvParam));
+ MYLOG(0, "ANSI_APP val=" FORMAT_UINTEGER "\n", *((SQLUINTEGER *) pvParam));
break;
/* These options should be handled by driver manager */
break;
case SQL_CONCURRENCY: /* NOT REALLY SUPPORTED */
- MYLOG(0, "SQL_CONCURRENCY %d\n", stmt->options.scroll_concurrency);
+ MYLOG(0, "SQL_CONCURRENCY " FORMAT_INTEGER "\n", stmt->options.scroll_concurrency);
*((SQLINTEGER *) pvParam) = stmt->options.scroll_concurrency;
break;
case SQL_CURSOR_TYPE: /* PARTIAL SUPPORT */
- MYLOG(0, "SQL_CURSOR_TYPE %d\n", stmt->options.cursor_type);
+ MYLOG(0, "SQL_CURSOR_TYPE " FORMAT_INTEGER "\n", stmt->options.cursor_type);
*((SQLINTEGER *) pvParam) = stmt->options.cursor_type;
break;
RETCODE ret = SQL_SUCCESS;
SQLINTEGER len = 4;
- MYLOG(0, "entering %d\n", Attribute);
+ MYLOG(0, "entering " FORMAT_INTEGER "\n", Attribute);
switch (Attribute)
{
case SQL_ATTR_ASYNC_ENABLE:
RETCODE ret = SQL_SUCCESS;
SQLINTEGER len = 0;
- MYLOG(0, "entering Handle=%p %d\n", StatementHandle, Attribute);
+ MYLOG(0, "entering Handle=%p " FORMAT_INTEGER "\n", StatementHandle, Attribute);
switch (Attribute)
{
case SQL_ATTR_FETCH_BOOKMARK_PTR: /* 16 */
BOOL unsupported = FALSE;
int newValue;
- MYLOG(0, "entering for %p: %d %p\n", ConnectionHandle, Attribute, Value);
+ MYLOG(0, "entering for %p: " FORMAT_INTEGER " %p\n", ConnectionHandle, Attribute, Value);
switch (Attribute)
{
case SQL_ATTR_METADATA_ID:
RETCODE ret = SQL_SUCCESS;
DescriptorClass *desc = (DescriptorClass *) DescriptorHandle;
- MYLOG(0, "entering h=%p rec=%d field=%d blen=%d\n", DescriptorHandle, RecNumber, FieldIdentifier, BufferLength);
+ MYLOG(0, "entering h=%p rec=" FORMAT_SMALLI " field=" FORMAT_SMALLI " blen=" FORMAT_INTEGER "\n", DescriptorHandle, RecNumber, FieldIdentifier, BufferLength);
switch (DC_get_desc_type(desc))
{
case SQL_ATTR_APP_ROW_DESC:
RETCODE ret = SQL_SUCCESS;
DescriptorClass *desc = (DescriptorClass *) DescriptorHandle;
- MYLOG(0, "entering h=%p(%d) rec=%d field=%d val=%p,%d\n", DescriptorHandle, DC_get_desc_type(desc), RecNumber, FieldIdentifier, Value, BufferLength);
+ MYLOG(0, "entering h=%p(%d) rec=" FORMAT_SMALLI " field=" FORMAT_SMALLI " val=%p," FORMAT_INTEGER "\n", DescriptorHandle, DC_get_desc_type(desc), RecNumber, FieldIdentifier, Value, BufferLength);
switch (DC_get_desc_type(desc))
{
case SQL_ATTR_APP_ROW_DESC:
CSTR func = "PGAPI_SetStmtAttr";
StatementClass *stmt = (StatementClass *) StatementHandle;
- MYLOG(0, "entering Handle=%p %d," FORMAT_ULEN "(%p)\n", StatementHandle, Attribute, (SQLULEN) Value, Value);
+ MYLOG(0, "entering Handle=%p " FORMAT_INTEGER "," FORMAT_ULEN "(%p)\n", StatementHandle, Attribute, (SQLULEN) Value, Value);
switch (Attribute)
{
case SQL_ATTR_ENABLE_AUTO_IPD: /* 15 */
#define SQL_FALSE FALSE
#endif /* SQL_FALSE */
+#define FORMAT_SMALLI "%d" /* SQLSMALLINT */
+#define FORMAT_USMALLI "%u" /* SQLUSMALLINT */
#ifdef WIN32
#ifndef SSIZE_T_DEFINED
#define ssize_t SSIZE_T
{
SQLLEN tuple_size = self->count_backend_allocated;
- MYLOG(0, "REALLOC: old_count = " FORMAT_LEN ", size = " FORMAT_SIZE_T "\n", tuple_size, self->num_fields * sizeof(TupleField) * tuple_size);
+ MYLOG(0, "REALLOC: old_count = " FORMAT_LEN ", size = " FORMAT_SIZE_T "\n", tuple_size, (size_t) (self->num_fields * sizeof(TupleField) * tuple_size));
if (tuple_size < 1)
tuple_size = TUPLE_MALLOC_INC;
else
appendData = TRUE;
else
{
-MYLOG(DETAIL_LOG_LEVEL, "total " FORMAT_LEN " <> backend " FORMAT_LEN " - base " FORMAT_LEN " + start " FORMAT_LEN " cursor_type=%d\n",
+MYLOG(DETAIL_LOG_LEVEL, "total " FORMAT_LEN " <> backend " FORMAT_LEN " - base " FORMAT_LEN " + start " FORMAT_LEN " cursor_type=" FORMAT_UINTEGER "\n",
num_total_rows, num_cached_rows,
QR_get_rowstart_in_cache(res), SC_get_rowset_start(stmt), stmt->options.cursor_type);
}
}
if (appendData)
{
-MYLOG(DETAIL_LOG_LEVEL, "total " FORMAT_LEN " == backend " FORMAT_LEN " - base " FORMAT_LEN " + start " FORMAT_LEN " cursor_type=%d\n",
+MYLOG(DETAIL_LOG_LEVEL, "total " FORMAT_LEN " == backend " FORMAT_LEN " - base " FORMAT_LEN " + start " FORMAT_LEN " cursor_type=" FORMAT_UINTEGER "\n",
num_total_rows, num_cached_rows,
QR_get_rowstart_in_cache(res), SC_get_rowset_start(stmt), stmt->options.cursor_type);
if (num_cached_rows >= res->count_backend_allocated)
QueryInfo *qryi = NULL;
qflag |= (SQL_CONCUR_READ_ONLY != self->options.scroll_concurrency ? CREATE_KEYSET : 0);
- MYLOG(0, " Sending SELECT statement on stmt=%p, cursor_name='%s' qflag=%d,%d\n", self, SC_cursor_name(self), qflag, self->options.scroll_concurrency);
+ MYLOG(0, " Sending SELECT statement on stmt=%p, cursor_name='%s' qflag=%d," FORMAT_UINTEGER "\n", self, SC_cursor_name(self), qflag, self->options.scroll_concurrency);
/* send the declare/select */
if (useCursor)
QLOG(level, " stmt_with_params='%s'\n", NULLCHECK(self->stmt_with_params));
QLOG(level, " data_at_exec=%d, current_exec_param=%d, put_data=%d\n", self->data_at_exec, self->current_exec_param, self->put_data);
QLOG(level, " currTuple=" FORMAT_LEN ", current_col=%d, lobj_fd=%d\n", self->currTuple, self->current_col, self->lobj_fd);
- QLOG(level, " maxRows=" FORMAT_LEN ", rowset_size=" FORMAT_LEN ", keyset_size=" FORMAT_LEN ", cursor_type=%u, scroll_concurrency=%d\n", self->options.maxRows, rowsetSize, self->options.keyset_size, self->options.cursor_type, self->options.scroll_concurrency);
+ QLOG(level, " maxRows=" FORMAT_LEN ", rowset_size=" FORMAT_LEN ", keyset_size=" FORMAT_LEN ", cursor_type=" FORMAT_UINTEGER ", scroll_concurrency=" FORMAT_UINTEGER "\n", self->options.maxRows, rowsetSize, self->options.keyset_size, self->options.cursor_type, self->options.scroll_concurrency);
QLOG(level, " cursor_name='%s'\n", SC_cursor_name(self));
QLOG(level, " ----------------QResult Info -------------------------------\n");
printf("\n");
/* Check that the driver didn't write past the buffer */
if ((unsigned char) resultbuf[buflen] != 0xFF)
- printf("Driver wrote byte %02X past result buffer of size %d!\n", (unsigned char) resultbuf[buflen], buflen);
+ printf("For %s Driver wrote byte %02X past result buffer of size %d!\n", sql, (unsigned char) resultbuf[buflen], buflen);
}
else
{
const char *cdt;
mbstate_t mbst = initial_state;
-MYLOG(0, " c16dt=%p size=%lu\n", c16dt, n);
+MYLOG(0, " c16dt=%p size=" FORMAT_SIZE_T "\n", c16dt, n);
for (i = 0, cdt = c8dt; i < n || (!c16dt); i++)
{
if (lf_conv && PG_LINEFEED == *cdt && i > 0 && PG_CARRIAGE_RETURN != cdt[-1])
char *cdt, c4byte[4];
mbstate_t mbst = initial_state;
-MYLOG(0, " c8dt=%p size=%lu\n", c8dt, n);
+MYLOG(0, " c8dt=%p size=" FORMAT_SIZE_T "u\n", c8dt, n);
if (!c8dt)
n = 0;
for (i = 0, cdt = c8dt; c16dt[i] && (result < n || (!cdt)); i++)