Commit c7baf602 authored by brian@zim.(none)'s avatar brian@zim.(none)

Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1

into  zim.(none):/tmp/mysql-5.1-arch
parents e1c245bf b5fdcc29
...@@ -60,7 +60,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \ ...@@ -60,7 +60,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
builtin_ ## NAME ## _sizeof_struct_st_plugin, \ builtin_ ## NAME ## _sizeof_struct_st_plugin, \
builtin_ ## NAME ## _plugin) builtin_ ## NAME ## _plugin)
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0}} #define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}}
/* /*
declarations for SHOW STATUS support in plugins declarations for SHOW STATUS support in plugins
...@@ -96,6 +96,8 @@ struct st_mysql_plugin ...@@ -96,6 +96,8 @@ struct st_mysql_plugin
int (*deinit)(void); /* the function to invoke when plugin is unloaded */ int (*deinit)(void); /* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for SHOW PLUGINS) */ unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars; struct st_mysql_show_var *status_vars;
void * __reserved1; /* placeholder for system variables */
void * __reserved2; /* placeholder for config options */
}; };
/************************************************************************* /*************************************************************************
......
...@@ -225,7 +225,9 @@ mysql_declare_plugin(ftexample) ...@@ -225,7 +225,9 @@ mysql_declare_plugin(ftexample)
simple_parser_plugin_init, /* init function (when loaded) */ simple_parser_plugin_init, /* init function (when loaded) */
simple_parser_plugin_deinit,/* deinit function (when unloaded) */ simple_parser_plugin_deinit,/* deinit function (when unloaded) */
0x0001, /* version */ 0x0001, /* version */
simple_status /* status variables */ simple_status, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -7616,7 +7616,9 @@ mysql_declare_plugin(innobase) ...@@ -7616,7 +7616,9 @@ mysql_declare_plugin(innobase)
innobase_init, /* Plugin Init */ innobase_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
innodb_status_variables_export innodb_status_variables_export,/* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -6389,6 +6389,8 @@ static int ndbcluster_init() ...@@ -6389,6 +6389,8 @@ static int ndbcluster_init()
#endif #endif
h.flags= HTON_CAN_RECREATE | HTON_TEMPORARY_NOT_SUPPORTED; h.flags= HTON_CAN_RECREATE | HTON_TEMPORARY_NOT_SUPPORTED;
h.discover= ndbcluster_discover; h.discover= ndbcluster_discover;
h.find_files= ndbcluster_find_files;
h.table_exists_in_engine= ndbcluster_table_exists_in_engine;
} }
if (have_ndbcluster != SHOW_OPTION_YES) if (have_ndbcluster != SHOW_OPTION_YES)
...@@ -10598,7 +10600,9 @@ mysql_declare_plugin(ndbcluster) ...@@ -10598,7 +10600,9 @@ mysql_declare_plugin(ndbcluster)
ndbcluster_init, /* Plugin Init */ ndbcluster_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
ndb_status_variables_export ndb_status_variables_export,/* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
......
...@@ -5640,7 +5640,9 @@ mysql_declare_plugin(partition) ...@@ -5640,7 +5640,9 @@ mysql_declare_plugin(partition)
partition_initialize, /* Plugin Init */ partition_initialize, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100, /* 1.0 */ 0x0100, /* 1.0 */
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
......
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
#include <myisampack.h> #include <myisampack.h>
#include <errno.h> #include <errno.h>
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
#define NDB_MAX_ATTRIBUTES_IN_TABLE 128
#include "ha_ndbcluster.h"
#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h" #include "ha_partition.h"
#endif #endif
...@@ -430,12 +425,6 @@ int ha_initialize_handlerton(st_plugin_int *plugin) ...@@ -430,12 +425,6 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
savepoint_alloc_size+= tmp; savepoint_alloc_size+= tmp;
hton->slot= total_ha++; hton->slot= total_ha++;
hton2plugin[hton->slot]=plugin; hton2plugin[hton->slot]=plugin;
/* This is just a temp need until plugin/engine startup is fixed */
if (plugin->plugin->status_vars)
{
add_status_vars(plugin->plugin->status_vars);
}
if (hton->prepare) if (hton->prepare)
total_ha_2pc++; total_ha_2pc++;
break; break;
...@@ -2751,6 +2740,29 @@ int ha_discover(THD *thd, const char *db, const char *name, ...@@ -2751,6 +2740,29 @@ int ha_discover(THD *thd, const char *db, const char *name,
to ask engine if there are any new tables that should be written to disk to ask engine if there are any new tables that should be written to disk
or any dropped tables that need to be removed from disk or any dropped tables that need to be removed from disk
*/ */
typedef struct st_find_files_args
{
const char *db;
const char *path;
const char *wild;
bool dir;
List<char> *files;
};
static my_bool find_files_handlerton(THD *thd, st_plugin_int *plugin,
void *arg)
{
st_find_files_args *vargs= (st_find_files_args *)arg;
handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->find_files)
if (hton->find_files(thd, vargs->db, vargs->path, vargs->wild,
vargs->dir, vargs->files))
return TRUE;
return FALSE;
}
int int
ha_find_files(THD *thd,const char *db,const char *path, ha_find_files(THD *thd,const char *db,const char *path,
...@@ -2760,10 +2772,11 @@ ha_find_files(THD *thd,const char *db,const char *path, ...@@ -2760,10 +2772,11 @@ ha_find_files(THD *thd,const char *db,const char *path,
DBUG_ENTER("ha_find_files"); DBUG_ENTER("ha_find_files");
DBUG_PRINT("enter", ("db: %s, path: %s, wild: %s, dir: %d", DBUG_PRINT("enter", ("db: %s, path: %s, wild: %s, dir: %d",
db, path, wild, dir)); db, path, wild, dir));
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE st_find_files_args args= {db, path, wild, dir, files};
if (have_ndbcluster == SHOW_OPTION_YES)
error= ndbcluster_find_files(thd, db, path, wild, dir, files); plugin_foreach(thd, find_files_handlerton,
#endif MYSQL_STORAGE_ENGINE_PLUGIN, &args);
/* The return value is not currently used */
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -2777,15 +2790,34 @@ ha_find_files(THD *thd,const char *db,const char *path, ...@@ -2777,15 +2790,34 @@ ha_find_files(THD *thd,const char *db,const char *path,
# Error code # Error code
*/ */
typedef struct st_table_exists_in_engine_args
{
const char *db;
const char *name;
};
static my_bool table_exists_in_engine_handlerton(THD *thd, st_plugin_int *plugin,
void *arg)
{
st_table_exists_in_engine_args *vargs= (st_table_exists_in_engine_args *)arg;
handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->table_exists_in_engine)
if ((hton->table_exists_in_engine(thd, vargs->db, vargs->name)) == 1)
return TRUE;
return FALSE;
}
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name) int ha_table_exists_in_engine(THD* thd, const char* db, const char* name)
{ {
int error= 0; int error= 0;
DBUG_ENTER("ha_table_exists_in_engine"); DBUG_ENTER("ha_table_exists_in_engine");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name)); DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE st_table_exists_in_engine_args args= {db, name};
if (have_ndbcluster == SHOW_OPTION_YES) error= plugin_foreach(thd, table_exists_in_engine_handlerton,
error= ndbcluster_table_exists_in_engine(thd, db, name); MYSQL_STORAGE_ENGINE_PLUGIN, &args);
#endif
DBUG_PRINT("exit", ("error: %d", error)); DBUG_PRINT("exit", ("error: %d", error));
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
...@@ -669,6 +669,10 @@ struct handlerton ...@@ -669,6 +669,10 @@ struct handlerton
struct handler_iterator *fill_this_in); struct handler_iterator *fill_this_in);
int (*discover)(THD* thd, const char *db, const char *name, int (*discover)(THD* thd, const char *db, const char *name,
const void** frmblob, uint* frmlen); const void** frmblob, uint* frmlen);
int (*find_files)(THD *thd,const char *db,const char *path,
const char *wild, bool dir, List<char> *files);
int (*table_exists_in_engine)(THD* thd, const char *db,
const char *name);
}; };
......
...@@ -4678,6 +4678,8 @@ mysql_declare_plugin(binlog) ...@@ -4678,6 +4678,8 @@ mysql_declare_plugin(binlog)
binlog_init, /* Plugin Init */ binlog_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -1186,7 +1186,7 @@ void clean_up(bool print_message) ...@@ -1186,7 +1186,7 @@ void clean_up(bool print_message)
udf_free(); udf_free();
#endif #endif
} }
plugin_free(); plugin_shutdown();
if (tc_log) if (tc_log)
tc_log->close(); tc_log->close();
xid_cache_free(); xid_cache_free();
...@@ -2627,7 +2627,7 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -2627,7 +2627,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
/* /*
Add server status variables to the dynamic list of Add server status variables to the dynamic list of
status variables that is shown by SHOW STATUS. status variables that is shown by SHOW STATUS.
Later, in plugin_init, plugin_load, and mysql_install_plugin Later, in plugin_init, and mysql_install_plugin
new entries could be added to that list. new entries could be added to that list.
*/ */
if (add_status_vars(status_vars)) if (add_status_vars(status_vars))
...@@ -3176,7 +3176,7 @@ server."); ...@@ -3176,7 +3176,7 @@ server.");
using_update_log=1; using_update_log=1;
} }
if (plugin_init()) if (plugin_init(0))
{ {
sql_print_error("Failed to init plugins."); sql_print_error("Failed to init plugins.");
return 1; return 1;
...@@ -3608,7 +3608,6 @@ we force server id to 2, but this MySQL server will not act as a slave."); ...@@ -3608,7 +3608,6 @@ we force server id to 2, but this MySQL server will not act as a slave.");
if (!opt_noacl) if (!opt_noacl)
{ {
plugin_load();
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
udf_init(); udf_init();
#endif #endif
......
...@@ -63,6 +63,10 @@ static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM]; ...@@ -63,6 +63,10 @@ static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
static rw_lock_t THR_LOCK_plugin; static rw_lock_t THR_LOCK_plugin;
static bool initialized= 0; static bool initialized= 0;
/* prototypes */
my_bool plugin_register_builtin(struct st_mysql_plugin *plugin);
void plugin_load(void);
static struct st_plugin_dl *plugin_dl_find(const LEX_STRING *dl) static struct st_plugin_dl *plugin_dl_find(const LEX_STRING *dl)
{ {
uint i; uint i;
...@@ -442,15 +446,6 @@ static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int repo ...@@ -442,15 +446,6 @@ static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int repo
tmp.name.length= name_len; tmp.name.length= name_len;
tmp.ref_count= 0; tmp.ref_count= 0;
tmp.state= PLUGIN_IS_UNINITIALIZED; tmp.state= PLUGIN_IS_UNINITIALIZED;
if (plugin->status_vars)
{
SHOW_VAR array[2]= {
{plugin->name, (char*)plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF}
};
if (add_status_vars(array)) // add_status_vars makes a copy
goto err;
}
if (! (tmp_plugin_ptr= plugin_insert_or_reuse(&tmp))) if (! (tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
goto err; goto err;
if (my_hash_insert(&plugin_hash[plugin->type], (byte*)tmp_plugin_ptr)) if (my_hash_insert(&plugin_hash[plugin->type], (byte*)tmp_plugin_ptr))
...@@ -466,16 +461,35 @@ static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int repo ...@@ -466,16 +461,35 @@ static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int repo
if (report & REPORT_TO_LOG) if (report & REPORT_TO_LOG)
sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name->str); sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name->str);
err: err:
if (plugin->status_vars) plugin_dl_del(dl);
DBUG_RETURN(TRUE);
}
void plugin_deinitializer(struct st_plugin_int *plugin)
{
if (plugin->plugin->status_vars)
{ {
SHOW_VAR array[2]= { SHOW_VAR array[2]= {
{plugin->name, (char*)plugin->status_vars, SHOW_ARRAY}, {plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF} {0, 0, SHOW_UNDEF}
}; };
remove_status_vars(array); remove_status_vars(array);
} }
plugin_dl_del(dl);
DBUG_RETURN(TRUE); if (plugin->state == PLUGIN_IS_READY)
{
if (plugin->plugin->deinit)
{
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
if (plugin->plugin->deinit())
{
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
plugin->name.str));
}
}
plugin->state= PLUGIN_IS_UNINITIALIZED;
}
} }
...@@ -486,14 +500,7 @@ static void plugin_del(const LEX_STRING *name) ...@@ -486,14 +500,7 @@ static void plugin_del(const LEX_STRING *name)
DBUG_ENTER("plugin_del"); DBUG_ENTER("plugin_del");
if ((plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN))) if ((plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
{ {
if (plugin->plugin->status_vars) plugin_deinitializer(plugin);
{
SHOW_VAR array[2]= {
{plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF}
};
remove_status_vars(array);
}
hash_delete(&plugin_hash[plugin->plugin->type], (byte*)plugin); hash_delete(&plugin_hash[plugin->plugin->type], (byte*)plugin);
plugin_dl_del(&plugin->plugin_dl->dl); plugin_dl_del(&plugin->plugin_dl->dl);
plugin->state= PLUGIN_IS_FREED; plugin->state= PLUGIN_IS_FREED;
...@@ -523,6 +530,26 @@ static int plugin_initialize(struct st_plugin_int *plugin) ...@@ -523,6 +530,26 @@ static int plugin_initialize(struct st_plugin_int *plugin)
{ {
DBUG_ENTER("plugin_initialize"); DBUG_ENTER("plugin_initialize");
if (plugin->plugin->status_vars)
{
#ifdef FIX_LATER
/*
We have a problem right now where we can not prepend without
breaking backwards compatibility. We will fix this shortly so
that engines have "use names" and we wil use those for
CREATE TABLE, and use the plugin name then for adding automatic
variable names.
*/
SHOW_VAR array[2]= {
{plugin->name, (char*)plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF}
};
if (add_status_vars(array)) // add_status_vars makes a copy
goto err;
#else
add_status_vars(plugin->plugin->status_vars); // add_status_vars makes a copy
#endif /* FIX_LATER */
}
if (plugin->plugin->init) if (plugin->plugin->init)
{ {
if (plugin->plugin->init()) if (plugin->plugin->init())
...@@ -540,6 +567,8 @@ static int plugin_initialize(struct st_plugin_int *plugin) ...@@ -540,6 +567,8 @@ static int plugin_initialize(struct st_plugin_int *plugin)
goto err; goto err;
} }
plugin->state= PLUGIN_IS_READY;
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
DBUG_RETURN(1); DBUG_RETURN(1);
...@@ -592,52 +621,6 @@ err: ...@@ -592,52 +621,6 @@ err:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
static void plugin_call_initializer(void)
{
uint i;
DBUG_ENTER("plugin_call_initializer");
for (i= 0; i < plugin_array.elements; i++)
{
struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
struct st_plugin_int *);
if (tmp->state == PLUGIN_IS_UNINITIALIZED)
{
if (plugin_initialize(tmp))
plugin_del(&tmp->name);
else
tmp->state= PLUGIN_IS_READY;
}
}
DBUG_VOID_RETURN;
}
static void plugin_call_deinitializer(void)
{
uint i;
DBUG_ENTER("plugin_call_deinitializer");
for (i= 0; i < plugin_array.elements; i++)
{
struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
struct st_plugin_int *);
if (tmp->state == PLUGIN_IS_READY)
{
if (tmp->plugin->deinit)
{
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", tmp->name.str));
if (tmp->plugin->deinit())
{
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
tmp->name.str));
}
}
tmp->state= PLUGIN_IS_UNINITIALIZED;
}
}
DBUG_VOID_RETURN;
}
static byte *get_hash_key(const byte *buff, uint *length, static byte *get_hash_key(const byte *buff, uint *length,
my_bool not_used __attribute__((unused))) my_bool not_used __attribute__((unused)))
{ {
...@@ -647,7 +630,14 @@ static byte *get_hash_key(const byte *buff, uint *length, ...@@ -647,7 +630,14 @@ static byte *get_hash_key(const byte *buff, uint *length,
} }
int plugin_init(void) /*
The logic is that we first load and initialize all compiled in plugins.
From there we load up the dynamic types (assuming we have not been told to
skip this part).
Finally we inializie everything, aka the dynamic that have yet to initialize.
*/
int plugin_init(int skip_dynamic_loading)
{ {
int i; int i;
struct st_mysql_plugin **builtins; struct st_mysql_plugin **builtins;
...@@ -672,24 +662,46 @@ int plugin_init(void) ...@@ -672,24 +662,46 @@ int plugin_init(void)
goto err; goto err;
} }
/* Register all the built-in plugins */ /*
First we register builtin plugins
*/
for (builtins= mysqld_builtins; *builtins; builtins++) for (builtins= mysqld_builtins; *builtins; builtins++)
{ {
for (plugin= *builtins; plugin->info; plugin++) for (plugin= *builtins; plugin->info; plugin++)
{ {
// if (!(strcmp(plugin->name, "MyISAM")))
{
if (plugin_register_builtin(plugin)) if (plugin_register_builtin(plugin))
goto err; goto err;
struct st_plugin_int *tmp=dynamic_element(&plugin_array, struct st_plugin_int *tmp= dynamic_element(&plugin_array,
plugin_array.elements-1, plugin_array.elements-1,
struct st_plugin_int *); struct st_plugin_int *);
if (plugin_initialize(tmp)) if (plugin_initialize(tmp))
goto err; goto err;
tmp->state= PLUGIN_IS_READY;
} }
} }
}
/* Register all dynamic plugins */
if (!skip_dynamic_loading)
plugin_load();
initialized= 1; initialized= 1;
/*
Now we initialize all remaining plugins
*/
for (i= 0; i < plugin_array.elements; i++)
{
struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
struct st_plugin_int *);
if (tmp->state == PLUGIN_IS_UNINITIALIZED)
{
if (plugin_initialize(tmp))
plugin_del(&tmp->name);
}
}
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
...@@ -734,8 +746,6 @@ void plugin_load(void) ...@@ -734,8 +746,6 @@ void plugin_load(void)
THD *new_thd; THD *new_thd;
DBUG_ENTER("plugin_load"); DBUG_ENTER("plugin_load");
DBUG_ASSERT(initialized);
if (!(new_thd= new THD)) if (!(new_thd= new THD))
{ {
sql_print_error("Can't allocate memory for plugin structures"); sql_print_error("Can't allocate memory for plugin structures");
...@@ -772,7 +782,6 @@ void plugin_load(void) ...@@ -772,7 +782,6 @@ void plugin_load(void)
DBUG_PRINT("warning", ("Couldn't load plugin named '%s' with soname '%s'.", DBUG_PRINT("warning", ("Couldn't load plugin named '%s' with soname '%s'.",
name.str, dl.str)); name.str, dl.str));
} }
plugin_call_initializer();
if (error > 0) if (error > 0)
sql_print_error(ER(ER_GET_ERRNO), my_errno); sql_print_error(ER(ER_GET_ERRNO), my_errno);
end_read_record(&read_record_info); end_read_record(&read_record_info);
...@@ -787,11 +796,22 @@ end: ...@@ -787,11 +796,22 @@ end:
} }
void plugin_free(void) void plugin_shutdown(void)
{ {
uint i; uint i;
DBUG_ENTER("plugin_free"); DBUG_ENTER("plugin_shutdown");
plugin_call_deinitializer();
/*
We loop through all plugins and call deinit() if they have one.
*/
for (i= 0; i < plugin_array.elements; i++)
{
struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
struct st_plugin_int *);
plugin_deinitializer(tmp);
}
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++) for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
hash_free(&plugin_hash[i]); hash_free(&plugin_hash[i]);
delete_dynamic(&plugin_array); delete_dynamic(&plugin_array);
...@@ -841,8 +861,6 @@ my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING ...@@ -841,8 +861,6 @@ my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING
goto err; goto err;
} }
tmp->state= PLUGIN_IS_READY;
table->use_all_columns(); table->use_all_columns();
restore_record(table, s->default_values); restore_record(table, s->default_values);
table->field[0]->store(name->str, name->length, system_charset_info); table->field[0]->store(name->str, name->length, system_charset_info);
......
...@@ -67,17 +67,14 @@ typedef int (*plugin_type_init)(struct st_plugin_int *); ...@@ -67,17 +67,14 @@ typedef int (*plugin_type_init)(struct st_plugin_int *);
extern char *opt_plugin_dir_ptr; extern char *opt_plugin_dir_ptr;
extern char opt_plugin_dir[FN_REFLEN]; extern char opt_plugin_dir[FN_REFLEN];
extern const LEX_STRING plugin_type_names[]; extern const LEX_STRING plugin_type_names[];
extern int plugin_init(void); extern int plugin_init(int);
extern void plugin_load(void); extern void plugin_shutdown(void);
extern void plugin_free(void);
extern my_bool plugin_is_ready(const LEX_STRING *name, int type); extern my_bool plugin_is_ready(const LEX_STRING *name, int type);
extern st_plugin_int *plugin_lock(const LEX_STRING *name, int type); extern st_plugin_int *plugin_lock(const LEX_STRING *name, int type);
extern void plugin_unlock(struct st_plugin_int *plugin); extern void plugin_unlock(struct st_plugin_int *plugin);
extern my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl); extern my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl);
extern my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name); extern my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
extern my_bool plugin_register_builtin(struct st_mysql_plugin *plugin);
typedef my_bool (plugin_foreach_func)(THD *thd, typedef my_bool (plugin_foreach_func)(THD *thd,
st_plugin_int *plugin, st_plugin_int *plugin,
void *arg); void *arg);
......
...@@ -1583,7 +1583,9 @@ mysql_declare_plugin(archive) ...@@ -1583,7 +1583,9 @@ mysql_declare_plugin(archive)
archive_db_init, /* Plugin Init */ archive_db_init, /* Plugin Init */
archive_db_done, /* Plugin Deinit */ archive_db_done, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -223,6 +223,8 @@ mysql_declare_plugin(blackhole) ...@@ -223,6 +223,8 @@ mysql_declare_plugin(blackhole)
blackhole_init, /* Plugin Init */ blackhole_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -1529,7 +1529,9 @@ mysql_declare_plugin(csv) ...@@ -1529,7 +1529,9 @@ mysql_declare_plugin(csv)
tina_init_func, /* Plugin Init */ tina_init_func, /* Plugin Init */
tina_done_func, /* Plugin Deinit */ tina_done_func, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -715,7 +715,9 @@ mysql_declare_plugin(example) ...@@ -715,7 +715,9 @@ mysql_declare_plugin(example)
example_init_func, /* Plugin Init */ example_init_func, /* Plugin Init */
example_done_func, /* Plugin Deinit */ example_done_func, /* Plugin Deinit */
0x0001 /* 0.1 */, 0x0001 /* 0.1 */,
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -2896,7 +2896,9 @@ mysql_declare_plugin(federated) ...@@ -2896,7 +2896,9 @@ mysql_declare_plugin(federated)
federated_db_init, /* Plugin Init */ federated_db_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100 /* 1.0 */, 0x0100 /* 1.0 */,
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -708,6 +708,8 @@ mysql_declare_plugin(heap) ...@@ -708,6 +708,8 @@ mysql_declare_plugin(heap)
heap_init, heap_init,
NULL, NULL,
0x0100, /* 1.0 */ 0x0100, /* 1.0 */
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -1800,7 +1800,9 @@ mysql_declare_plugin(myisam) ...@@ -1800,7 +1800,9 @@ mysql_declare_plugin(myisam)
myisam_init, /* Plugin Init */ myisam_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100, /* 1.0 */ 0x0100, /* 1.0 */
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
...@@ -573,6 +573,8 @@ mysql_declare_plugin(myisammrg) ...@@ -573,6 +573,8 @@ mysql_declare_plugin(myisammrg)
myisammrg_init, /* Plugin Init */ myisammrg_init, /* Plugin Init */
NULL, /* Plugin Deinit */ NULL, /* Plugin Deinit */
0x0100, /* 1.0 */ 0x0100, /* 1.0 */
0 NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;
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