44
44
extern int initialize_schema_table(st_plugin_int *plugin);
45
45
extern int finalize_schema_table(st_plugin_int *plugin);
47
extern int initialize_udf(st_plugin_int *plugin);
48
extern int finalize_udf(st_plugin_int *plugin);
48
51
The number of elements in both plugin_type_initialize and
49
52
plugin_type_deinitialize should equal to the number of plugins
52
55
plugin_type_init plugin_type_initialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
54
0,ha_initialize_handlerton,0,0,initialize_schema_table,
57
initialize_udf,ha_initialize_handlerton,0,0,initialize_schema_table,
58
61
plugin_type_init plugin_type_deinitialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
60
0,ha_finalize_handlerton,0,0,finalize_schema_table,
63
finalize_udf,ha_finalize_handlerton,0,0,finalize_schema_table,
65
67
static const char *plugin_interface_version_sym=
66
68
"_mysql_plugin_interface_version_";
67
69
static const char *sizeof_st_plugin_sym=
68
70
"_mysql_sizeof_struct_st_plugin_";
69
71
static const char *plugin_declarations_sym= "_mysql_plugin_declarations_";
70
72
static int min_plugin_interface_version= MYSQL_PLUGIN_INTERFACE_VERSION & ~0xFF;
73
74
/* Note that 'int version' must be the first field of every plugin
74
75
sub-structure (plugin->info).
76
77
static int min_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
79
MYSQL_UDF_INTERFACE_VERSION,
79
80
MYSQL_HANDLERTON_INTERFACE_VERSION,
80
81
MYSQL_FTPARSER_INTERFACE_VERSION,
81
82
MYSQL_DAEMON_INTERFACE_VERSION,
85
86
static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
87
0x0000, /* UDF: not implemented */
88
MYSQL_UDF_INTERFACE_VERSION,
88
89
MYSQL_HANDLERTON_INTERFACE_VERSION,
89
90
MYSQL_FTPARSER_INTERFACE_VERSION,
90
91
MYSQL_DAEMON_INTERFACE_VERSION,
307
305
sizeof(struct st_plugin_dl));
310
#endif /* HAVE_DLOPEN */
313
309
static inline void free_plugin_mem(struct st_plugin_dl *p)
317
312
dlclose(p->handle);
319
313
my_free(p->dl.str, MYF(MY_ALLOW_ZERO_PTR));
320
314
if (p->version != MYSQL_PLUGIN_INTERFACE_VERSION)
321
315
my_free((uchar*)p->plugins, MYF(MY_ALLOW_ZERO_PTR));