enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn::simple_command_handle_response");
- DBG_INF_FMT("silent=%d packet=%d command=%s", silent, ok_packet, mysqlnd_command_to_text[command]);
+ DBG_INF_FMT("silent=%u packet=%u command=%s", silent, ok_packet, mysqlnd_command_to_text[command]);
switch (ok_packet) {
case PROT_OK_PACKET:{
if (FAIL == (ret = PACKET_READ(ok_response, conn))) {
if (!silent) {
DBG_ERR_FMT("Error while reading %s's OK packet", mysqlnd_command_to_text[command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading %s's OK packet. PID=%d",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading %s's OK packet. PID=%u",
mysqlnd_command_to_text[command], getpid());
}
} else {
}
default:
SET_CLIENT_ERROR(conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet");
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong response packet %d passed to the function", ok_packet);
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong response packet %u passed to the function", ok_packet);
break;
}
DBG_INF(ret == PASS ? "PASS":"FAIL");
MYSQLND_PACKET_COMMAND * cmd_packet;
DBG_ENTER("mysqlnd_conn::simple_command");
- DBG_INF_FMT("command=%s ok_packet=%d silent=%d", mysqlnd_command_to_text[command], ok_packet, silent);
+ DBG_INF_FMT("command=%s ok_packet=%u silent=%u", mysqlnd_command_to_text[command], ok_packet, silent);
switch (CONN_GET_STATE(conn)) {
case CONN_READY:
DBG_RETURN(FAIL);
default:
SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
- DBG_ERR_FMT("Command out of sync. State=%d", CONN_GET_STATE(conn));
+ DBG_ERR_FMT("Command out of sync. State=%u", CONN_GET_STATE(conn));
DBG_RETURN(FAIL);
}
} else if (ok_packet->field_count == 0xFF) {
if (ok_packet->sqlstate[0]) {
strlcpy(conn->error_info.sqlstate, ok_packet->sqlstate, sizeof(conn->error_info.sqlstate));
- DBG_ERR_FMT("ERROR:%d [SQLSTATE:%s] %s", ok_packet->error_no, ok_packet->sqlstate, ok_packet->error);
+ DBG_ERR_FMT("ERROR:%u [SQLSTATE:%s] %s", ok_packet->error_no, ok_packet->sqlstate, ok_packet->error);
}
conn->error_info.error_no = ok_packet->error_no;
strlcpy(conn->error_info.error, ok_packet->error, sizeof(conn->error_info.error));
DBG_ENTER("mysqlnd_conn::connect");
- DBG_INF_FMT("host=%s user=%s db=%s port=%d flags=%d persistent=%d state=%d",
+ DBG_INF_FMT("host=%s user=%s db=%s port=%u flags=%u persistent=%u state=%u",
host?host:"", user?user:"", db?db:"", port, mysql_flags,
conn? conn->persistent:0, conn? CONN_GET_STATE(conn):-1);
if (conn && CONN_GET_STATE(conn) > CONN_ALLOCED && CONN_GET_STATE(conn) ) {
- DBG_INF_FMT("state=%d", CONN_GET_STATE(conn));
DBG_INF("Connecting on a connected handle.");
if (CONN_GET_STATE(conn) < CONN_QUIT_SENT) {
if (!port) {
port = 3306;
}
- transport_len = spprintf(&transport, 0, "tcp://%s:%d", host, port);
+ transport_len = spprintf(&transport, 0, "tcp://%s:%u", host, port);
}
if (!transport) {
SET_OOM_ERROR(conn->error_info);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
goto err;
} else if (greet_packet->error_no) {
- DBG_ERR_FMT("errorno=%d error=%s", greet_packet->error_no, greet_packet->error);
+ DBG_ERR_FMT("errorno=%u error=%s", greet_packet->error_no, greet_packet->error);
SET_CLIENT_ERROR(conn->error_info, greet_packet->error_no, greet_packet->sqlstate, greet_packet->error);
goto err;
} else if (greet_packet->pre41) {
PACKET_FREE(greet_packet);
if (errstr) {
- DBG_ERR_FMT("[%d] %.64s (trying to connect via %s)", errcode, errstr, conn->scheme);
+ DBG_ERR_FMT("[%u] %.64s (trying to connect via %s)", errcode, errstr, conn->scheme);
SET_CLIENT_ERROR(conn->error_info, errcode? errcode:CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, errstr);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] %.64s (trying to connect via %s)", errcode, errstr, conn->scheme);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%u] %.64s (trying to connect via %s)", errcode, errstr, conn->scheme);
/* no mnd_ since we don't allocate it */
efree(errstr);
}
zend_bool self_alloced = FALSE;
DBG_ENTER("mysqlnd_connect");
- DBG_INF_FMT("host=%s user=%s db=%s port=%d flags=%d", host?host:"", user?user:"", db?db:"", port, mysql_flags);
+ DBG_INF_FMT("host=%s user=%s db=%s port=%u flags=%u", host?host:"", user?user:"", db?db:"", port, mysql_flags);
if (!conn) {
self_alloced = TRUE;
if (state <= CONN_READY || state == CONN_QUIT_SENT) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection not opened, clear or has been closed");
- DBG_ERR_FMT("Connection not opened, clear or has been closed. State=%d", state);
+ DBG_ERR_FMT("Connection not opened, clear or has been closed. State=%u", state);
DBG_RETURN(FAIL);
}
DBG_RETURN(conn->m->query_read_result_set_header(conn, NULL TSRMLS_CC));
MYSQLND_RES *result = NULL;
DBG_ENTER("mysqlnd_conn::list_method");
- DBG_INF_FMT("conn=%llu query=%s wild=%d", conn->thread_id, query, achtung_wild);
+ DBG_INF_FMT("conn=%llu query=%s wild=%u", conn->thread_id, query, achtung_wild);
if (par1) {
if (achtung_wild) {
*/
SET_ERROR_AFF_ROWS(conn);
- DBG_INF_FMT("ret=%d", ret);
+ DBG_INF_FMT("ret=%u", ret);
DBG_RETURN(ret);
}
/* }}} */
MYSQLND_METHOD_PRIVATE(mysqlnd_conn, set_state)(MYSQLND * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC)
{
DBG_ENTER("mysqlnd_conn::set_state");
- DBG_INF_FMT("New state=%d", new_state);
+ DBG_INF_FMT("New state=%u", new_state);
conn->state = new_state;
DBG_VOID_RETURN;
}
So there are no more results and we should just return FALSE, error_no has been set
*/
if (!conn->error_info.error_no) {
- DBG_ERR_FMT("Serious error. %s::%d", __FILE__, __LINE__);
+ DBG_ERR_FMT("Serious error. %s::%u", __FILE__, __LINE__);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious error. PID=%d", getpid());
CONN_SET_STATE(conn, CONN_QUIT_SENT);
} else {
- DBG_INF_FMT("Error from the server : (%d) %s", conn->error_info.error_no, conn->error_info.error);
+ DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info.error_no, conn->error_info.error);
}
}
const MYSQLND_CHARSET * old_cs = conn->charset;
DBG_ENTER("mysqlnd_conn::change_user");
- DBG_INF_FMT("conn=%llu user=%s passwd=%s db=%s silent=%d",
+ DBG_INF_FMT("conn=%llu user=%s passwd=%s db=%s silent=%u",
conn->thread_id, user?user:"", passwd?"***":"null", db?db:"", (silent == TRUE)?1:0 );
SET_ERROR_AFF_ROWS(conn);
if (redundant_error_packet) {
PACKET_READ(redundant_error_packet, conn);
PACKET_FREE(redundant_error_packet);
- DBG_INF_FMT("Server is %d, buggy, sends two ERR messages", mysqlnd_get_server_version(conn));
+ DBG_INF_FMT("Server is %u, buggy, sends two ERR messages", mysqlnd_get_server_version(conn));
} else {
SET_OOM_ERROR(conn->error_info);
}
{
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn::set_client_option");
- DBG_INF_FMT("conn=%llu option=%d", conn->thread_id, option);
+ DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
switch (option) {
#ifdef WHEN_SUPPORTED_BY_MYSQLI
case MYSQL_OPT_COMPRESS:
MYSQLND *ret = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_init");
- DBG_INF_FMT("persistent=%d", persistent);
+ DBG_INF_FMT("persistent=%u", persistent);
if (!ret) {
DBG_RETURN(NULL);
}
}
#endif
- DBG_INF_FMT("size=%lu ptr=%p persistent=%d", size, ret, persistent);
+ DBG_INF_FMT("size=%lu ptr=%p persistent=%u", size, ret, persistent);
if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? STAT_MEM_MALLOC_COUNT:STAT_MEM_EMALLOC_COUNT;
long * threshold = persistent? &MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold);
DBG_ENTER(mysqlnd_perealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
- DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persist=%d", ptr, old_size, new_size, persistent);
+ DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent);
#ifdef PHP_DEBUG
/* -1 is also "true" */
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
DBG_ENTER(mysqlnd_pefree_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
- DBG_INF_FMT("ptr=%p persistent=%d", ptr, persistent);
+ DBG_INF_FMT("ptr=%p persistent=%u", ptr, persistent);
if (ptr) {
if (collect_memory_statistics) {
size_t to_be_sent;
DBG_ENTER("mysqlnd_net::send");
- DBG_INF_FMT("conn=%llu count=%lu compression=%d", conn->thread_id, count, net->compressed);
+ DBG_INF_FMT("conn=%llu count=%lu compression=%u", conn->thread_id, count, net->compressed);
net->stream->chunk_size = MYSQLND_MAX_PACKET_SIZE;
if (net->compressed == TRUE) {
size_t comp_buf_size = MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE + MIN(left, MYSQLND_MAX_PACKET_SIZE);
- DBG_INF_FMT("compress_buf_size=%d", comp_buf_size);
+ DBG_INF_FMT("compress_buf_size="MYSQLND_SZ_T_SPEC, comp_buf_size);
compress_buf = mnd_emalloc(comp_buf_size);
}
int3store(compress_buf, payload_size);
int1store(compress_buf + 3, net->packet_no);
- DBG_INF_FMT("writing %d bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
+ DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
ret = conn->net->m.network_write(conn, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE TSRMLS_CC);
net->compressed_envelope_packet_no++;
#if WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
*/
} while (ret && (left > 0 || to_be_sent == MYSQLND_MAX_PACKET_SIZE));
- DBG_INF_FMT("packet_size=%d packet_no=%d", left, net->packet_no);
+ DBG_INF_FMT("packet_size="MYSQLND_SZ_T_SPEC" packet_no=%u", left, net->packet_no);
/* Even for zero size payload we have to send a packet */
if (!ret) {
DBG_ERR_FMT("Can't %u send bytes", count);
DBG_ENTER("mysqlnd_net::decode");
error = uncompress(uncompressed_data, &tmp_complen, compressed_data, compressed_data_len);
- DBG_INF_FMT("compressed data: decomp_len=%d compressed_size=%d", tmp_complen, compressed_data_len);
+ DBG_INF_FMT("compressed data: decomp_len=%lu compressed_size="MYSQLND_SZ_T_SPEC, tmp_complen, compressed_data_len);
if (error != Z_OK) {
DBG_INF_FMT("decompression NOT successful. error=%d Z_OK=%d Z_BUF_ERROR=%d Z_MEM_ERROR=%d", error, Z_OK, Z_BUF_ERROR, Z_MEM_ERROR);
}
if (error != Z_OK) {
DBG_INF_FMT("compression NOT successful. error=%d Z_OK=%d Z_BUF_ERROR=%d Z_MEM_ERROR=%d", error, Z_OK, Z_BUF_ERROR, Z_MEM_ERROR);
} else {
- DBG_INF_FMT("compression successful. compressed size=%d", tmp_complen);
+ DBG_INF_FMT("compression successful. compressed size=%lu", tmp_complen);
}
DBG_RETURN(error == Z_OK? PASS:FAIL);
#else
net_payload_size = uint3korr(net_header);
packet_no = uint1korr(net_header + 3);
if (net->compressed_envelope_packet_no != packet_no) {
- DBG_ERR_FMT("Transport level: packets out of order. Expected %d received %d. Packet size=%d",
+ DBG_ERR_FMT("Transport level: packets out of order. Expected %u received %u. Packet size="MYSQLND_SZ_T_SPEC,
net->compressed_envelope_packet_no, packet_no, net_payload_size);
- php_error(E_WARNING, "Packets out of order. Expected %d received %d. Packet size="MYSQLND_SZ_T_SPEC,
+ php_error(E_WARNING, "Packets out of order. Expected %u received %u. Packet size="MYSQLND_SZ_T_SPEC,
net->compressed_envelope_packet_no, packet_no, net_payload_size);
DBG_RETURN(FAIL);
}
net->compressed_envelope_packet_no++;
#ifdef MYSQLND_DUMP_HEADER_N_BODY
- DBG_INF_FMT("HEADER: hwd_packet_no=%d size=%3d", packet_no, net_payload_size);
+ DBG_INF_FMT("HEADER: hwd_packet_no=%u size=%3u", packet_no, (unsigned long) net_payload_size);
#endif
/* Now let's read from the wire, decompress it and fill the read buffer */
mysqlnd_read_compressed_packet_from_stream_and_fill_read_buffer(conn, net_payload_size TSRMLS_CC);
MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mysqlnd_option option, const char * const value TSRMLS_DC)
{
DBG_ENTER("mysqlnd_net::set_client_option");
- DBG_INF_FMT("option=%d", option);
+ DBG_INF_FMT("option=%u", option);
switch (option) {
case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
DBG_INF("MYSQLND_OPT_NET_CMD_BUFFER_SIZE");
MYSQLND_NET * net = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_net_init");
- DBG_INF_FMT("persistent=%d", persistent);
+ DBG_INF_FMT("persistent=%u", persistent);
if (net) {
net->persistent = persistent;
net->m = mysqlnd_mysqlnd_net_methods;
use_result() or store_result() and we should be able to scrap the
data on the line, if he just decides to close the statement.
*/
- DBG_INF_FMT("server_status=%d cursor=%d", stmt->upsert_status.server_status,
+ DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status.server_status,
stmt->upsert_status.server_status & SERVER_STATUS_CURSOR_EXISTS);
if (stmt->upsert_status.server_status & SERVER_STATUS_CURSOR_EXISTS) {
}
if (not_bound) {
char * msg;
- spprintf(&msg, 0, "No data supplied for %d parameter%s in prepared statement",
+ spprintf(&msg, 0, "No data supplied for %u parameter%s in prepared statement",
not_bound, not_bound>1 ?"s":"");
SET_STMT_ERROR(stmt, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, msg);
if (msg) {
#endif
/* copy the type */
if (stmt->result_bind[i].bound == TRUE) {
- DBG_INF_FMT("i=%d type=%d", i, Z_TYPE_P(current_row[i]));
+ DBG_INF_FMT("i=%u type=%u", i, Z_TYPE_P(current_row[i]));
if (Z_TYPE_P(current_row[i]) != IS_NULL) {
/*
Copy the value.
}
}
- DBG_INF_FMT("ret=%s fetched_anything=%d", ret == PASS? "PASS":"FAIL", *fetched_anything);
+ DBG_INF_FMT("ret=%s fetched_anything=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
DBG_RETURN(ret);
}
/* }}} */
if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) {
unsigned int i, field_count = result->field_count;
- DBG_INF_FMT("skip_extraction=%d", row_packet->skip_extraction);
+ DBG_INF_FMT("skip_extraction=%u", row_packet->skip_extraction);
if (!row_packet->skip_extraction) {
result->m.unbuffered_free_last_data(result TSRMLS_CC);
#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
zval_dtor(stmt->result_bind[i].zv);
#endif
- DBG_INF_FMT("i=%d bound_var=%p type=%d refc=%u", i, stmt->result_bind[i].zv,
+ DBG_INF_FMT("i=%u bound_var=%p type=%u refc=%u", i, stmt->result_bind[i].zv,
Z_TYPE_P(data), Z_REFCOUNT_P(stmt->result_bind[i].zv));
if (IS_NULL != (Z_TYPE_P(stmt->result_bind[i].zv) = Z_TYPE_P(data))) {
if ((Z_TYPE_P(data) == IS_STRING
stmt->conn->upsert_status.server_status =
row_packet->server_status;
- DBG_INF_FMT("ret=%s fetched=%d server_status=%d warnings=%d eof=%d",
+ DBG_INF_FMT("ret=%s fetched=%u server_status=%u warnings=%u eof=%u",
ret == PASS? "PASS":"FAIL", *fetched_anything,
row_packet->server_status, row_packet->warning_count,
result->unbuf->eof_reached);
SET_EMPTY_ERROR(stmt->error_info);
SET_EMPTY_ERROR(stmt->conn->error_info);
- DBG_INF_FMT("result_bind=%p separated_once=%d", stmt->result_bind, stmt->result_zvals_separated_once);
+ DBG_INF_FMT("result_bind=%p separated_once=%u", stmt->result_bind, stmt->result_zvals_separated_once);
/*
The user might have not bound any variables for result.
Do the binding once she does it.
if (!stmt || !stmt->conn) {
DBG_RETURN(FAIL);
}
- DBG_INF_FMT("stmt=%lu param_no=%d data_len=%lu", stmt->stmt_id, param_no, length);
+ DBG_INF_FMT("stmt=%lu param_no=%u data_len=%lu", stmt->stmt_id, param_no, length);
conn = stmt->conn;
stmt->param_bind = param_bind;
for (i = 0; i < stmt->param_count; i++) {
/* The client will use stmt_send_long_data */
- DBG_INF_FMT("%d is of type %d", i, stmt->param_bind[i].type);
+ DBG_INF_FMT("%u is of type %u", i, stmt->param_bind[i].type);
/* Prevent from freeing */
/* Don't update is_ref, or we will leak during conversion */
Z_ADDREF_P(stmt->param_bind[i].zv);
if (!stmt || !stmt->conn) {
DBG_RETURN(FAIL);
}
- DBG_INF_FMT("stmt=%lu param_no=%d param_count=%u type=%d",
+ DBG_INF_FMT("stmt=%lu param_no=%u param_count=%u type=%u",
stmt->stmt_id, param_no, stmt->param_count, type);
if (stmt->state < MYSQLND_STMT_PREPARED) {
for (i = 0; i < stmt->field_count; i++) {
/* Let's try with no cache */
if (stmt->result_bind[i].bound == TRUE) {
- DBG_INF_FMT("%d has refcount=%u", i, Z_REFCOUNT_P(stmt->result_bind[i].zv));
+ DBG_INF_FMT("%u has refcount=%u", i, Z_REFCOUNT_P(stmt->result_bind[i].zv));
/*
We have to separate the actual zval value of the bound
variable from our allocated zvals or we will face double-free
if (!stmt) {
DBG_VOID_RETURN;
}
- DBG_INF_FMT("stmt=%lu result_bind=%p field_count=%u param_no=%d",
+ DBG_INF_FMT("stmt=%lu result_bind=%p field_count=%u param_no=%u",
stmt->stmt_id, stmt->result_bind, stmt->field_count, param_no);
if (!stmt->result_bind) {
*/
/* Let's try with no cache */
if (stmt->result_bind[param_no].bound == TRUE) {
- DBG_INF_FMT("%d has refcount=%u", param_no, Z_REFCOUNT_P(stmt->result_bind[param_no].zv));
+ DBG_INF_FMT("%u has refcount=%u", param_no, Z_REFCOUNT_P(stmt->result_bind[param_no].zv));
/*
We have to separate the actual zval value of the bound
variable from our allocated zvals or we will face double-free
clean.
*/
do {
- DBG_INF_FMT("stmt->state=%d", stmt->state);
+ DBG_INF_FMT("stmt->state=%u", stmt->state);
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("fetching result set header");
stmt->default_rset_handler(s TSRMLS_CC);
size_t tmp_len = 0;
zend_bool is_bit = field->type == MYSQL_TYPE_BIT;
DBG_ENTER("ps_fetch_from_1_to_8_bytes");
- DBG_INF_FMT("zv=%p byte_count=%d", zv, byte_count);
+ DBG_INF_FMT("zv=%p byte_count=%u", zv, byte_count);
if (field->flags & UNSIGNED_FLAG) {
uint64_t uval = 0;
}
mysqlnd_palloc_zval_ptr_dtor(&(current_row[col]), result->type, ©_ctor_called TSRMLS_CC);
#if MYSQLND_DEBUG_MEMORY
- DBG_INF_FMT("Copy_ctor_called=%d", copy_ctor_called);
+ DBG_INF_FMT("Copy_ctor_called=%u", copy_ctor_called);
#endif
MYSQLND_INC_GLOBAL_STATISTIC(copy_ctor_called? STAT_COPY_ON_WRITE_PERFORMED:
STAT_COPY_ON_WRITE_SAVED);
MYSQLND_PACKET_EOF * fields_eof = NULL;
DBG_ENTER("mysqlnd_query_read_result_set_header");
- DBG_INF_FMT("stmt=%d", stmt? stmt->stmt_id:0);
+ DBG_INF_FMT("stmt=%lu", stmt? stmt->stmt_id:0);
ret = FAIL;
do {
} else if (ret == FAIL) {
if (row_packet->error_info.error_no) {
result->conn->error_info = row_packet->error_info;
- DBG_ERR_FMT("errorno=%d error=%s", row_packet->error_info.error_no, row_packet->error_info.error);
+ DBG_ERR_FMT("errorno=%u error=%s", row_packet->error_info.error_no, row_packet->error_info.error);
}
CONN_SET_STATE(result->conn, CONN_READY);
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
MYSQLND_PACKET_ROW *row_packet = result->row_packet;
DBG_ENTER("mysqlnd_fetch_row_unbuffered");
- DBG_INF_FMT("flags=%d", flags);
+ DBG_INF_FMT("flags=%u", flags);
*fetched_anything = FALSE;
if (result->unbuf->eof_reached) {
} else if (ret == FAIL) {
if (row_packet->error_info.error_no) {
result->conn->error_info = row_packet->error_info;
- DBG_ERR_FMT("errorno=%d error=%s", row_packet->error_info.error_no, row_packet->error_info.error);
+ DBG_ERR_FMT("errorno=%u error=%s", row_packet->error_info.error_no, row_packet->error_info.error);
}
CONN_SET_STATE(result->conn, CONN_READY);
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
result->m.unbuffered_free_last_data(result TSRMLS_CC);
}
- DBG_INF_FMT("ret=%s fetched=%d", ret == PASS? "PASS":"FAIL", *fetched_anything);
+ DBG_INF_FMT("ret=%s fetched=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
DBG_RETURN(PASS);
}
/* }}} */
MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps TSRMLS_DC)
{
DBG_ENTER("mysqlnd_res::use_result");
- DBG_INF_FMT("ps=%d", ps);
+ DBG_INF_FMT("ps=%u", ps);
SET_EMPTY_ERROR(result->conn->error_info);
ret = PASS;
DBG_INF("EOF reached");
}
- DBG_INF_FMT("ret=PASS fetched=%d", *fetched_anything);
+ DBG_INF_FMT("ret=PASS fetched=%u", *fetched_anything);
DBG_RETURN(ret);
}
/* }}} */
MYSQLND_RES_BUFFERED *set;
DBG_ENTER("mysqlnd_res::store_result_fetch_data");
- DBG_INF_FMT("conn=%llu binary_proto=%d to_cache=%d",
+ DBG_INF_FMT("conn=%llu binary_proto=%u to_cache=%u",
conn->thread_id, binary_protocol, to_cache);
result->stored_data = set = mnd_pecalloc(1, sizeof(MYSQLND_RES_BUFFERED), to_cache);
zend_bool to_cache = FALSE;
DBG_ENTER("mysqlnd_res::store_result");
- DBG_INF_FMT("conn=%d ps_protocol=%d", conn->thread_id, ps_protocol);
+ DBG_INF_FMT("conn=%u ps_protocol=%u", conn->thread_id, ps_protocol);
/* We need the conn because we are doing lazy zval initialization in buffered_fetch_row */
result->conn = conn->m->get_reference(conn TSRMLS_CC);
MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implicit TSRMLS_DC)
{
DBG_ENTER("mysqlnd_res::free_result");
- DBG_INF_FMT("implicit=%d", implicit);
+ DBG_INF_FMT("implicit=%u", implicit);
result->m.skip_result(result TSRMLS_CC);
MYSQLND_INC_CONN_STATISTIC(result->conn? result->conn->stats : NULL,
zend_bool fetched_anything;
DBG_ENTER("mysqlnd_res::fetch_into");
- DBG_INF_FMT("flags=%u mysqlnd_extension=%d", flags, extension);
+ DBG_INF_FMT("flags=%u mysqlnd_extension=%u", flags, extension);
if (!result->m.fetch_row) {
RETVAL_NULL();
}
if (mysqlnd_ps_fetch_functions[meta->fields[i].type].func == NULL) {
- DBG_ERR_FMT("Unknown type %d sent by the server. Please send a report to the developers",
+ DBG_ERR_FMT("Unknown type %u sent by the server. Please send a report to the developers",
meta->fields[i].type);
php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "Unknown type %d sent by the server. "
+ "Unknown type %u sent by the server. "
"Please send a report to the developers",
meta->fields[i].type);
PACKET_FREE(field_packet);
int i;
MYSQLND_FIELD *fields;
DBG_ENTER("mysqlnd_res_meta::free");
- DBG_INF_FMT("persistent=%d", meta->persistent);
+ DBG_INF_FMT("persistent=%u", meta->persistent);
if ((fields = meta->fields)) {
DBG_INF("Freeing fields metadata");
size_t len = meta->field_count * sizeof(struct mysqlnd_field_hash_key);
DBG_ENTER("mysqlnd_res_meta::clone_metadata");
- DBG_INF_FMT("persistent=%d", persistent);
+ DBG_INF_FMT("persistent=%u", persistent);
new_meta = mnd_pecalloc(1, sizeof(MYSQLND_RES_METADATA), persistent);
if (!new_meta) {
MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC)
{
DBG_ENTER("mysqlnd_res_meta::fetch_field_direct");
- DBG_INF_FMT("fieldnr=%d", fieldnr);
+ DBG_INF_FMT("fieldnr=%u", fieldnr);
DBG_INF_FMT("name=%s max_length=%u",
meta->fields[meta->current_field].name? meta->fields[meta->current_field].name:"",
meta->fields[meta->current_field].max_length);
size_t alloc_size = sizeof(MYSQLND_RES_METADATA) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_result_meta_init");
- DBG_INF_FMT("persistent=%d", persistent);
+ DBG_INF_FMT("persistent=%u", persistent);
do {
if (!ret) {
#define BAIL_IF_NO_MORE_DATA \
if ((size_t)(p - begin) > packet->header.size) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Premature end of data (mysqlnd_wireprotocol.c:%d)", __LINE__); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Premature end of data (mysqlnd_wireprotocol.c:%u)", __LINE__); \
goto premature_end; \
} \
zend_uchar buffer[MYSQLND_HEADER_SIZE];
DBG_ENTER("mysqlnd_read_header_name");
- DBG_INF_FMT("compressed=%d conn_id=%u", net->compressed, conn->thread_id);
+ DBG_INF_FMT("compressed=%u conn_id=%u", net->compressed, conn->thread_id);
if (FAIL == net->m.receive(conn, buffer, MYSQLND_HEADER_SIZE TSRMLS_CC)) {
DBG_RETURN(FAIL);
}
header->packet_no = uint1korr(buffer + 3);
#ifdef MYSQLND_DUMP_HEADER_N_BODY
- DBG_INF_FMT("HEADER: prot_packet_no=%d size=%3d", header->packet_no, header->size);
+ DBG_INF_FMT("HEADER: prot_packet_no=%u size=%3u", header->packet_no, header->size);
#endif
MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn->stats,
STAT_PROTOCOL_OVERHEAD_IN, MYSQLND_HEADER_SIZE,
DBG_RETURN(PASS);
}
- DBG_ERR_FMT("Logical link: packets out of order. Expected %d received %d. Packet size=%d",
+ DBG_ERR_FMT("Logical link: packets out of order. Expected %u received %u. Packet size="MYSQLND_SZ_T_SPEC,
net->packet_no, header->packet_no, header->size);
- php_error(E_WARNING, "Packets out of order. Expected %d received %d. Packet size="MYSQLND_SZ_T_SPEC,
+ php_error(E_WARNING, "Packets out of order. Expected %u received %u. Packet size="MYSQLND_SZ_T_SPEC,
net->packet_no, header->packet_no, header->size);
DBG_RETURN(FAIL);
}
packet->pre41 = TRUE;
}
- DBG_INF_FMT("proto=%d server=%s thread_id=%d",
+ DBG_INF_FMT("proto=%u server=%s thread_id=%u",
packet->protocol_version, packet->server_version, packet->thread_id);
- DBG_INF_FMT("server_capabilities=%d charset_no=%d server_status=%d",
+ DBG_INF_FMT("server_capabilities=%u charset_no=%u server_status=%i",
packet->server_capabilities, packet->charset_no, packet->server_status);
DBG_RETURN(PASS);
packet->message_len = 0;
}
- DBG_INF_FMT("OK packet: aff_rows=%lld last_ins_id=%ld server_status=%d warnings=%d",
+ DBG_INF_FMT("OK packet: aff_rows=%lld last_ins_id=%ld server_status=%u warnings=%u",
packet->affected_rows, packet->last_insert_id, packet->server_status,
packet->warning_count);
BAIL_IF_NO_MORE_DATA;
- DBG_INF_FMT("EOF packet: fields=%d status=%d warnings=%d",
+ DBG_INF_FMT("EOF packet: fields=%u status=%u warnings=%u",
packet->field_count, packet->server_status, packet->warning_count);
DBG_RETURN(PASS);
ret = FAIL;
}
}
- DBG_INF_FMT("affected_rows=%llu last_insert_id=%llu server_status=%d warning_count=%d",
+ DBG_INF_FMT("affected_rows=%llu last_insert_id=%llu server_status=%u warning_count=%u",
packet->affected_rows, packet->last_insert_id,
packet->server_status, packet->warning_count);
break;
packet->error_info.error, sizeof(packet->error_info.error),
&packet->error_info.error_no, packet->error_info.sqlstate
TSRMLS_CC);
- DBG_ERR_FMT("Server error : (%d) %s", packet->error_info.error_no, packet->error_info.error);
+ DBG_ERR_FMT("Server error : (%u) %s", packet->error_info.error_no, packet->error_info.error);
DBG_RETURN(PASS);
} else if (EODATA_MARKER == *p && packet->header.size < 8) {
/* Premature EOF. That should be COM_FIELD_LIST */
len != MYSQLND_NULL_LENGTH)
{
BAIL_IF_NO_MORE_DATA;
- DBG_INF_FMT("Def found, length %lu, persistent=%d", len, packet->persistent_alloc);
+ DBG_INF_FMT("Def found, length %lu, persistent=%u", len, packet->persistent_alloc);
meta->def = mnd_pemalloc(len + 1, packet->persistent_alloc);
if (!meta->def) {
SET_OOM_ERROR(conn->error_info);
p += len;
}
- DBG_INF_FMT("allocing root. persistent=%d", packet->persistent_alloc);
+ DBG_INF_FMT("allocing root. persistent=%u", packet->persistent_alloc);
root_ptr = meta->root = mnd_pemalloc(total_len, packet->persistent_alloc);
if (!root_ptr) {
SET_OOM_ERROR(conn->error_info);
zend_bool as_unicode, zend_bool as_int_or_float,
MYSQLND_STATS * stats TSRMLS_DC)
{
- int i;
+ unsigned int i;
zend_uchar *p = row_buffer->ptr;
zend_uchar *null_ptr, bit;
zval **current_field, **end_field, **start_field;
DBG_RETURN(FAIL);
}
- DBG_INF_FMT("Into zval=%p decoding column %d [%s.%s.%s] type=%d field->flags&unsigned=%d flags=%u is_bit=%d as_unicode=%d",
+ DBG_INF_FMT("Into zval=%p decoding column %u [%s.%s.%s] type=%u field->flags&unsigned=%u flags=%u is_bit=%u as_unicode=%u",
*current_field, i,
fields_metadata[i].db, fields_metadata[i].table, fields_metadata[i].name, fields_metadata[i].type,
fields_metadata[i].flags & UNSIGNED_FLAG, fields_metadata[i].flags, fields_metadata[i].type == MYSQL_TYPE_BIT, as_unicode);
zend_bool as_unicode, zend_bool as_int_or_float,
MYSQLND_STATS * stats TSRMLS_DC)
{
- int i;
+ unsigned int i;
zend_bool last_field_was_string = FALSE;
zval **current_field, **end_field, **start_field;
zend_uchar *p = row_buffer->ptr;
p += 2;
packet->server_status = uint2korr(p);
/* Seems we have 3 bytes reserved for future use */
- DBG_INF_FMT("server_status=%d warning_count=%d",
- packet->server_status, packet->warning_count);
+ DBG_INF_FMT("server_status=%u warning_count=%u", packet->server_status, packet->warning_count);
}
} else {
MYSQLND_INC_CONN_STATISTIC(conn->stats,
p->row_buffer->free_chunk(p->row_buffer TSRMLS_CC);
p->row_buffer = NULL;
}
- DBG_INF_FMT("alloca=%d persistent=%d", (int)alloca, (int)p->header.persistent);
+ DBG_INF_FMT("alloca=%u persistent=%u", (int)alloca, (int)p->header.persistent);
/*
Don't free packet->fields :
- normal queries -> store_result() | fetch_row_unbuffered() will transfer
if (data_size != PREPARE_RESPONSE_SIZE_41 &&
data_size != PREPARE_RESPONSE_SIZE_50 &&
!(data_size > PREPARE_RESPONSE_SIZE_50)) {
- DBG_ERR_FMT("Wrong COM_STMT_PREPARE response size. Received %d", data_size);
- php_error(E_WARNING, "Wrong COM_STMT_PREPARE response size. Received %d", data_size);
+ DBG_ERR_FMT("Wrong COM_STMT_PREPARE response size. Received %u", data_size);
+ php_error(E_WARNING, "Wrong COM_STMT_PREPARE response size. Received %u", data_size);
DBG_RETURN(FAIL);
}
packet->warning_count = uint2korr(p);
}
- DBG_INF_FMT("Prepare packet read: stmt_id=%d fields=%d params=%d",
+ DBG_INF_FMT("Prepare packet read: stmt_id=%u fields=%u params=%u",
packet->stmt_id, packet->field_count, packet->param_count);
BAIL_IF_NO_MORE_DATA;
MYSQLND_PROTOCOL *ret = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_protocol_init");
- DBG_INF_FMT("persistent=%d", persistent);
+ DBG_INF_FMT("persistent=%u", persistent);
if (ret) {
ret->persistent = persistent;
ret->m = mysqlnd_mysqlnd_protocol_methods;