Merging into mysql-5.5.16-release.

This commit is contained in:
Mats Kindahl 2011-08-15 20:12:11 +02:00
parent dca971de92
commit ee789c28b4
31 changed files with 141 additions and 37 deletions

View file

@ -71,7 +71,7 @@ typedef struct st_mysql_xid MYSQL_XID;
Plugin API. Common for all plugin types.
*/
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103
/*
The allowable types of plugins
@ -120,7 +120,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
builtin_ ## NAME ## _plugin)
#define mysql_declare_plugin_end ,{0,0,0,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,0,0}}
/*
declarations for SHOW STATUS support in plugins
@ -143,6 +143,14 @@ struct st_mysql_show_var {
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *);
/*
Constants for plugin flags.
*/
#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */
#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */
/*
declarations for server variables and command line options
*/
@ -415,6 +423,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1; /* reserved for dependency checking */
unsigned long flags; /* flags for plugin */
};
/*************************************************************************

View file

@ -101,6 +101,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1;
unsigned long flags;
};
#include "plugin_ftparser.h"
#include "plugin.h"

View file

@ -101,6 +101,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1;
unsigned long flags;
};
#include "plugin_ftparser.h"
#include "plugin.h"

View file

@ -43,7 +43,7 @@ typedef enum _thd_wait_type_e {
THD_WAIT_BINLOG= 8,
THD_WAIT_GROUP_COMMIT= 9,
THD_WAIT_SYNC= 10,
THD_WAIT_LAST= 11
THD_WAIT_LAST= 11
} thd_wait_type;
extern struct thd_wait_service_st {
void (*thd_wait_begin_func)(void*, int);
@ -101,6 +101,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1;
unsigned long flags;
};
#include "plugin_ftparser.h"
struct st_mysql_daemon

View file

@ -154,7 +154,8 @@ mysql_declare_plugin(audit_null)
0x0002, /* version */
simple_status, /* status variables */
NULL, /* system variables */
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -88,7 +88,8 @@ mysql_declare_plugin(socket_auth)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -153,7 +153,8 @@ mysql_declare_plugin(dialog)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
},
{
MYSQL_AUTHENTICATION_PLUGIN,
@ -167,7 +168,8 @@ mysql_declare_plugin(dialog)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -162,7 +162,8 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -82,6 +82,7 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -125,7 +125,8 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
},
{
MYSQL_AUTHENTICATION_PLUGIN,
@ -139,7 +140,8 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -201,6 +201,7 @@ mysql_declare_plugin(daemon_example)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -267,7 +267,8 @@ mysql_declare_plugin(ftexample)
0x0001, /* version */
simple_status, /* status variables */
simple_system_variables, /* system variables */
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -429,6 +429,7 @@ mysql_declare_plugin(semi_sync_master)
0x0100 /* 1.0 */,
semi_sync_master_status_vars, /* status variables */
semi_sync_master_system_vars, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -225,6 +225,7 @@ mysql_declare_plugin(semi_sync_slave)
0x0100 /* 1.0 */,
semi_sync_slave_status_vars, /* status variables */
semi_sync_slave_system_vars, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -11023,7 +11023,8 @@ mysql_declare_plugin(ndbcluster)
0x0100 /* 1.0 */,
ndb_status_variables_export,/* status variables */
system_variables, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -7183,7 +7183,8 @@ mysql_declare_plugin(partition)
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -6604,6 +6604,7 @@ mysql_declare_plugin(binlog)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -6415,3 +6415,8 @@ ER_ERROR_IN_TRIGGER_BODY
ER_ERROR_IN_UNKNOWN_TRIGGER_BODY
eng "Unknown trigger has an error in its body: '%-.256s'"
ER_PLUGIN_NO_UNINSTALL
eng "Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it."
ER_PLUGIN_NO_INSTALL
eng "Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it."

View file

@ -9651,7 +9651,8 @@ mysql_declare_plugin(mysql_password)
0x0100, /* Version (1.0) */
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
},
{
MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
@ -9665,7 +9666,8 @@ mysql_declare_plugin(mysql_password)
0x0100, /* Version (1.0) */
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -539,6 +539,11 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
#endif
}
/*
What's the purpose of this loop? If the goal is to catch a
missing 0 record at the end of a list, it will fail miserably
since the compiler is likely to optimize this away. /Matz
*/
for (i= 0;
((struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
i++)
@ -567,6 +572,23 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
}
plugin_dl.plugins= (struct st_mysql_plugin *)sym;
/*
If report is REPORT_TO_USER, we were called from
mysql_install_plugin. Otherwise, we are called directly or
indirectly from plugin_init.
*/
if (report == REPORT_TO_USER)
{
st_mysql_plugin *plugin= plugin_dl.plugins;
for ( ; plugin->info ; ++plugin)
if (plugin->flags & PLUGIN_OPT_NO_INSTALL)
{
report_error(report, ER_PLUGIN_NO_INSTALL, plugin->name);
free_plugin_mem(&plugin_dl);
DBUG_RETURN(0);
}
}
/* Duplicate and convert dll name */
plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
@ -1884,6 +1906,16 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
goto err;
}
/*
Error message for ER_PLUGIN_IS_PERMANENT is not suitable for
plugins marked as not dynamically uninstallable, so we have a
separate one instead of changing the old one.
*/
if (plugin->plugin->flags & PLUGIN_OPT_NO_UNINSTALL)
{
my_error(ER_PLUGIN_NO_UNINSTALL, MYF(0), plugin->plugin->name);
goto err;
}
plugin->state= PLUGIN_IS_DELETED;
if (plugin->ref_count)

View file

@ -1766,7 +1766,8 @@ mysql_declare_plugin(archive)
0x0300 /* 3.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -448,6 +448,7 @@ mysql_declare_plugin(blackhole)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -1766,7 +1766,8 @@ mysql_declare_plugin(csv)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -1008,6 +1008,7 @@ mysql_declare_plugin(example)
0x0001 /* 0.1 */,
func_status, /* status variables */
example_system_variables, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -3481,6 +3481,7 @@ mysql_declare_plugin(federated)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -825,6 +825,7 @@ mysql_declare_plugin(heap)
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -11402,7 +11402,8 @@ mysql_declare_plugin(innobase)
INNODB_VERSION_SHORT,
innodb_status_variables_export,/* status variables */
innobase_system_variables, /* system variables */
NULL /* reserved */
NULL, /* reserved */
0, /* flags */
},
i_s_innodb_trx,
i_s_innodb_locks,

View file

@ -638,7 +638,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_trx =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
@ -904,7 +908,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_locks =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
@ -1087,7 +1095,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
/*******************************************************************//**
@ -1420,7 +1432,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
@ -1470,7 +1486,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
@ -1711,7 +1731,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
@ -1761,7 +1785,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
/* reserved for dependency checking */
/* void* */
STRUCT_FLD(__reserved1, NULL)
STRUCT_FLD(__reserved1, NULL),
/* Plugin flags */
/* unsigned long */
STRUCT_FLD(flags, 0UL),
};
/*******************************************************************//**

View file

@ -2086,7 +2086,8 @@ mysql_declare_plugin(myisam)
0x0100, /* 1.0 */
NULL, /* status variables */
myisam_sysvars, /* system variables */
NULL
NULL,
0,
}
mysql_declare_plugin_end;

View file

@ -1687,6 +1687,7 @@ mysql_declare_plugin(myisammrg)
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;

View file

@ -166,7 +166,8 @@ mysql_declare_plugin(perfschema)
0x0001 /* 0.1 */,
pfs_status_vars, /* status variables */
NULL, /* system variables */
NULL /* config options */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;