diff options
Diffstat (limited to 'sql/sql_plugin.h')
-rw-r--r-- | sql/sql_plugin.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 9f0d383fd01..4e894bb82e3 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -17,7 +17,6 @@ #ifndef _sql_plugin_h #define _sql_plugin_h -#include <my_global.h> /* the following #define adds server-only members to enum_mysql_show_type, @@ -27,7 +26,7 @@ SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \ SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \ SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_LEX_STRING -#include <mysql/plugin.h> +#include <my_global.h> #undef SHOW_always_last #include "m_string.h" /* LEX_STRING */ @@ -39,7 +38,10 @@ enum enum_plugin_load_option { PLUGIN_OFF, PLUGIN_ON, PLUGIN_FORCE, PLUGIN_FORCE_PLUS_PERMANENT }; extern const char *global_plugin_typelib_names[]; +extern ulong dlopen_count; + #include <my_sys.h> +#include "sql_list.h" #ifdef DBUG_OFF #define plugin_ref_to_int(A) A @@ -79,15 +81,25 @@ typedef struct st_mysql_show_var SHOW_VAR; /* A handle for the dynamic library containing a plugin or plugins. */ +struct st_ptr_backup { + void **ptr; + void *value; + void save(void **p) { ptr= p; value= *p; } + void save(const char **p) { save((void**)p); } + void restore() { *ptr= value; } +}; + struct st_plugin_dl { LEX_STRING dl; void *handle; struct st_maria_plugin *plugins; + st_ptr_backup *ptr_backup; + uint nbackups; + uint ref_count; /* number of plugins loaded from the library */ int mysqlversion; int mariaversion; bool allocated; - uint ref_count; /* number of plugins loaded from the library */ }; /* A handle of a plugin */ @@ -97,6 +109,8 @@ struct st_plugin_int LEX_STRING name; struct st_maria_plugin *plugin; struct st_plugin_dl *plugin_dl; + st_ptr_backup *ptr_backup; + uint nbackups; uint state; uint ref_count; /* number of threads using the plugin */ uint locks_total; /* how many times the plugin was locked */ @@ -137,9 +151,9 @@ typedef struct st_plugin_int **plugin_ref; typedef int (*plugin_type_init)(struct st_plugin_int *); -extern char *opt_plugin_load; +extern I_List<i_string> *opt_plugin_load_list_ptr; extern char *opt_plugin_dir_ptr; -extern char opt_plugin_dir[FN_REFLEN]; +extern MYSQL_PLUGIN_IMPORT char opt_plugin_dir[FN_REFLEN]; extern const LEX_STRING plugin_type_names[]; extern ulong plugin_maturity; extern TYPELIB plugin_maturity_values; @@ -150,9 +164,7 @@ extern void plugin_shutdown(void); void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root); extern bool plugin_is_ready(const LEX_STRING *name, int type); #define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C) -#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C) #define my_plugin_lock(A,B) plugin_lock(A,B) -#define my_plugin_lock_ci(A,B) plugin_lock(A,B) extern plugin_ref plugin_lock(THD *thd, plugin_ref ptr); extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type); @@ -165,6 +177,8 @@ extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name, extern bool plugin_register_builtin(struct st_mysql_plugin *plugin); extern void plugin_thdvar_init(THD *thd); extern void plugin_thdvar_cleanup(THD *thd); +sys_var *find_plugin_sysvar(st_plugin_int *plugin, st_mysql_sys_var *var); +void plugin_opt_set_limits(struct my_option *, const struct st_mysql_sys_var *); extern SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type); extern bool check_valid_path(const char *path, size_t length); @@ -174,6 +188,8 @@ typedef my_bool (plugin_foreach_func)(THD *thd, #define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D) extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, int type, uint state_mask, void *arg); - extern void sync_dynamic_session_variables(THD* thd, bool global_lock); + +extern bool plugin_dl_foreach(THD *thd, const LEX_STRING *dl, + plugin_foreach_func *func, void *arg); #endif |