mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Count number of affected_rows for normal and PS queries
This commit is contained in:
parent
4a7912b9a0
commit
8792edcf76
4 changed files with 15 additions and 1 deletions
|
@ -885,6 +885,10 @@ MYSQLND_METHOD(mysqlnd_conn, query)(MYSQLND *conn, const char *query, unsigned i
|
||||||
information from the ok packet. We will fetch it ourselves.
|
information from the ok packet. We will fetch it ourselves.
|
||||||
*/
|
*/
|
||||||
ret = mysqlnd_query_read_result_set_header(conn, NULL TSRMLS_CC);
|
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);
|
DBG_RETURN(ret);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
|
@ -354,6 +354,8 @@ typedef enum mysqlnd_collected_stats
|
||||||
STAT_ROWS_FETCHED_FROM_CLIENT_PS_BUF,
|
STAT_ROWS_FETCHED_FROM_CLIENT_PS_BUF,
|
||||||
STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF,
|
STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF,
|
||||||
STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR,
|
STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR,
|
||||||
|
STAT_ROWS_AFFECTED_NORMAL,
|
||||||
|
STAT_ROWS_AFFECTED_PS,
|
||||||
STAT_ROWS_SKIPPED_NORMAL,
|
STAT_ROWS_SKIPPED_NORMAL,
|
||||||
STAT_ROWS_SKIPPED_PS,
|
STAT_ROWS_SKIPPED_PS,
|
||||||
STAT_COPY_ON_WRITE_SAVED,
|
STAT_COPY_ON_WRITE_SAVED,
|
||||||
|
|
|
@ -701,7 +701,12 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const stmt TSRMLS_DC)
|
||||||
}
|
}
|
||||||
stmt->execute_count++;
|
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);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,9 @@ const MYSQLND_STRING mysqlnd_stats_values_names[STAT_LAST] =
|
||||||
{ STR_W_LEN("rows_fetched_from_client_ps_buffered") },
|
{ 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_unbuffered") },
|
||||||
{ STR_W_LEN("rows_fetched_from_client_ps_cursor") },
|
{ 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_normal") },
|
||||||
{ STR_W_LEN("rows_skipped_ps") },
|
{ STR_W_LEN("rows_skipped_ps") },
|
||||||
{ STR_W_LEN("copy_on_write_saved") },
|
{ STR_W_LEN("copy_on_write_saved") },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue