diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-10-29 20:29:43 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-10-29 20:29:43 +0200 |
commit | 716f7843757f96649cca1f5dc3df5d9659b17da9 (patch) | |
tree | 72f4916393771ab12360c104d8bea0e9b867d2f8 /sql/sql_show.cc | |
parent | 7c24e8d54d1d41374b7836e3273e7e5eaf22e2c4 (diff) | |
download | mariadb-git-716f7843757f96649cca1f5dc3df5d9659b17da9.tar.gz |
sane implementation of Key_% status variables.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 437a9607d14..8f1f938d36e 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2292,34 +2292,6 @@ void remove_status_vars(SHOW_VAR *list) -static void update_key_cache_stat_var(KEY_CACHE *key_cache, size_t ofs) -{ - uint var_no; - if (ofs == offsetof(KEY_CACHE, blocks_used) || - ofs == offsetof(KEY_CACHE, blocks_unused) || - ofs == offsetof(KEY_CACHE, global_blocks_changed)) - { - var_no= (ofs-offsetof(KEY_CACHE, blocks_used))/sizeof(ulong); - *(ulong *)((char *) key_cache + ofs)= - (ulong) get_key_cache_stat_value(key_cache, var_no); - return; - } - - if (ofs == offsetof(KEY_CACHE, global_cache_r_requests) || - ofs == offsetof(KEY_CACHE, global_cache_read) || - ofs == offsetof(KEY_CACHE, global_cache_w_requests) || - ofs == offsetof(KEY_CACHE, global_cache_write)) - { - var_no= NUM_LONG_KEY_CACHE_STAT_VARIABLES + - (ofs-offsetof(KEY_CACHE, global_cache_w_requests))/ - sizeof(ulonglong); - *(ulonglong *)((char *) key_cache + ofs)= - get_key_cache_stat_value(key_cache, var_no); - return; - } -} - - static bool show_status_array(THD *thd, const char *wild, SHOW_VAR *variables, enum enum_var_type value_type, @@ -2451,16 +2423,6 @@ static bool show_status_array(THD *thd, const char *wild, end= strend(pos); break; } - case SHOW_KEY_CACHE_LONG: - update_key_cache_stat_var(dflt_key_cache, (size_t) value); - value= (char*) dflt_key_cache + (ulong)value; - end= int10_to_str(*(long*) value, buff, 10); - break; - case SHOW_KEY_CACHE_LONGLONG: - update_key_cache_stat_var(dflt_key_cache, (size_t) value); - value= (char*) dflt_key_cache + (ulong)value; - end= longlong10_to_str(*(longlong*) value, buff, 10); - break; case SHOW_UNDEF: break; // Return empty string case SHOW_SYS: // Cannot happen |