Revision
1865
User
dbart
Date
2012-05-15 18:38
== About Generally speaking, writing plugins for MariaDB is very similar to [[http://dev.mysql.com/doc/refman/5.1/en/plugin-writing.html|writing plugins for MySQL]]. == Authentication Plugins See [[pluggable-authentication|Pluggable Authentication]]. == Storage Engine Plugins Storage Engines can extend <<fixed>>CREATE TABLE<</fixed>> syntax with optional index, field, and table attribute clauses. See [[extending-create-table|Extending CREATE TABLE]] for more information. == Plugin Declaration Structure In MariaDB 5.2 we introduced a new MariaDB plugin declaration. It differs from the MySQL plugin declaration in the following ways: # it has no useless 'reserved' field (the very last field in the MySQL plugin declaration) # it has a 'maturity' declaration # it has a field for a text representation of the version field MariaDB can load plugins that only have the MySQL plugin declaration but the numeric version will show up as '0' and both maturity and author version will show up as 'Unknown' in the [[information_schemaplugins-table|INFORMATION_SCHEMA.PLUGINS table]]. For compiled-in (not dynamically loaded) plugins, the presence of the MariaDB plugin declaration is mandatory. === Example Plugin Declaration The MariaDB plugin declaration looks like this: <<code lang=c inline=false>> /* MariaDB plugin declaration */ maria_declare_plugin(example) { MYSQL_STORAGE_ENGINE_PLUGIN, /* the plugin type (see include/mysql/plugin.h) */ &example_storage_engine_info, /* pointer to type-specific plugin descriptor */ "EXAMPLEDB", /* plugin name */ "John Smith", /* plugin author */ "Example of plugin interface", /* the plugin description */ PLUGIN_LICENSE_GPL, /* the plugin license (see include/mysql/plugin.h) */ example_init_func, /* Pointer to plugin initialization function */ example_deinit_func, /* Pointer to plugin deinitialization function */ 0x0001 /* Numeric version 0xAABB means AA.BB veriosn */, example_status_variables, /* Status variables */ example_system_variables, /* System variables */ "0.1 example", /* String version representation */ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* Maturity (see include/mysql/plugin.h)*/ } maria_declare_plugin_end; <</code>>