From: Andrey Hristov Date: Tue, 6 Oct 2009 10:33:23 +0000 (+0000) Subject: count the queries X-Git-Tag: php-5.3.2RC1~393 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9382399fccb76d052811e959367ec159a492ec5;p=php count the queries --- diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 904a310dba..e8449e057e 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -399,6 +399,10 @@ mysqlnd_simple_command(MYSQLND *conn, enum php_mysqlnd_server_command command, SET_ERROR_AFF_ROWS(conn); SET_EMPTY_ERROR(conn->error_info); + if (command == COM_QUERY) { + ++conn->query_counter; + } + PACKET_INIT_ALLOCA(cmd_packet, PROT_CMD_PACKET); cmd_packet.command = command; if (arg && arg_len) { diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 9612fa3fce..af1cdd1a5e 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -425,6 +425,7 @@ struct st_mysqlnd_connection */ enum mysqlnd_connection_state state; enum_mysqlnd_query_type last_query_type; + uint32_t query_counter; /* Temporary storage between query and (use|store)_result() call */ MYSQLND_RES *current_result;