mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Maria WL#61
Interface for maria extensions. Alternative plugin interface with additional info (maturity and string version). CMakeLists.txt: Maria plugin interface used. config/ac-macros/plugins.m4: Maria plugin interface used. configure.in: Maria plugin interface used. include/mysql/plugin.h: Maria plugin interface added. include/mysql/plugin_auth.h.pp: Maria plugin interface added. plugin/auth/auth_socket.c: Maria plugin interface added. plugin/auth/dialog.c: Maria plugin interface added. plugin/daemon_example/daemon_example.cc: Maria plugin interface added. plugin/fulltext/plugin_example.c: Maria plugin interface added. sql/ha_ndbcluster.cc: Maria plugin interface added. sql/ha_partition.cc: Maria plugin interface added. sql/log.cc: Maria plugin interface added. sql/sql_acl.cc: Maria plugin interface added. sql/sql_builtin.cc.in: Maria plugin interface used. sql/sql_plugin.cc: Maria plugin interface added. sql/sql_plugin.h: Maria plugin interface used. sql/sql_show.cc: Maria plugin interface added. storage/archive/ha_archive.cc: Maria plugin interface added. storage/blackhole/ha_blackhole.cc: Maria plugin interface added. storage/csv/ha_tina.cc: Maria plugin interface added. storage/example/ha_example.cc: Maria plugin interface added. storage/federated/ha_federated.cc: Maria plugin interface added. storage/federatedx/ha_federatedx.cc: Maria plugin interface added. storage/heap/ha_heap.cc: Maria plugin interface added. storage/ibmdb2i/ha_ibmdb2i.cc: Maria plugin interface added. storage/innobase/handler/ha_innodb.cc: Maria plugin interface added. storage/innodb_plugin/handler/i_s.cc: Maria plugin interface added. storage/maria/ha_maria.cc: Maria plugin interface added. storage/myisam/ha_myisam.cc: Maria plugin interface added. storage/myisammrg/ha_myisammrg.cc: Maria plugin interface added. storage/pbxt/src/ha_pbxt.cc: Maria plugin interface added. storage/xtradb/handler/ha_innodb.cc: Maria plugin interface added. storage/xtradb/handler/i_s.cc: Maria plugin interface added. storage/xtradb/handler/i_s.h: Maria plugin interface added.
This commit is contained in:
@@ -57,7 +57,10 @@ typedef struct st_mysql_xid MYSQL_XID;
|
||||
Plugin API. Common for all plugin types.
|
||||
*/
|
||||
|
||||
/* MySQL plugin interface version */
|
||||
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0101
|
||||
/* MariaDB plugin interface version */
|
||||
#define MARIA_PLUGIN_INTERFACE_VERSION 0x0100
|
||||
|
||||
/*
|
||||
The allowable types of plugins
|
||||
@@ -81,6 +84,14 @@ typedef struct st_mysql_xid MYSQL_XID;
|
||||
#define PLUGIN_LICENSE_GPL_STRING "GPL"
|
||||
#define PLUGIN_LICENSE_BSD_STRING "BSD"
|
||||
|
||||
/* definitions of code maturity for plugins */
|
||||
#define MariaDB_PLUGIN_MATURITY_UNKNOWN 0
|
||||
#define MariaDB_PLUGIN_MATURITY_EXPERIMENTAL 1
|
||||
#define MariaDB_PLUGIN_MATURITY_ALPHA 2
|
||||
#define MariaDB_PLUGIN_MATURITY_BETA 3
|
||||
#define MariaDB_PLUGIN_MATURITY_GAMMA 4
|
||||
#define MariaDB_PLUGIN_MATURITY_STABLE 5
|
||||
|
||||
/*
|
||||
Macros for beginning and ending plugin declarations. Between
|
||||
mysql_declare_plugin and mysql_declare_plugin_end there should
|
||||
@@ -93,11 +104,24 @@ typedef struct st_mysql_xid MYSQL_XID;
|
||||
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||
int PSIZE= sizeof(struct st_mysql_plugin); \
|
||||
struct st_mysql_plugin DECLS[]= {
|
||||
|
||||
#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
|
||||
int VERSION= MARIA_PLUGIN_INTERFACE_VERSION; \
|
||||
int PSIZE= sizeof(struct st_maria_plugin); \
|
||||
struct st_maria_plugin DECLS[]= {
|
||||
|
||||
#else
|
||||
|
||||
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
||||
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
|
||||
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
|
||||
|
||||
#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
|
||||
MYSQL_PLUGIN_EXPORT int _maria_plugin_interface_version_= MARIA_PLUGIN_INTERFACE_VERSION; \
|
||||
MYSQL_PLUGIN_EXPORT int _maria_sizeof_struct_st_plugin_= sizeof(struct st_maria_plugin); \
|
||||
MYSQL_PLUGIN_EXPORT struct st_maria_plugin _maria_plugin_declarations_[]= {
|
||||
|
||||
#endif
|
||||
|
||||
#define mysql_declare_plugin(NAME) \
|
||||
@@ -106,7 +130,14 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
|
||||
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
|
||||
builtin_ ## NAME ## _plugin)
|
||||
|
||||
#define maria_declare_plugin(NAME) \
|
||||
MARIA_DECLARE_PLUGIN__(NAME, \
|
||||
builtin_maria_ ## NAME ## _plugin_interface_version, \
|
||||
builtin_maria_ ## NAME ## _sizeof_struct_st_plugin, \
|
||||
builtin_maria_ ## NAME ## _plugin)
|
||||
|
||||
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
|
||||
#define maria_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
|
||||
|
||||
/*
|
||||
declarations for SHOW STATUS support in plugins
|
||||
@@ -403,6 +434,30 @@ struct st_mysql_plugin
|
||||
void * __reserved1; /* reserved for dependency checking */
|
||||
};
|
||||
|
||||
/*
|
||||
MariaDB extension for plugins declaration structure.
|
||||
|
||||
It also copy current MySQL plugin fields to have more independency
|
||||
in plugins extension
|
||||
*/
|
||||
|
||||
struct st_maria_plugin
|
||||
{
|
||||
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
|
||||
void *info; /* pointer to type-specific plugin descriptor */
|
||||
const char *name; /* plugin name */
|
||||
const char *author; /* plugin author (for SHOW PLUGINS) */
|
||||
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
|
||||
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
|
||||
int (*init)(void *); /* the function to invoke when plugin is loaded */
|
||||
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
|
||||
unsigned int version; /* plugin version (for SHOW PLUGINS) */
|
||||
struct st_mysql_show_var *status_vars;
|
||||
struct st_mysql_sys_var **system_vars;
|
||||
const char *version_info; /* plugin version string */
|
||||
int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
|
||||
};
|
||||
|
||||
/*************************************************************************
|
||||
API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
|
||||
*/
|
||||
|
Reference in New Issue
Block a user