mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
WL#2935 - SHOW STATUS support in plugins
The patch adds DYNAMIC_ARRAY all_status_vars, which is now the sole source of status information for SHOW STATUS. Status variables can be added to and removed from the array dynamically. SHOW STATUS command uses this array instead of static array from mysqld.cc Compatibility with the old, global list of status variables is preserved in init_server_components(), where this global list is simply appended to all_status_vars. include/plugin.h: WL#2935 - SHOW STATUS support in plugins plugin/fulltext/plugin_example.c: WL#2935 - SHOW STATUS support in plugins example sql/ha_innodb.cc: s/struct show_var_st/SHOW_VAR/ sql/ha_innodb.h: s/struct show_var_st/SHOW_VAR/ sql/mysql_priv.h: WL#2935 - SHOW STATUS support in plugins add_status_vars(), remove_status_vars() sql/mysqld.cc: bug: plugin_free must be called even with --skip-grants add_status_vars()/free_status_vars(), remove unused SHOW_xxx_CONST s/struct show_var_st/SHOW_VAR/ sql/set_var.cc: s/struct show_var_st/SHOW_VAR/ sql/sql_parse.cc: s/struct show_var_st/SHOW_VAR/ sql/sql_plugin.cc: WL#2935 - SHOW STATUS support in plugins sql/sql_plugin.h: WL#2935 - SHOW STATUS support in plugins sql/sql_show.cc: WL#2935 - SHOW STATUS support in plugins DYNAMIC_ARRAY all_status_vars, add_status_vars(), remove_status_vars() s/struct show_var_st/SHOW_VAR/ sql/structs.h: WL#2935 - SHOW STATUS support in plugins SHOW STATUS definitions moved to include/plugin.h and sql_plugin.h s/struct show_var_st/SHOW_VAR/
This commit is contained in:
@ -41,7 +41,26 @@
|
||||
int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||
int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
|
||||
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
|
||||
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0}}
|
||||
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0}}
|
||||
|
||||
/*
|
||||
declarations for SHOW STATUS support in plugins
|
||||
*/
|
||||
enum enum_mysql_show_type
|
||||
{
|
||||
SHOW_UNDEF, SHOW_BOOL, SHOW_MY_BOOL, SHOW_INT, SHOW_LONG,
|
||||
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
|
||||
SHOW_ARRAY, SHOW_FUNC
|
||||
};
|
||||
|
||||
struct st_mysql_show_var {
|
||||
const char *name;
|
||||
char *value;
|
||||
enum enum_mysql_show_type type;
|
||||
};
|
||||
|
||||
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
|
||||
typedef int (*mysql_show_var_func)(void *, struct st_mysql_show_var*, char *);
|
||||
|
||||
/*
|
||||
Plugin description structure.
|
||||
@ -57,6 +76,7 @@ struct st_mysql_plugin
|
||||
int (*init)(void); /* the function to invoke when plugin is loaded */
|
||||
int (*deinit)(void); /* the function to invoke when plugin is unloaded */
|
||||
uint version; /* plugin version (for SHOW PLUGINS) */
|
||||
struct st_mysql_show_var *status_vars;
|
||||
};
|
||||
|
||||
/*************************************************************************
|
||||
|
Reference in New Issue
Block a user