]> granicus.if.org Git - php/commitdiff
count the queries
authorAndrey Hristov <andrey@php.net>
Tue, 6 Oct 2009 10:33:23 +0000 (10:33 +0000)
committerAndrey Hristov <andrey@php.net>
Tue, 6 Oct 2009 10:33:23 +0000 (10:33 +0000)
ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd_structs.h

index 904a310dbaaeccced7896db384b2d290e78b1db1..e8449e057e5f756462a8a89e969749f8ffe0604f 100644 (file)
@@ -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) {
index 9612fa3fce9369fa716ef96b747c2fcd85face2b..af1cdd1a5efd875bd04995839c95cff2f2b520cf 100644 (file)
@@ -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;