diff options
author | Sergei Golubchik <serg@mariadb.org> | 2014-08-25 09:51:46 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-10-11 18:53:04 +0200 |
commit | 3f7cc414fed92228c37fd75fcee62ca4e2a170ed (patch) | |
tree | ebd2206d5ee28eb97f60bc1e5557b64b7bb3d197 /sql | |
parent | 534cbc1f2affb2953f3ad988b027e5bc116de0eb (diff) | |
download | mariadb-git-3f7cc414fed92228c37fd75fcee62ca4e2a170ed.tar.gz |
cleanup: remove dead code
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_connect.cc | 54 | ||||
-rw-r--r-- | sql/sql_show.cc | 94 | ||||
-rw-r--r-- | sql/structs.h | 27 |
3 files changed, 0 insertions, 175 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 89a90f41697..623d50b5214 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -474,60 +474,6 @@ void init_user_stats(USER_STATS *user_stats, } -#ifdef COMPLETE_PATCH_NOT_ADDED_YET - -void add_user_stats(USER_STATS *user_stats, - uint total_connections, - uint concurrent_connections, - time_t connected_time, - double busy_time, - double cpu_time, - ulonglong bytes_received, - ulonglong bytes_sent, - ulonglong binlog_bytes_written, - ha_rows rows_sent, - ha_rows rows_read, - ha_rows rows_inserted, - ha_rows rows_deleted, - ha_rows rows_updated, - ulonglong select_commands, - ulonglong update_commands, - ulonglong other_commands, - ulonglong commit_trans, - ulonglong rollback_trans, - ulonglong denied_connections, - ulonglong lost_connections, - ulonglong max_statement_time_exceeded, - ulonglong access_denied_errors, - ulonglong empty_queries) -{ - user_stats->total_connections+= total_connections; - user_stats->concurrent_connections+= concurrent_connections; - user_stats->connected_time+= connected_time; - user_stats->busy_time+= busy_time; - user_stats->cpu_time+= cpu_time; - user_stats->bytes_received+= bytes_received; - user_stats->bytes_sent+= bytes_sent; - user_stats->binlog_bytes_written+= binlog_bytes_written; - user_stats->rows_sent+= rows_sent; - user_stats->rows_inserted+= rows_inserted; - user_stats->rows_deleted+= rows_deleted; - user_stats->rows_updated+= rows_updated; - user_stats->rows_read+= rows_read; - user_stats->select_commands+= select_commands; - user_stats->update_commands+= update_commands; - user_stats->other_commands+= other_commands; - user_stats->commit_trans+= commit_trans; - user_stats->rollback_trans+= rollback_trans; - user_stats->denied_connections+= denied_connections; - user_stats->lost_connections+= lost_connections; - user_stats->max_statement_time_exceeded+= max_statement_time_exceeded; - user_stats->access_denied_errors+= access_denied_errors; - user_stats->empty_queries+= empty_queries; -} -#endif - - void init_global_user_stats(void) { if (my_hash_init(&global_user_stats, system_charset_info, max_connections, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1e871835d3d..3caef3b7c44 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3125,100 +3125,6 @@ end: DBUG_RETURN(res); } -#ifdef COMPLETE_PATCH_NOT_ADDED_YET -/* - Aggregate values for mapped_user entries by their role. - - SYNOPSIS - aggregate_user_stats - all_user_stats - input to aggregate - agg_user_stats - returns aggregated values - - RETURN - 0 - OK - 1 - error -*/ - -static int aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats) -{ - DBUG_ENTER("aggregate_user_stats"); - if (my_hash_init(agg_user_stats, system_charset_info, - MY_MAX(all_user_stats->records, 1), - 0, 0, (my_hash_get_key)get_key_user_stats, - (my_hash_free_key)free_user_stats, 0)) - { - sql_print_error("Malloc in aggregate_user_stats failed"); - DBUG_RETURN(1); - } - - for (uint i= 0; i < all_user_stats->records; i++) - { - USER_STATS *user= (USER_STATS*)my_hash_element(all_user_stats, i); - USER_STATS *agg_user; - uint name_length= strlen(user->priv_user); - - if (!(agg_user= (USER_STATS*) my_hash_search(agg_user_stats, - (uchar*)user->priv_user, - name_length))) - { - // First entry for this role. - if (!(agg_user= (USER_STATS*) my_malloc(sizeof(USER_STATS), - MYF(MY_WME | MY_ZEROFILL| - MY_THREAD_SPECIFIC)))) - { - sql_print_error("Malloc in aggregate_user_stats failed"); - DBUG_RETURN(1); - } - - init_user_stats(agg_user, user->priv_user, name_length, - user->priv_user, - user->total_connections, user->concurrent_connections, - user->connected_time, user->busy_time, user->cpu_time, - user->bytes_received, user->bytes_sent, - user->binlog_bytes_written, - user->rows_sent, user->rows_read, - user->rows_inserted, user->rows_deleted, - user->rows_updated, - user->select_commands, user->update_commands, - user->other_commands, - user->commit_trans, user->rollback_trans, - user->denied_connections, user->lost_connections, - user->max_statement_time_exceeded, - user->access_denied_errors, user->empty_queries); - - if (my_hash_insert(agg_user_stats, (uchar*) agg_user)) - { - /* Out of memory */ - my_free(agg_user, 0); - sql_print_error("Malloc in aggregate_user_stats failed"); - DBUG_RETURN(1); - } - } - else - { - /* Aggregate with existing values for this role. */ - add_user_stats(agg_user, - user->total_connections, user->concurrent_connections, - user->connected_time, user->busy_time, user->cpu_time, - user->bytes_received, user->bytes_sent, - user->binlog_bytes_written, - user->rows_sent, user->rows_read, - user->rows_inserted, user->rows_deleted, - user->rows_updated, - user->select_commands, user->update_commands, - user->other_commands, - user->commit_trans, user->rollback_trans, - user->denied_connections, user->lost_connections, - user->max_statement_time_exceeded, - user->access_denied_errors, user->empty_queries); - } - } - DBUG_PRINT("exit", ("aggregated %lu input into %lu output entries", - all_user_stats->records, agg_user_stats->records)); - DBUG_RETURN(0); -} -#endif - /* Write result to network for SHOW USER_STATISTICS diff --git a/sql/structs.h b/sql/structs.h index d02301e4350..2fd759767ca 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -338,33 +338,6 @@ init_user_stats(USER_STATS *user_stats, ulonglong access_denied_errors, ulonglong empty_queries); -/* Increment values of an instance of USER_STATS */ -extern void -add_user_stats(USER_STATS *user_stats, - uint total_connections, - uint concurrent_connections, - time_t connected_time, - double busy_time, - double cpu_time, - ulonglong bytes_received, - ulonglong bytes_sent, - ulonglong binlog_bytes_written, - ha_rows rows_sent, - ha_rows rows_read, - ha_rows rows_inserted, - ha_rows rows_deleted, - ha_rows rows_updated, - ulonglong select_commands, - ulonglong update_commands, - ulonglong other_commands, - ulonglong commit_trans, - ulonglong rollback_trans, - ulonglong denied_connections, - ulonglong lost_connections, - ulonglong max_statement_time_exceeded, - ulonglong access_denied_errors, - ulonglong empty_queries); - typedef struct st_table_stats { char table[NAME_LEN * 2 + 2]; // [db] + '\0' + [table] + '\0' |