andrey                                   Thu, 22 Oct 2009 14:30:51 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=289850

Log:
Count number of affected_rows for normal and PS queries

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2009-10-22 14:06:55 UTC 
(rev 289849)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2009-10-22 14:30:51 UTC 
(rev 289850)
@@ -885,6 +885,10 @@
          information from the ok packet. We will fetch it ourselves.
        */
        ret = mysqlnd_query_read_result_set_header(conn, NULL TSRMLS_CC);
+       if (ret == PASS && conn->last_query_type == QUERY_UPSERT && 
conn->upsert_status.affected_rows) {
+               MYSQLND_INC_CONN_STATISTIC_W_VALUE(&conn->stats, 
STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status.affected_rows);
+       }
+
        DBG_RETURN(ret);
 }
 /* }}} */

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h       
2009-10-22 14:06:55 UTC (rev 289849)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h       
2009-10-22 14:30:51 UTC (rev 289850)
@@ -354,6 +354,8 @@
        STAT_ROWS_FETCHED_FROM_CLIENT_PS_BUF,
        STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF,
        STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR,
+       STAT_ROWS_AFFECTED_NORMAL,
+       STAT_ROWS_AFFECTED_PS,
        STAT_ROWS_SKIPPED_NORMAL,
        STAT_ROWS_SKIPPED_PS,
        STAT_COPY_ON_WRITE_SAVED,

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c       2009-10-22 
14:06:55 UTC (rev 289849)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c       2009-10-22 
14:30:51 UTC (rev 289850)
@@ -701,7 +701,12 @@
        }
        stmt->execute_count++;

-       DBG_RETURN(mysqlnd_stmt_execute_parse_response(stmt TSRMLS_CC));
+       ret = mysqlnd_stmt_execute_parse_response(stmt TSRMLS_CC);
+
+       if (ret == PASS && conn->last_query_type == QUERY_UPSERT && 
stmt->upsert_status.affected_rows) {
+               MYSQLND_INC_CONN_STATISTIC_W_VALUE(&conn->stats, 
STAT_ROWS_AFFECTED_PS, stmt->upsert_status.affected_rows);
+       }
+       DBG_RETURN(ret);
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c       
2009-10-22 14:06:55 UTC (rev 289849)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c       
2009-10-22 14:30:51 UTC (rev 289850)
@@ -76,7 +76,10 @@
        { STR_W_LEN("rows_fetched_from_client_ps_buffered") },
        { STR_W_LEN("rows_fetched_from_client_ps_unbuffered") },
        { STR_W_LEN("rows_fetched_from_client_ps_cursor") },
+       { STR_W_LEN("rows_affected_normal") },
+       { STR_W_LEN("rows_affected_ps") },
        { STR_W_LEN("rows_skipped_normal") },
+       { STR_W_LEN("rows_skipped_normal") },
        { STR_W_LEN("rows_skipped_ps") },
        { STR_W_LEN("copy_on_write_saved") },
        { STR_W_LEN("copy_on_write_performed") },

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2009-10-22 14:06:55 UTC (rev 
289849)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2009-10-22 14:30:51 UTC (rev 
289850)
@@ -885,6 +885,10 @@
          information from the ok packet. We will fetch it ourselves.
        */
        ret = mysqlnd_query_read_result_set_header(conn, NULL TSRMLS_CC);
+       if (ret == PASS && conn->last_query_type == QUERY_UPSERT && 
conn->upsert_status.affected_rows) {
+               MYSQLND_INC_CONN_STATISTIC_W_VALUE(&conn->stats, 
STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status.affected_rows);
+       }
+
        DBG_RETURN(ret);
 }
 /* }}} */

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h  2009-10-22 14:06:55 UTC 
(rev 289849)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h  2009-10-22 14:30:51 UTC 
(rev 289850)
@@ -354,6 +354,8 @@
        STAT_ROWS_FETCHED_FROM_CLIENT_PS_BUF,
        STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF,
        STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR,
+       STAT_ROWS_AFFECTED_NORMAL,
+       STAT_ROWS_AFFECTED_PS,
        STAT_ROWS_SKIPPED_NORMAL,
        STAT_ROWS_SKIPPED_PS,
        STAT_COPY_ON_WRITE_SAVED,

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c  2009-10-22 14:06:55 UTC (rev 
289849)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c  2009-10-22 14:30:51 UTC (rev 
289850)
@@ -701,7 +701,12 @@
        }
        stmt->execute_count++;

-       DBG_RETURN(mysqlnd_stmt_execute_parse_response(stmt TSRMLS_CC));
+       ret = mysqlnd_stmt_execute_parse_response(stmt TSRMLS_CC);
+
+       if (ret == PASS && conn->last_query_type == QUERY_UPSERT && 
stmt->upsert_status.affected_rows) {
+               MYSQLND_INC_CONN_STATISTIC_W_VALUE(&conn->stats, 
STAT_ROWS_AFFECTED_PS, stmt->upsert_status.affected_rows);
+       }
+       DBG_RETURN(ret);
 }
 /* }}} */


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c  2009-10-22 14:06:55 UTC 
(rev 289849)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c  2009-10-22 14:30:51 UTC 
(rev 289850)
@@ -76,7 +76,10 @@
        { STR_W_LEN("rows_fetched_from_client_ps_buffered") },
        { STR_W_LEN("rows_fetched_from_client_ps_unbuffered") },
        { STR_W_LEN("rows_fetched_from_client_ps_cursor") },
+       { STR_W_LEN("rows_affected_normal") },
+       { STR_W_LEN("rows_affected_ps") },
        { STR_W_LEN("rows_skipped_normal") },
+       { STR_W_LEN("rows_skipped_normal") },
        { STR_W_LEN("rows_skipped_ps") },
        { STR_W_LEN("copy_on_write_saved") },
        { STR_W_LEN("copy_on_write_performed") },

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to