MySQL 8.4.2
Source Code Documentation
|
This class represents all data dictionary table like mysql.tables, mysql.columns and more. More...
#include <object_table.h>
Public Member Functions | |
virtual const String_type & | name () const =0 |
Get the table name used by the target definition for the dictionary table. More... | |
virtual Object_table_definition * | target_table_definition ()=0 |
Get the target definition for the dictionary table. More... | |
virtual const Object_table_definition * | target_table_definition () const =0 |
virtual void | set_abandoned (uint last_dd_version) const =0 |
Mark the target definition for the dictionary table as abandoned. More... | |
virtual bool | is_abandoned () const =0 |
Check if the dictionary table is abandoned. More... | |
virtual const Object_table_definition * | actual_table_definition () const =0 |
Get the actual definition for the dictionary table. More... | |
virtual bool | set_actual_table_definition (const Properties &table_def_properties) const =0 |
Set the actual definition for the dictionary table. More... | |
virtual int | field_number (const String_type &field_label) const =0 |
Get the field ordinal position in the object table. More... | |
virtual bool | populate (THD *thd) const =0 |
Execute low level code for populating the table. More... | |
virtual bool | is_hidden () const =0 |
Check if the table should be hidden. More... | |
virtual void | set_hidden (bool hidden)=0 |
Mark the dictionary table as hidden or visible. More... | |
virtual | ~Object_table ()=default |
Static Public Member Functions | |
static Object_table * | create_object_table () |
Allocate a new Object_table instance on the heap. More... | |
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
This is the base class of all the classes defined in sql/dd/impl/tables/ headers. This class is also the base class of tables requested by the DDSE and by plugins.
The server code should contain a Object_table subclass for each DD table which is a target table for at least one of the supported DD versions (i.e., the DD versions from which this server can upgrade). So even if a previous DD version stops using a DD table, the later servers which can upgrade need to keep the Object_table subclass for that table. The motivation for that is to be able to recognize the table, and to be able to remove it.
Instances of this class will contain one or two table definitions, depending on the context:
If the actual DD version is different from the target DD version, upgrade is required. The actual table definition is used only in situations where we have an upgrade or downgrade.
|
virtualdefault |
|
pure virtual |
Get the actual definition for the dictionary table.
The actual definition is the definition which is used by a DD table which is stored persistently. Normally, for an ordinary running server, the actual table definitions are equal to the target table definitions. In an upgrade context, they may differ.
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
static |
Allocate a new Object_table instance on the heap.
The new instance has the predefined options that all DD tables share:
ENGINE=INNODB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin ROW_FORMAT=DYNAMIC STATS_PERSISTENT=0 TABLESPACE=mysql
|
pure virtual |
Get the field ordinal position in the object table.
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Check if the dictionary table is abandoned.
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Check if the table should be hidden.
Most of Object tables (alias DD tables) are hidden from users, but some of them are expected to be visible (not hidden) to user and be able to update them, e.g., innodb_index_stats/innodb_table_stats.
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Get the table name used by the target definition for the dictionary table.
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Execute low level code for populating the table.
Implemented in dd::Object_table_impl, dd::tables::Character_sets, dd::tables::Collations, and dd::Entity_object_table_impl.
|
pure virtual |
Mark the target definition for the dictionary table as abandoned.
last_dd_version | Last version where this object table was used. |
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Set the actual definition for the dictionary table.
table_def_properties | Actual table definition represented as a set of properties. |
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Mark the dictionary table as hidden or visible.
hidden | Set to 'true' if the table should be hidden. |
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.
|
pure virtual |
Get the target definition for the dictionary table.
Implemented in dd::Entity_object_table_impl, and dd::Object_table_impl.