Commit 533b18c8 authored by serg@serg.mylan's avatar serg@serg.mylan

cleanup of SHOW STATUS code, as a preparation for WL#2935

(MySQL plugin interface: status variables)

adding SHOW_FUNC, removing SHOW_some_specific_value,
only generic SHOW_LONG/SHOW_CHAR/etc are recognized.
changing to use SHOW_FUNC instead of ha_update_statistics
parent 70d13a7c
...@@ -277,7 +277,6 @@ void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offse ...@@ -277,7 +277,6 @@ void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offse
void innobase_drop_database(char *path); void innobase_drop_database(char *path);
bool innobase_show_status(THD* thd, stat_print_fn*, enum ha_stat_type); bool innobase_show_status(THD* thd, stat_print_fn*, enum ha_stat_type);
int innodb_export_status(void);
int innobase_release_temporary_latches(THD *thd); int innobase_release_temporary_latches(THD *thd);
......
...@@ -1180,15 +1180,6 @@ int ha_release_temporary_latches(THD *thd) ...@@ -1180,15 +1180,6 @@ int ha_release_temporary_latches(THD *thd)
#endif #endif
} }
int ha_update_statistics()
{
#ifdef WITH_INNOBASE_STORAGE_ENGINE
innodb_export_status();
#endif
return 0;
}
int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv) int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv)
{ {
int error=0; int error=0;
......
...@@ -1549,7 +1549,6 @@ int ha_initialize_handlerton(handlerton *hton); ...@@ -1549,7 +1549,6 @@ int ha_initialize_handlerton(handlerton *hton);
TYPELIB *ha_known_exts(void); TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag); int ha_panic(enum ha_panic_function flag);
int ha_update_statistics();
void ha_close_connection(THD* thd); void ha_close_connection(THD* thd);
bool ha_flush_logs(handlerton *db_type); bool ha_flush_logs(handlerton *db_type);
void ha_drop_database(char* path); void ha_drop_database(char* path);
......
This diff is collapsed.
...@@ -623,6 +623,45 @@ sys_var_have_variable sys_have_row_based_replication("have_row_based_replication ...@@ -623,6 +623,45 @@ sys_var_have_variable sys_have_row_based_replication("have_row_based_replication
/* Global read-only variable describing server license */ /* Global read-only variable describing server license */
sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE)); sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE));
#ifdef HAVE_REPLICATION
static int show_slave_skip_errors(THD *thd, show_var_st *var, char *buff)
{
var->type=SHOW_CHAR;
var->value= buff;
if (!use_slave_mask || bitmap_is_clear_all(&slave_error_mask))
{
var->value= "OFF";
}
else if (bitmap_is_set_all(&slave_error_mask))
{
var->value= "ALL";
}
else
{
/* 10 is enough assuming errors are max 4 digits */
int i;
var->value= buff;
for (i= 1;
i < MAX_SLAVE_ERROR &&
(buff - var->value) < SHOW_VAR_FUNC_BUFF_SIZE;
i++)
{
if (bitmap_is_set(&slave_error_mask, i))
{
buff= int10_to_str(i, buff, 10);
*buff++= ',';
}
}
if (var->value != buff)
buff--; // Remove last ','
if (i < MAX_SLAVE_ERROR)
buff= strmov(buff, "..."); // Couldn't show all errors
*buff=0;
}
return 0;
}
#endif /* HAVE_REPLICATION */
/* /*
Variables shown by SHOW variables in alphabetical order Variables shown by SHOW variables in alphabetical order
...@@ -863,7 +902,7 @@ struct show_var_st init_vars[]= { ...@@ -863,7 +902,7 @@ struct show_var_st init_vars[]= {
(char*) &sys_slave_compressed_protocol, SHOW_SYS}, (char*) &sys_slave_compressed_protocol, SHOW_SYS},
{"slave_load_tmpdir", (char*) &slave_load_tmpdir, SHOW_CHAR_PTR}, {"slave_load_tmpdir", (char*) &slave_load_tmpdir, SHOW_CHAR_PTR},
{sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS}, {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS},
{"slave_skip_errors", (char*) &slave_error_mask, SHOW_SLAVE_SKIP_ERRORS}, {"slave_skip_errors", (char*) &show_slave_skip_errors, SHOW_FUNC},
{sys_slave_trans_retries.name,(char*) &sys_slave_trans_retries, SHOW_SYS}, {sys_slave_trans_retries.name,(char*) &sys_slave_trans_retries, SHOW_SYS},
#endif #endif
{sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS}, {sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS},
......
This diff is collapsed.
...@@ -175,27 +175,10 @@ enum SHOW_TYPE ...@@ -175,27 +175,10 @@ enum SHOW_TYPE
SHOW_UNDEF, SHOW_UNDEF,
SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR,
SHOW_DOUBLE_STATUS, SHOW_BOOL, SHOW_MY_BOOL, SHOW_DOUBLE_STATUS, SHOW_BOOL, SHOW_MY_BOOL,
SHOW_OPEN_TABLES, SHOW_TABLE_DEFINITIONS, SHOW_STARTTIME, SHOW_QUESTION,
SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS, SHOW_HA_ROWS, SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS, SHOW_HA_ROWS,
SHOW_VARS, SHOW_ARRAY, SHOW_FUNC,
#ifdef HAVE_OPENSSL
SHOW_SSL_CTX_SESS_ACCEPT, SHOW_SSL_CTX_SESS_ACCEPT_GOOD,
SHOW_SSL_GET_VERSION, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE,
SHOW_SSL_CTX_SESS_CB_HITS, SHOW_SSL_CTX_SESS_ACCEPT_RENEGOTIATE,
SHOW_SSL_CTX_SESS_NUMBER, SHOW_SSL_SESSION_REUSED,
SHOW_SSL_CTX_SESS_GET_CACHE_SIZE, SHOW_SSL_GET_CIPHER,
SHOW_SSL_GET_DEFAULT_TIMEOUT, SHOW_SSL_GET_VERIFY_MODE,
SHOW_SSL_CTX_GET_VERIFY_MODE, SHOW_SSL_GET_VERIFY_DEPTH,
SHOW_SSL_CTX_GET_VERIFY_DEPTH, SHOW_SSL_CTX_SESS_CONNECT,
SHOW_SSL_CTX_SESS_CONNECT_RENEGOTIATE, SHOW_SSL_CTX_SESS_CONNECT_GOOD,
SHOW_SSL_CTX_SESS_HITS, SHOW_SSL_CTX_SESS_MISSES,
SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL,
SHOW_SSL_GET_CIPHER_LIST,
#endif /* HAVE_OPENSSL */
SHOW_NET_COMPRESSION,
SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS,
SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG,
SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS
}; };
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED}; enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
...@@ -204,19 +187,19 @@ extern const char *show_comp_option_name[]; ...@@ -204,19 +187,19 @@ extern const char *show_comp_option_name[];
typedef int *(*update_var)(THD *, struct show_var_st *); typedef int *(*update_var)(THD *, struct show_var_st *);
typedef struct show_var_st { typedef struct show_var_st {
const char *name; const char *name;
char *value; char *value;
SHOW_TYPE type; SHOW_TYPE type;
} SHOW_VAR; } SHOW_VAR;
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
typedef int (*show_var_func)(THD *, struct show_var_st *, char *);
typedef struct st_lex_user { typedef struct st_lex_user {
LEX_STRING user, host, password; LEX_STRING user, host, password;
} LEX_USER; } LEX_USER;
/* /*
This structure specifies the maximum amount of resources which This structure specifies the maximum amount of resources which
can be consumed by each account. Zero value of a member means can be consumed by each account. Zero value of a member means
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment