For the complete documentation index, see llms.txt. This page is also available as Markdown.

Writing Plugins for MariaDB

A comprehensive guide on the basic structure and necessary components for creating a new plugin from scratch.

This page contains background information for MariaDB developers.

About

Generally speaking, writing plugins for MariaDB is very similar to writing plugins for MySQL.

Authentication Plugins

See Pluggable Authentication.

Storage Engine Plugins

Storage engines can extend CREATE TABLE syntax with optional index, field, and table attribute clauses. See Extending CREATE TABLE for more information. See also Storage Engine Development.

Information Schema Plugins

Information Schema plugins can have their own FLUSH and SHOW statements. See FLUSH and SHOW for Information Schema plugins.

Encryption Plugins

Encryption plugins in MariaDB are used for the data at rest encryption feature. They are responsible for both key management and for the actual encryption and decryption of data.

Function Plugins

Function plugins add new SQL functions to MariaDB. Unlike the old UDF API, function plugins can do almost anything that a built-function can.

Plugin Declaration Structure

The MariaDB plugin declaration differs from the MySQL plugin declaration in the following ways:

  1. it has no useless 'reserved' field (the very last field in the MySQL plugin declaration)

  2. it has a 'maturity' declaration

  3. it has a field for a text representation of the version field

MariaDB can load plugins that only have the MySQL plugin declaration but both PLUGIN_MATURITY and PLUGIN_AUTH_VERSION will show up as 'Unknown' in the 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:

Maturity Guidelines For Plugins

Plugin Maturity At a Glance

Plugin Maturity Guidelines

New features or sufficiently big code changes to a plugin should lead to:

  • an increase of the plugin version

  • knocking the maturity level down.

  • First a plugin is Alpha

  • After at least 1.5 months (or more, in 3 month increments, until the quality is deemed acceptable) it becomes Gamma. Meanwhile it can transition through Beta as the maintainer wants (e,g. it can start directly from beta)

  • After at least 3 more months (or more, in 3 month increments — depending on the bug inflow) it becomes Stable

If a plugin must be statically compiled into the server, it is a subject to an additional limitation — its maturity cannot be lower than the server's.

Beta Plugins In GA Releases

If a plugin contribution is added directly at beta maturity to a GA release series, it will not be removed from that release series. However, we reserve the right to exclude a plugin from future release series if it is unmaintained (for example, if it stops receiving bug fixes).

This page is licensed: CC BY-SA / Gnu FDL

spinner

Last updated

Was this helpful?