Databases Reference
In-Depth Information
The fact that we need to include anything from
sql/
and may
work with types such as
TABLE_LIST
or
COND
automatically
means that plugins of this type strongly depend on internal
MySQL data structures. These plugins will typically only work
with the MySQL version they were compiled for.
The following table outlines the usage of elements for the structure:
Name Description
table_name
The name for the Information Schema table. After calling the plugin
initialization function MySQL sets this member to match the plugin
name; that is, we do not need to do anything with it.
fields_info
An array of
ST_FIELD_INFO
structures describing the fields of the
table.
create_table
A function that creates a
TABLE
structure for our table. It is always
the same for any Information Schema table, and MySQL sets it
automatically to the necessary function.
fill_table
The main function of our plugin. It generates the data that will be
shown in our Information Schema table.
old_format
This is only used for built-in MySQL Information Schema tables that
have
SHOW
statement counterparts (For example, the
INFORMATION_
SCHEMA.PLUGINS
table has a
SHOW PLUGINS
counterpart). As
plugins cannot add or replace
SHOW
statements, this member is never
used for them.
process_table
This function is only used by built-in MySQL Information Schema
tables that have their
fill_table
member set to
get_all_tables()
defined in
sql_show.cc
. It is never used in plugins.
idx_field1
and
idx_field2
These members, again, are normally only used by built-in MySQL
Information Schema tables; the functions and data structures to use
them are not available to plugins.
hidden
Set to
true
if the data should only be available via the corresponding
SHOW
command, not as a table in the
INFORMATION_SCHEMA
. Plugins
should never set it, as they cannot provide a new
SHOW
command.
i_s_request
ed_object
The table opening method, not used here. This member, too, is only
used by
get_all_tables
and is completely ignored for plugins
In other words, the only members of
ST_SCHEMA_TABLE
that we would ever need to
set are
fields_info
and
fill_table
.