Information Schema Plugins: SHOW and FLUSH Statements

circle-info

This page contains background information, mostly aimed at engineers developing MariaDB features.

Information Schema plugins support SHOW and FLUSH statements.

SHOW

SHOW statement support is enabled by default. A plugin only has to specify column names for the SHOW statement in the old_name member of the field declaration structure. Columns with the old_name set to 0 are hidden from the SHOW statement. If all columns are hidden, the SHOW statement doesn't work for this plugin.

Note that SHOW statement is a user-friendly shortcut – it's easier to type and view. If the Information Schema table contains many columns, the SHOW statement is supposed to display only the most important columns, so that the output fits nicely on the 80x25 terminal screen.

Consider an example, the LOCALES plugin:

static ST_FIELD_INFO locale_info_locale_fields_info[]=
{
  {"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", 0},
  {"NAME", 255, MYSQL_TYPE_STRING, 0, 0, "Name", 0},
  {"DESCRIPTION", 255,  MYSQL_TYPE_STRING, 0, 0, "Description", 0},
  {"MAX_MONTH_NAME_LENGTH", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0},
  {"MAX_DAY_NAME_LENGTH", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0},
  {"DECIMAL_POINT", 2, MYSQL_TYPE_STRING, 0, 0, 0, 0},
  {"THOUSAND_SEP", 2, MYSQL_TYPE_STRING, 0, 0, 0, 0},
  {"ERROR_MESSAGE_LANGUAGE", 64, MYSQL_TYPE_STRING, 0, 0, "Error_Message_Language", 0},
  {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0}
};

While the INFORMATION_SCHEMA.LOCALES table has 8 columns, the SHOW LOCALES statement only displays 4 of them:

FLUSH

To support the FLUSH statement, a plugin must declare the reset_table callback. For example, in the QUERY_RESPONSE_TIMEarrow-up-right plugin:

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

spinner

Last updated

Was this helpful?