MySQL 9.0.0
Source Code Documentation
anonymous_namespace{metadata.cc} Namespace Reference

Classes

class  Update_context
 
class  View_metadata_update_ctx
 Holds context during I_S table referencing view's status/column metadata update. More...
 

Functions

const dd::String_type PLUGIN_VERSION_STRING ("plugin_version")
 
const dd::String_type SERVER_I_S_TABLE_STRING ("server_i_s_table")
 
bool store_in_dd (THD *thd, Update_context *ctx, ST_SCHEMA_TABLE *schema_table, unsigned int version)
 Store metadata from ST_SCHEMA_TABLE into DD tables. More...
 
static bool store_plugin_metadata (THD *thd, plugin_ref plugin, Update_context *ctx)
 Helper method to store plugin IS table metadata into DD. More...
 
bool store_plugin_and_referencing_views_metadata (THD *thd, plugin_ref plugin, void *arg)
 Store plugin IS table metadata into DD. More...
 
bool update_plugins_I_S_metadata (THD *thd)
 Iterate through dynamic I_S plugins, and store I_S table metadata into dictionary, during MySQL server startup. More...
 
bool create_system_views (THD *thd, bool is_non_dd_based)
 
bool create_non_dd_based_system_views (THD *thd)
 
bool update_server_I_S_metadata (THD *thd)
 Does following during server restart. More...
 
bool initialize (THD *thd, bool non_dd_based_system_view)
 

Variables

unsigned int UNKNOWN_PLUGIN_VERSION = -1
 

Function Documentation

◆ create_non_dd_based_system_views()

bool anonymous_namespace{metadata.cc}::create_non_dd_based_system_views ( THD thd)

◆ create_system_views()

bool anonymous_namespace{metadata.cc}::create_system_views ( THD thd,
bool  is_non_dd_based 
)

◆ initialize()

bool anonymous_namespace{metadata.cc}::initialize ( THD thd,
bool  non_dd_based_system_view 
)

◆ PLUGIN_VERSION_STRING()

const dd::String_type anonymous_namespace{metadata.cc}::PLUGIN_VERSION_STRING ( "plugin_version"  )

◆ SERVER_I_S_TABLE_STRING()

const dd::String_type anonymous_namespace{metadata.cc}::SERVER_I_S_TABLE_STRING ( "server_i_s_table"  )

◆ store_in_dd()

bool anonymous_namespace{metadata.cc}::store_in_dd ( THD thd,
Update_context ctx,
ST_SCHEMA_TABLE schema_table,
unsigned int  version 
)

Store metadata from ST_SCHEMA_TABLE into DD tables.

Store option plugin_version=version, if it is not UNKNOWN_PLUGIN_VERSION, otherwise store server_i_s_table=true.

Parameters
thdThread
ctxUpdate context.
schema_tablePointer to ST_SCHEMA_TABLE contain metadata of IS table.
versionPlugin version.
Returns
false on success, else true.

◆ store_plugin_and_referencing_views_metadata()

bool anonymous_namespace{metadata.cc}::store_plugin_and_referencing_views_metadata ( THD thd,
plugin_ref  plugin,
void *  arg 
)

Store plugin IS table metadata into DD.

Update column metadata of views referencing I_S plugin table. Skip storing, if the I_S name is already present in Update_context plugin names.

Parameters
thdThread ID
pluginReference to a plugin.
argPointer to Context for I_S update.
Returns
false on success true when fails to store the metadata.

◆ store_plugin_metadata()

static bool anonymous_namespace{metadata.cc}::store_plugin_metadata ( THD thd,
plugin_ref  plugin,
Update_context ctx 
)
static

Helper method to store plugin IS table metadata into DD.

Skip storing, if the I_S name is already present in Update_context plugin names.

Parameters
thdThread ID
pluginReference to a plugin.
ctxPointer to Context for I_S update.
Return values
falseon success
truewhen fails to store the metadata.

◆ update_plugins_I_S_metadata()

bool anonymous_namespace{metadata.cc}::update_plugins_I_S_metadata ( THD thd)

Iterate through dynamic I_S plugins, and store I_S table metadata into dictionary, during MySQL server startup.

These are plugins that are loaded using server command line options.

Does following,

  • Remove I_S table metadata for plugins that are not loaded.
  • Store I_S table metadata of plugins that are newly loaded.
Parameters
thdThread
Returns
false on success, otherwise true.

◆ update_server_I_S_metadata()

bool anonymous_namespace{metadata.cc}::update_server_I_S_metadata ( THD thd)

Does following during server restart.

  • If I_S version is not changed, do nothing.
  • Else, remove all I_S metadata that belongs to server.
  • Store new server I_S metadata.
  • Recreate I_S system views, which will update old I_S metadata because we execute CREATE OR REPLACE VIEW.
Parameters
thdThread
Returns
false on success, otherwise true.

Variable Documentation

◆ UNKNOWN_PLUGIN_VERSION

unsigned int anonymous_namespace{metadata.cc}::UNKNOWN_PLUGIN_VERSION = -1