19 #include <my_global.h>
26 #define SHOW_always_last SHOW_KEY_CACHE_LONG, \
27 SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
28 SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
29 SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_LEX_STRING, \
31 #include <mysql/plugin.h>
32 #undef SHOW_always_last
36 #include "my_getopt.h"
39 enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
40 enum enum_plugin_load_option { PLUGIN_OFF, PLUGIN_ON, PLUGIN_FORCE,
41 PLUGIN_FORCE_PLUS_PERMANENT };
42 extern const char *global_plugin_typelib_names[];
48 #define plugin_ref_to_int(A) A
49 #define plugin_int_to_ref(A) A
51 #define plugin_ref_to_int(A) (A ? A[0] : NULL)
52 #define plugin_int_to_ref(A) &(A)
58 #define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1
59 #define PLUGIN_INIT_SKIP_PLUGIN_TABLE 2
60 #define PLUGIN_INIT_SKIP_INITIALIZATION 4
62 #define INITIAL_LEX_PLUGIN_LIST_SIZE 16
64 typedef enum enum_mysql_show_type SHOW_TYPE;
68 #define MYSQL_ANY_PLUGIN -1
77 #define PLUGIN_IS_FREED 1
78 #define PLUGIN_IS_DELETED 2
79 #define PLUGIN_IS_UNINITIALIZED 4
80 #define PLUGIN_IS_READY 8
81 #define PLUGIN_IS_DYING 16
82 #define PLUGIN_IS_DISABLED 32
107 enum enum_plugin_load_option load_option;
117 #define plugin_decl(pi) ((pi)->plugin)
118 #define plugin_dlib(pi) ((pi)->plugin_dl)
119 #define plugin_data(pi,cast) ((cast)((pi)->data))
120 #define plugin_name(pi) (&((pi)->name))
121 #define plugin_state(pi) ((pi)->state)
122 #define plugin_load_option(pi) ((pi)->load_option)
123 #define plugin_equals(p1,p2) ((p1) == (p2))
126 #define plugin_decl(pi) ((pi)[0]->plugin)
127 #define plugin_dlib(pi) ((pi)[0]->plugin_dl)
128 #define plugin_data(pi,cast) ((cast)((pi)[0]->data))
129 #define plugin_name(pi) (&((pi)[0]->name))
130 #define plugin_state(pi) ((pi)[0]->state)
131 #define plugin_load_option(pi) ((pi)[0]->load_option)
132 #define plugin_equals(p1,p2) ((p1) && (p2) && (p1)[0] == (p2)[0])
138 extern char *opt_plugin_dir_ptr;
139 extern char opt_plugin_dir[FN_REFLEN];
142 extern int plugin_init(
int *argc,
char **argv,
int init_flags);
143 extern void plugin_shutdown(
void);
144 extern void memcached_shutdown(
void);
145 void add_plugin_options(std::vector<my_option> *options,
MEM_ROOT *mem_root);
147 #define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C)
148 #define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C)
149 #define my_plugin_lock(A,B) plugin_lock(A,B)
150 #define my_plugin_lock_ci(A,B) plugin_lock(A,B)
151 extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr);
152 extern plugin_ref plugin_lock_by_name(THD *thd,
const LEX_STRING *
name,
154 extern void plugin_unlock(THD *thd, plugin_ref plugin);
155 extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count);
156 extern bool mysql_install_plugin(THD *thd,
const LEX_STRING *
name,
158 extern bool mysql_uninstall_plugin(THD *thd,
const LEX_STRING *
name);
160 extern void plugin_thdvar_init(THD *thd,
bool enable_plugins);
161 extern void plugin_thdvar_cleanup(THD *thd);
162 extern SHOW_COMP_OPTION plugin_status(
const char *
name,
size_t len,
int type);
163 extern bool check_valid_path(
const char *path,
size_t length);
165 typedef my_bool (plugin_foreach_func)(THD *thd,
168 #define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D)
169 extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
170 int type, uint state_mask,
void *arg);
174 int lock_plugin_data();
175 int unlock_plugin_data();