===== sql/mysqld.cc 1.453 vs edited ===== --- 1.453/sql/mysqld.cc 2005-05-16 08:12:32 +02:00 +++ edited/sql/mysqld.cc 2005-05-24 13:37:54 +02:00 @@ -5598,6 +5598,7 @@ {"Com_change_master", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_MASTER]), SHOW_LONG_STATUS}, {"Com_check", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECK]), SHOW_LONG_STATUS}, {"Com_checksum", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECKSUM]), SHOW_LONG_STATUS}, + {"Com_close", (char*) offsetof(STATUS_VAR, com_close), SHOW_LONG_STATUS}, {"Com_commit", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_COMMIT]), SHOW_LONG_STATUS}, {"Com_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_DB]), SHOW_LONG_STATUS}, {"Com_create_function", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_FUNCTION]), SHOW_LONG_STATUS}, @@ -5612,7 +5613,9 @@ {"Com_drop_index", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_INDEX]), SHOW_LONG_STATUS}, {"Com_drop_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_TABLE]), SHOW_LONG_STATUS}, {"Com_drop_user", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_USER]), SHOW_LONG_STATUS}, + {"Com_execute", (char*) offsetof(STATUS_VAR, com_execute), SHOW_LONG_STATUS}, {"Com_execute_sql", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_EXECUTE]), SHOW_LONG_STATUS}, + {"Com_fetch", (char*) offsetof(STATUS_VAR, com_fetch), SHOW_LONG_STATUS}, {"Com_flush", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_FLUSH]), SHOW_LONG_STATUS}, {"Com_grant", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_GRANT]), SHOW_LONG_STATUS}, {"Com_ha_close", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_HA_CLOSE]), SHOW_LONG_STATUS}, @@ -5628,6 +5631,7 @@ {"Com_lock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_LOCK_TABLES]), SHOW_LONG_STATUS}, {"Com_optimize", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_OPTIMIZE]), SHOW_LONG_STATUS}, {"Com_preload_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_PRELOAD_KEYS]), SHOW_LONG_STATUS}, + {"Com_prepare", (char*) offsetof(STATUS_VAR, com_prepare), SHOW_LONG_STATUS}, {"Com_prepare_sql", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_PREPARE]), SHOW_LONG_STATUS}, {"Com_purge", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_PURGE]), SHOW_LONG_STATUS}, {"Com_purge_before_date", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_PURGE_BEFORE]), SHOW_LONG_STATUS}, @@ -5635,7 +5639,8 @@ {"Com_repair", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPAIR]), SHOW_LONG_STATUS}, {"Com_replace", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE]), SHOW_LONG_STATUS}, {"Com_replace_select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE_SELECT]), SHOW_LONG_STATUS}, - {"Com_reset", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESET]), SHOW_LONG_STATUS}, + {"Com_reset", (char*) offsetof(STATUS_VAR, com_reset), SHOW_LONG_STATUS}, + {"Com_reset_sql", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESET]), SHOW_LONG_STATUS}, {"Com_restore_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESTORE_TABLE]), SHOW_LONG_STATUS}, {"Com_revoke", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE]), SHOW_LONG_STATUS}, {"Com_revoke_all", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE_ALL]), SHOW_LONG_STATUS}, ===== sql/sql_class.h 1.231 vs edited ===== --- 1.231/sql/sql_class.h 2005-05-09 21:13:24 +02:00 +++ edited/sql/sql_class.h 2005-05-23 22:47:16 +02:00 @@ -635,6 +635,12 @@ ulong filesort_range_count; ulong filesort_rows; ulong filesort_scan_count; + + ulong com_prepare; + ulong com_fetch; + ulong com_execute; + ulong com_reset; + ulong com_close; } STATUS_VAR; /* @@ -642,7 +648,7 @@ variable in system_status_var */ -#define last_system_status_var filesort_scan_count +#define last_system_status_var com_close void free_tmp_table(THD *thd, TABLE *entry); ===== sql/sql_prepare.cc 1.116 vs edited ===== --- 1.116/sql/sql_prepare.cc 2005-05-16 12:34:19 +02:00 +++ edited/sql/sql_prepare.cc 2005-05-18 14:34:45 +02:00 @@ -1771,6 +1771,7 @@ } mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet); + statistic_increment(thd->status_var.com_prepare, &LOCK_status); thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); @@ -2059,6 +2060,7 @@ mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id, expanded_query.length() ? expanded_query.c_ptr() : stmt->query); + statistic_increment(thd->status_var.com_execute, &LOCK_status); thd->protocol= &thd->protocol_prep; // Switch to binary protocol if (!(specialflag & SPECIAL_NO_PRIOR)) @@ -2222,6 +2224,8 @@ DBUG_VOID_RETURN; } + statistic_increment(thd->status_var.com_fetch, &LOCK_status); + thd->current_arena= stmt; thd->set_n_backup_statement(stmt, &thd->stmt_backup); stmt->cursor->init_thd(thd); @@ -2281,6 +2285,7 @@ Clear parameters from data which could be set by mysql_stmt_send_long_data() call. */ + statistic_increment(thd->status_var.com_reset, &LOCK_status); reset_stmt_params(stmt); mysql_reset_thd_for_next_command(thd); @@ -2305,7 +2310,8 @@ if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close"))) DBUG_VOID_RETURN; - + + statistic_increment(thd->status_var.com_close, &LOCK_status); /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); DBUG_VOID_RETURN;