DBG_INF("Freeing memory of members");
if (conn->host) {
- DBG_INF("Freeing host");
mnd_pefree(conn->host, pers);
conn->host = NULL;
}
if (conn->user) {
- DBG_INF("Freeing user");
mnd_pefree(conn->user, pers);
conn->user = NULL;
}
if (conn->passwd) {
- DBG_INF("Freeing passwd");
mnd_pefree(conn->passwd, pers);
conn->passwd = NULL;
}
if (conn->connect_or_select_db) {
- DBG_INF("Freeing connect_or_select_db");
mnd_pefree(conn->connect_or_select_db, pers);
conn->connect_or_select_db = NULL;
}
if (conn->unix_socket) {
- DBG_INF("Freeing unix_socket");
mnd_pefree(conn->unix_socket, pers);
conn->unix_socket = NULL;
}
if (conn->scheme) {
- DBG_INF("Freeing scheme");
mnd_pefree(conn->scheme, pers);
conn->scheme = NULL;
}
if (conn->server_version) {
- DBG_INF("Freeing server_version");
mnd_pefree(conn->server_version, pers);
conn->server_version = NULL;
}
if (conn->host_info) {
- DBG_INF("Freeing host_info");
mnd_pefree(conn->host_info, pers);
conn->host_info = NULL;
}
if (conn->auth_plugin_data) {
- DBG_INF("Freeing auth_plugin_data");
mnd_pefree(conn->auth_plugin_data, pers);
conn->auth_plugin_data = NULL;
}
conn->m->free_options(conn TSRMLS_CC);
if (conn->net) {
- DBG_INF("Freeing net");
mysqlnd_net_free(conn->net TSRMLS_CC);
conn->net = NULL;
}
if (conn->protocol) {
- DBG_INF("Freeing protocol");
mysqlnd_protocol_free(conn->protocol TSRMLS_CC);
conn->protocol = NULL;
}
#endif
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
case MYSQLND_OPT_INT_AND_FLOAT_NATIVE:
- DBG_INF("MYSQLND_OPT_INT_AND_FLOAT_NATIVE");
conn->options.int_and_float_native = *(unsigned int*) value;
break;
#endif
case MYSQL_OPT_LOCAL_INFILE:
- DBG_INF("MYSQL_OPT_LOCAL_INFILE");
if (!value || (*(unsigned int*) value) ? 1 : 0) {
conn->options.flags |= CLIENT_LOCAL_FILES;
} else {
{
char ** new_init_commands;
char * new_command;
- DBG_INF("MYSQL_INIT_COMMAND");
- DBG_INF_FMT("command=%s", value);
/* when num_commands is 0, then realloc will be effectively a malloc call, internally */
/* Don't assign to conn->options.init_commands because in case of OOM we will lose the pointer and leak */
new_init_commands = mnd_perealloc(conn->options.init_commands, sizeof(char *) * (conn->options.num_commands + 1), conn->persistent);
case MYSQL_SET_CHARSET_NAME:
{
char * new_charset_name = mnd_pestrdup(value, conn->persistent);
- DBG_INF("MYSQL_SET_CHARSET_NAME");
if (!new_charset_name) {
goto oom;
}
case MYSQLND_OPT_AUTH_PROTOCOL:
{
char * new_auth_protocol = value? mnd_pestrdup(value, conn->persistent) : NULL;
- DBG_INF("MYSQLND_OPT_AUTH_PROTOCOL");
if (value && !new_auth_protocol) {
goto oom;
}
/* Nothing to store for UPSERT/LOAD DATA */
if (conn->last_query_type != QUERY_SELECT || CONN_GET_STATE(conn) != CONN_FETCHING_DATA) {
- SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE,
- mysqlnd_out_of_sync);
+ SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
DBG_ERR("Command out of sync");
DBG_RETURN(NULL);
}
/* Nothing to store for UPSERT/LOAD DATA*/
if (conn->last_query_type != QUERY_SELECT || CONN_GET_STATE(conn) != CONN_FETCHING_DATA) {
- SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE,
- mysqlnd_out_of_sync);
+ SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
DBG_ERR("Command out of sync");
DBG_RETURN(NULL);
}
TSRMLS_DC ZEND_FILE_LINE_DC)
{
DBG_ENTER("mysqlnd_conn::get_connection_stats");
- DBG_INF_FMT("conn=%llu", conn->thread_id);
mysqlnd_fill_stats_hash(conn->stats, mysqlnd_stats_values_names, return_value TSRMLS_CC ZEND_FILE_LINE_CC);
DBG_VOID_RETURN;
}
size_t to_read = count, ret;
size_t old_chunk_size = conn->net->stream->chunk_size;
DBG_ENTER("mysqlnd_net::network_read");
- DBG_INF_FMT("count=%u", count);
+ DBG_INF_FMT("count="MYSQLND_SZ_T_SPEC, count);
conn->net->stream->chunk_size = MIN(to_read, conn->net->options.net_read_buffer_size);
while (to_read) {
if (!(ret = php_stream_read(conn->net->stream, (char *) buffer, to_read))) {
size_t to_be_sent;
DBG_ENTER("mysqlnd_net::send");
- DBG_INF_FMT("conn=%llu count=%lu compression=%u", conn->thread_id, count, net->compressed);
+ DBG_INF_FMT("conn=%llu count=" MYSQLND_SZ_T_SPEC " compression=%u", conn->thread_id, count, net->compressed);
net->stream->chunk_size = MYSQLND_MAX_PACKET_SIZE;
break;
#ifdef WHEN_SUPPORTED_BY_MYSQLI
case MYSQL_OPT_READ_TIMEOUT:
- DBG_INF("MYSQL_OPT_READ_TIMEOUT");
net->options.timeout_read = *(unsigned int*) value;
break;
case MYSQL_OPT_WRITE_TIMEOUT:
- DBG_INF("MYSQL_OPT_WRITE_TIMEOUT");
net->options.timeout_write = *(unsigned int*) value;
break;
#endif
if (net->options.ssl_key) {
zval key_zval;
ZVAL_STRING(&key_zval, net->options.ssl_key, 0);
- DBG_INF("key");
php_stream_context_set_option(context, "ssl", "local_pk", &key_zval);
}
if (net->options.ssl_verify_peer) {
zval verify_peer_zval;
ZVAL_TRUE(&verify_peer_zval);
- DBG_INF("verify peer");
php_stream_context_set_option(context, "ssl", "verify_peer", &verify_peer_zval);
}
if (net->options.ssl_cert) {
zval cert_zval;
ZVAL_STRING(&cert_zval, net->options.ssl_cert, 0);
- DBG_INF_FMT("local_cert=%s", net->options.ssl_cert);
php_stream_context_set_option(context, "ssl", "local_cert", &cert_zval);
if (!net->options.ssl_key) {
php_stream_context_set_option(context, "ssl", "local_pk", &cert_zval);
if (net->options.ssl_ca) {
zval cafile_zval;
ZVAL_STRING(&cafile_zval, net->options.ssl_ca, 0);
- DBG_INF_FMT("cafile=%s", net->options.ssl_ca);
php_stream_context_set_option(context, "ssl", "cafile", &cafile_zval);
}
if (net->options.ssl_capath) {
zval capath_zval;
ZVAL_STRING(&capath_zval, net->options.ssl_capath, 0);
- DBG_INF_FMT("capath=%s", net->options.ssl_capath);
php_stream_context_set_option(context, "ssl", "cafile", &capath_zval);
}
if (net->options.ssl_passphrase) {
if (net->options.ssl_cipher) {
zval cipher_zval;
ZVAL_STRING(&cipher_zval, net->options.ssl_cipher, 0);
- DBG_INF_FMT("ciphers=%s", net->options.ssl_cipher);
php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
}
php_stream_context_set(net->stream, context);
}
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status.server_status, stmt->upsert_status.server_status & SERVER_STATUS_CURSOR_EXISTS);
- DBG_INF_FMT("server_status=%u cursor=%u", conn->upsert_status.server_status, conn->upsert_status.server_status & SERVER_STATUS_CURSOR_EXISTS);
/* Free space for next result */
s->m->free_stmt_content(s TSRMLS_CC);
if (result->unbuf->eof_reached) {
/* No more rows obviously */
- DBG_INF("eof reached");
+ DBG_INF("EOF already reached");
DBG_RETURN(PASS);
}
if (CONN_GET_STATE(result->conn) != CONN_FETCHING_DATA) {
if (!row_packet->skip_extraction) {
result->m.unbuffered_free_last_data(result TSRMLS_CC);
- DBG_INF("extracting data");
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
row_packet->fields = NULL;
MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_PS_UNBUFFERED_SETS);
result = stmt->result;
- DBG_INF_FMT("%scursor exists", stmt->cursor_exists? "":"no ");
result->m.use_result(stmt->result, TRUE TSRMLS_CC);
result->m.fetch_row = stmt->cursor_exists? mysqlnd_fetch_stmt_row_cursor:
mysqlnd_stmt_fetch_row_unbuffered;
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=%u", row_packet->skip_extraction);
if (!row_packet->skip_extraction) {
result->m.unbuffered_free_last_data(result TSRMLS_CC);
- DBG_INF("extracting data");
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
row_packet->fields = NULL;
if (!stmt || !stmt->conn) {
DBG_RETURN(FAIL);
}
- DBG_INF_FMT("stmt=%lu param_no=%u param_count=%u type=%u",
- stmt->stmt_id, param_no, stmt->param_count, type);
+ 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) {
SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared);
if (stmt->param_count) {
stmt->send_types_to_server = 1;
}
- DBG_INF("PASS");
DBG_RETURN(PASS);
}
/* }}} */
if (!stmt) {
DBG_VOID_RETURN;
}
- DBG_INF_FMT("stmt=%lu result_bind=%p field_count=%u",
- stmt->stmt_id, stmt->result_bind, stmt->field_count);
+ DBG_INF_FMT("stmt=%lu result_bind=%p field_count=%u", stmt->stmt_id, stmt->result_bind, stmt->field_count);
if (!stmt->result_bind) {
DBG_VOID_RETURN;
if (!stmt) {
DBG_VOID_RETURN;
}
- 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);
+ 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) {
DBG_VOID_RETURN;
if (!stmt) {
DBG_VOID_RETURN;
}
- DBG_INF_FMT("stmt=%lu param_bind=%p param_count=%u",
- stmt->stmt_id, stmt->param_bind, stmt->param_count);
+ DBG_INF_FMT("stmt=%lu param_bind=%p param_count=%u", stmt->stmt_id, stmt->param_bind, stmt->param_count);
/* Destroy the input bind */
if (stmt->param_bind) {
clean.
*/
do {
- 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);
DBG_ENTER("mysqlnd_stmt::dtor");
if (stmt) {
-
DBG_INF_FMT("stmt=%p", stmt);
MYSQLND_INC_GLOBAL_STATISTIC(implicit == TRUE? STAT_STMT_CLOSE_IMPLICIT:
DBG_VOID_RETURN;
}
- DBG_INF_FMT("last_row_data=%p", unbuf->last_row_data);
if (unbuf->last_row_data) {
unsigned int i, ctor_called_count = 0;
zend_bool copy_ctor_called;
MYSQLND_STATS *global_stats = result->conn? result->conn->stats:NULL;
- DBG_INF_FMT("%u columns to free", result->field_count);
for (i = 0; i < result->field_count; i++) {
mysqlnd_palloc_zval_ptr_dtor(&(unbuf->last_row_data[i]), result->type, ©_ctor_called TSRMLS_CC);
if (copy_ctor_called) {
DBG_ENTER("mysqlnd_res::free_buffered_data");
DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);
- DBG_INF("Freeing data & row_buffer");
if (set->data) {
unsigned int copy_on_write_performed = 0;
unsigned int copy_on_write_saved = 0;
- DBG_INF_FMT("before: real_usage=%lu usage=%lu", zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
for (row = set->row_count - 1; row >= 0; row--) {
zval **current_row = set->data + row * field_count;
MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row];
if (current_row[col]) {
zend_bool copy_ctor_called;
mysqlnd_palloc_zval_ptr_dtor(&(current_row[col]), result->type, ©_ctor_called TSRMLS_CC);
-#if MYSQLND_DEBUG_MEMORY
- DBG_INF_FMT("Copy_ctor_called=%u", copy_ctor_called);
-#endif
if (copy_ctor_called) {
++copy_on_write_performed;
} else {
}
}
}
-#if MYSQLND_DEBUG_MEMORY
- DBG_INF("Freeing current_row & current_buffer");
-#endif
current_buffer->free_chunk(current_buffer TSRMLS_CC);
}
set->data_cursor = NULL;
set->row_count = 0;
- DBG_INF("Freeing set");
mnd_pefree(set, set->persistent);
- DBG_INF_FMT("after: real_usage=%lu usage=%lu", zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
DBG_VOID_RETURN;
}
/* }}} */
}
if (result->row_packet) {
- DBG_INF("Freeing packet");
PACKET_FREE(result->row_packet);
result->row_packet = NULL;
}
if (result->result_set_memory_pool) {
- DBG_INF("Freeing memory pool");
mysqlnd_mempool_destroy(result->result_set_memory_pool TSRMLS_CC);
result->result_set_memory_pool = NULL;
}
result->unbuf->eof_reached = TRUE; /* so next time we won't get an error */
} else if (row_packet->eof) {
/* Mark the connection as usable again */
- DBG_INF_FMT("warningss=%u server_status=%u", row_packet->warning_count, row_packet->server_status);
+ DBG_INF_FMT("warnings=%u server_status=%u", row_packet->warning_count, row_packet->server_status);
result->unbuf->eof_reached = TRUE;
result->conn->upsert_status.warning_count = row_packet->warning_count;
result->conn->upsert_status.server_status = row_packet->server_status;
MYSQLND_PACKET_ROW *row_packet = result->row_packet;
DBG_ENTER("mysqlnd_fetch_row_unbuffered");
- DBG_INF_FMT("flags=%u", flags);
*fetched_anything = FALSE;
if (result->unbuf->eof_reached) {
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=%u", ps);
SET_EMPTY_ERROR(result->conn->error_info);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_fetch_row_buffered");
- DBG_INF_FMT("flags=%u row=%p", flags, row);
/* If we haven't read everything */
if (set->data_cursor &&
MYSQLND_RES_BUFFERED *set;
DBG_ENTER("mysqlnd_res::store_result_fetch_data");
- 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);
if (!set) {
zend_bool to_cache = FALSE;
DBG_ENTER("mysqlnd_res::store_result");
- 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=%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=%u", flags, extension);
if (!result->m.fetch_row) {
RETVAL_NULL();
MYSQLND_RES_BUFFERED *set = result->stored_data;
DBG_ENTER("mysqlnd_res::fetch_all");
- DBG_INF_FMT("flags=%u", flags);
if ((!result->unbuf && !set)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "fetch_all can be used only with buffered sets");
MYSQLND_RES *ret = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_result_init");
- DBG_INF_FMT("field_count=%u", field_count);
if (!ret) {
DBG_RETURN(NULL);