O'Reilly logo

MySQL 5.1 Plugin Development by Andrew Hutchings, Sergei Golubchik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The creation of Information Schema plugins

The basic structure of the Information Schema plugins in similar to that of Daemon plugins. They need to be declared with mysql_declare_plugin, and can have status and system variables. The initialization function, though, is a requirement for them, not an option, as this is the function where we define a new Information Schema table and tell MySQL what should happen when it is queried.

Defining Information Schema plugins

Just like with any other plugin type we use a macro to declare a plugin. This time we set the plugin type to MYSQL_INFORMATION_SCHEMA_PLUGIN. An example of the definition may look like this:

mysql_declare_plugin(mysql_is_my_plugin) { MYSQL_INFORMATION_SCHEMA_PLUGIN, &mysql_is_my_plugin, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required