MySQL  8.0.16
Source Code Documentation
dd::Table Class Referenceabstract

#include <table.h>

Inheritance diagram for dd::Table:
dd::Abstract_table dd::Entity_object dd::Weak_object dd::Table_impl

Public Types

enum  enum_row_format {
  RF_FIXED = 1, RF_DYNAMIC, RF_COMPRESSED, RF_REDUNDANT,
  RF_COMPACT, RF_PAGED
}
 
enum  enum_partition_type {
  PT_NONE = 0, PT_HASH, PT_KEY_51, PT_KEY_55,
  PT_LINEAR_HASH, PT_LINEAR_KEY_51, PT_LINEAR_KEY_55, PT_RANGE,
  PT_LIST, PT_RANGE_COLUMNS, PT_LIST_COLUMNS, PT_AUTO,
  PT_AUTO_LINEAR
}
 
enum  enum_subpartition_type {
  ST_NONE = 0, ST_HASH, ST_KEY_51, ST_KEY_55,
  ST_LINEAR_HASH, ST_LINEAR_KEY_51, ST_LINEAR_KEY_55
}
 
enum  enum_default_partitioning { DP_NONE = 0, DP_NO, DP_YES, DP_NUMBER }
 
typedef Table_impl Impl
 
typedef Collection< Index * > Index_collection
 
typedef Collection< Foreign_key * > Foreign_key_collection
 
typedef std::vector< Foreign_key_parent * > Foreign_key_parent_collection
 
typedef Collection< Partition * > Partition_collection
 
typedef Collection< Trigger * > Trigger_collection
 
typedef Collection< Check_constraint * > Check_constraint_collection
 
typedef std::vector< Partition * > Partition_leaf_vector
 
- Public Types inherited from dd::Abstract_table
enum  enum_hidden_type { HT_VISIBLE = 1, HT_HIDDEN_SYSTEM, HT_HIDDEN_SE, HT_HIDDEN_DDL }
 Enumeration type which indicates whether the table is hidden, and if yes then which type of hidden table it is. More...
 
typedef Abstract_table_impl Impl
 
typedef Abstract_table Cache_partition
 
typedef tables::Tables DD_table
 
typedef Primary_id_key Id_key
 
typedef Item_name_key Name_key
 
typedef Se_private_id_key Aux_key
 
typedef Collection< Column * > Column_collection
 

Public Member Functions

virtual bool update_aux_key (Aux_key *key) const
 
virtual ~Table ()
 
virtual bool is_temporary () const =0
 
virtual void set_is_temporary (bool is_temporary)=0
 
virtual Object_id collation_id () const =0
 
virtual void set_collation_id (Object_id collation_id)=0
 
virtual Object_id tablespace_id () const =0
 
virtual void set_tablespace_id (Object_id tablespace_id)=0
 
virtual bool is_explicit_tablespace () const =0
 
virtual const String_typeengine () const =0
 
virtual void set_engine (const String_type &engine)=0
 
virtual enum_row_format row_format () const =0
 
virtual void set_row_format (enum_row_format row_format)=0
 
virtual const String_typecomment () const =0
 
virtual void set_comment (const String_type &comment)=0
 
virtual bool is_checked_for_upgrade () const =0
 
virtual void mark_as_checked_for_upgrade ()=0
 
virtual const Propertiesse_private_data () const =0
 
virtual Propertiesse_private_data ()=0
 
virtual bool set_se_private_data (const String_type &se_private_data_raw)=0
 
virtual bool set_se_private_data (const Properties &se_private_data)=0
 
virtual Object_id se_private_id () const =0
 
virtual void set_se_private_id (Object_id se_private_id)=0
 
virtual enum_partition_type partition_type () const =0
 
virtual void set_partition_type (enum_partition_type partition_type)=0
 
virtual enum_default_partitioning default_partitioning () const =0
 
virtual void set_default_partitioning (enum_default_partitioning default_partitioning)=0
 
virtual const String_typepartition_expression () const =0
 
virtual void set_partition_expression (const String_type &partition_expression)=0
 
virtual const String_typepartition_expression_utf8 () const =0
 
virtual void set_partition_expression_utf8 (const String_type &partition_expression)=0
 
virtual enum_subpartition_type subpartition_type () const =0
 
virtual void set_subpartition_type (enum_subpartition_type subpartition_type)=0
 
virtual enum_default_partitioning default_subpartitioning () const =0
 
virtual void set_default_subpartitioning (enum_default_partitioning default_subpartitioning)=0
 
virtual const String_typesubpartition_expression () const =0
 
virtual void set_subpartition_expression (const String_type &subpartition_expression)=0
 
virtual const String_typesubpartition_expression_utf8 () const =0
 
virtual void set_subpartition_expression_utf8 (const String_type &subpartition_expression)=0
 
const Tabletable () const
 Dummy method to be able to use Partition and Table interchangeably in templates. More...
 
Tabletable ()
 
virtual Indexadd_index ()=0
 
virtual Indexadd_first_index ()=0
 
virtual const Index_collectionindexes () const =0
 
virtual Index_collectionindexes ()=0
 
virtual Foreign_keyadd_foreign_key ()=0
 
virtual const Foreign_key_collectionforeign_keys () const =0
 
virtual Foreign_key_collectionforeign_keys ()=0
 
virtual const Foreign_key_parent_collectionforeign_key_parents () const =0
 
virtual bool reload_foreign_key_parents (THD *thd)=0
 
virtual Partitionadd_partition ()=0
 
virtual const Partition_collectionpartitions () const =0
 
virtual Partition_collectionpartitions ()=0
 
virtual const Partition_leaf_vectorleaf_partitions () const =0
 
virtual Partition_leaf_vectorleaf_partitions ()=0
 
virtual bool has_trigger () const =0
 Check if table has any triggers. More...
 
virtual const Trigger_collectiontriggers () const =0
 Get const reference to Trigger_collection. More...
 
virtual Trigger_collectiontriggers ()=0
 Get non-const pointer to Trigger_collection. More...
 
virtual void copy_triggers (const Table *tab_obj)=0
 Copy all the triggers from another dd::Table object. More...
 
virtual Triggeradd_trigger (Trigger::enum_action_timing at, Trigger::enum_event_type et)=0
 Add new trigger to the table. More...
 
virtual const Triggerget_trigger (const char *name) const =0
 Get dd::Trigger object for the given trigger name. More...
 
virtual Triggeradd_trigger_following (const Trigger *trigger, Trigger::enum_action_timing at, Trigger::enum_event_type et)=0
 Add new trigger just after the trigger specified in argument. More...
 
virtual Triggeradd_trigger_preceding (const Trigger *trigger, Trigger::enum_action_timing at, Trigger::enum_event_type et)=0
 Add new trigger just before the trigger specified in argument. More...
 
virtual void drop_trigger (const Trigger *trigger)=0
 Drop the given trigger object. More...
 
virtual void drop_all_triggers ()=0
 Drop all the trigger on this dd::Table object. More...
 
virtual Check_constraintadd_check_constraint ()=0
 
virtual const Check_constraint_collectioncheck_constraints () const =0
 
virtual Check_constraint_collectioncheck_constraints ()=0
 
virtual Tableclone () const =0
 Allocate a new object graph and invoke the copy contructor for each object. More...
 
virtual void serialize (Sdi_wcontext *wctx, Sdi_writer *w) const =0
 Converts *this into json. More...
 
virtual bool deserialize (Sdi_rcontext *rctx, const RJ_Value &val)=0
 Re-establishes the state of *this by reading sdi information from the rapidjson DOM subobject provided. More...
 
- Public Member Functions inherited from dd::Abstract_table
virtual bool update_id_key (Id_key *key) const
 
virtual bool update_name_key (Name_key *key) const
 
virtual ~Abstract_table ()
 
virtual Object_id schema_id () const =0
 
virtual void set_schema_id (Object_id schema_id)=0
 
virtual uint mysql_version_id () const =0
 
virtual const Propertiesoptions () const =0
 
virtual Propertiesoptions ()=0
 
virtual bool set_options (const Properties &options)=0
 
virtual bool set_options (const String_type &options_raw)=0
 
virtual ulonglong created (bool convert_time) const =0
 
virtual void set_created (ulonglong created)=0
 
virtual ulonglong last_altered (bool convert_time) const =0
 
virtual void set_last_altered (ulonglong last_altered)=0
 
virtual enum_table_type type () const =0
 
virtual enum_hidden_type hidden () const =0
 
virtual void set_hidden (enum_hidden_type hidden)=0
 
virtual Columnadd_column ()=0
 
virtual const Column_collectioncolumns () const =0
 
virtual Column_collectioncolumns ()=0
 
virtual const Columnget_column (const String_type &name) const =0
 
- Public Member Functions inherited from dd::Entity_object
virtual Object_id id () const =0
 The unique dictionary object id. More...
 
virtual bool is_persistent () const =0
 Is dictionary object persistent in dictionary tables ? More...
 
virtual const String_typename () const =0
 
virtual void set_name (const String_type &name)=0
 
- Public Member Functions inherited from dd::Weak_object
virtual void debug_print (String_type &outb) const =0
 
 Weak_object ()
 
 Weak_object (const Weak_object &)=default
 
virtual ~Weak_object ()
 

Static Public Member Functions

static bool update_aux_key (Aux_key *key, const String_type &engine, Object_id se_private_id)
 
- Static Public Member Functions inherited from dd::Abstract_table
static bool update_id_key (Id_key *key, Object_id id)
 
static bool update_name_key (Name_key *key, Object_id schema_id, const String_type &name)
 

Member Typedef Documentation

◆ Check_constraint_collection

◆ Foreign_key_collection

◆ Foreign_key_parent_collection

◆ Impl

◆ Index_collection

◆ Partition_collection

◆ Partition_leaf_vector

◆ Trigger_collection

Member Enumeration Documentation

◆ enum_default_partitioning

Enumerator
DP_NONE 
DP_NO 
DP_YES 
DP_NUMBER 

◆ enum_partition_type

Enumerator
PT_NONE 
PT_HASH 
PT_KEY_51 
PT_KEY_55 
PT_LINEAR_HASH 
PT_LINEAR_KEY_51 
PT_LINEAR_KEY_55 
PT_RANGE 
PT_LIST 
PT_RANGE_COLUMNS 
PT_LIST_COLUMNS 
PT_AUTO 
PT_AUTO_LINEAR 

◆ enum_row_format

Enumerator
RF_FIXED 
RF_DYNAMIC 
RF_COMPRESSED 
RF_REDUNDANT 
RF_COMPACT 
RF_PAGED 

◆ enum_subpartition_type

Enumerator
ST_NONE 
ST_HASH 
ST_KEY_51 
ST_KEY_55 
ST_LINEAR_HASH 
ST_LINEAR_KEY_51 
ST_LINEAR_KEY_55 

Constructor & Destructor Documentation

◆ ~Table()

virtual dd::Table::~Table ( )
inlinevirtual

Member Function Documentation

◆ add_check_constraint()

virtual Check_constraint* dd::Table::add_check_constraint ( )
pure virtual

Implemented in dd::Table_impl.

◆ add_first_index()

virtual Index* dd::Table::add_first_index ( )
pure virtual

Implemented in dd::Table_impl.

◆ add_foreign_key()

virtual Foreign_key* dd::Table::add_foreign_key ( )
pure virtual

Implemented in dd::Table_impl.

◆ add_index()

virtual Index* dd::Table::add_index ( )
pure virtual

Implemented in dd::Table_impl.

◆ add_partition()

virtual Partition* dd::Table::add_partition ( )
pure virtual

Implemented in dd::Table_impl.

◆ add_trigger()

virtual Trigger* dd::Table::add_trigger ( Trigger::enum_action_timing  at,
Trigger::enum_event_type  et 
)
pure virtual

Add new trigger to the table.

Parameters
at- Action timing of the trigger to be added.
et- Event type of the trigger to be added.
Returns
Trigger* - Pointer to new Trigger that is added to table.

Implemented in dd::Table_impl.

◆ add_trigger_following()

virtual Trigger* dd::Table::add_trigger_following ( const Trigger trigger,
Trigger::enum_action_timing  at,
Trigger::enum_event_type  et 
)
pure virtual

Add new trigger just after the trigger specified in argument.

Parameters
trigger- dd::Trigger object after which the new trigger should be created.
at- Action timing of the trigger to be added.
et- Event type of the trigger to be added.
Returns
Trigger* - Pointer to newly created dd::Trigger object.

Implemented in dd::Table_impl.

◆ add_trigger_preceding()

virtual Trigger* dd::Table::add_trigger_preceding ( const Trigger trigger,
Trigger::enum_action_timing  at,
Trigger::enum_event_type  et 
)
pure virtual

Add new trigger just before the trigger specified in argument.

Parameters
trigger- dd::Trigger object before which the new trigger should be created.
at- Action timing of the trigger to be added.
et- Event type of the trigger to be added.
Returns
Trigger* - Pointer to newly created dd::Trigger object.

Implemented in dd::Table_impl.

◆ check_constraints() [1/2]

virtual const Check_constraint_collection& dd::Table::check_constraints ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ check_constraints() [2/2]

virtual Check_constraint_collection* dd::Table::check_constraints ( )
pure virtual

Implemented in dd::Table_impl.

◆ clone()

virtual Table* dd::Table::clone ( ) const
pure virtual

Allocate a new object graph and invoke the copy contructor for each object.

Returns
pointer to dynamically allocated copy

Implements dd::Abstract_table.

Implemented in dd::Table_impl.

◆ collation_id()

virtual Object_id dd::Table::collation_id ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ comment()

virtual const String_type& dd::Table::comment ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ copy_triggers()

virtual void dd::Table::copy_triggers ( const Table tab_obj)
pure virtual

Copy all the triggers from another dd::Table object.

Parameters
tab_objPointer to Table from which the triggers are copied.

Implemented in dd::Table_impl.

◆ default_partitioning()

virtual enum_default_partitioning dd::Table::default_partitioning ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ default_subpartitioning()

virtual enum_default_partitioning dd::Table::default_subpartitioning ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ deserialize()

virtual bool dd::Table::deserialize ( Sdi_rcontext rctx,
const RJ_Value val 
)
pure virtual

Re-establishes the state of *this by reading sdi information from the rapidjson DOM subobject provided.

Cross-references encountered within this object are tracked in sdictx, so that they can be updated when the entire object graph has been established.

Parameters
rctxstores book-keeping information for the deserialization process
valsubobject of rapidjson DOM containing json representation of this object

Implemented in dd::Table_impl.

◆ drop_all_triggers()

virtual void dd::Table::drop_all_triggers ( )
pure virtual

Drop all the trigger on this dd::Table object.

The method returns void, as we just remove the trigger from dd::Collection (dd::Table_impl::m_triggers) in memory. The trigger will be removed from mysql.triggers DD table when the dd::Table object is stored/updated.

Implemented in dd::Table_impl.

◆ drop_trigger()

virtual void dd::Table::drop_trigger ( const Trigger trigger)
pure virtual

Drop the given trigger object.

The method returns void, as we just remove the trigger from dd::Collection (dd::Table_impl::m_triggers) in memory. The trigger will be removed from mysql.triggers DD table when the dd::Table object is stored/updated.

Parameters
trigger- dd::Trigger object to be dropped.

Implemented in dd::Table_impl.

◆ engine()

virtual const String_type& dd::Table::engine ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ foreign_key_parents()

virtual const Foreign_key_parent_collection& dd::Table::foreign_key_parents ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ foreign_keys() [1/2]

virtual const Foreign_key_collection& dd::Table::foreign_keys ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ foreign_keys() [2/2]

virtual Foreign_key_collection* dd::Table::foreign_keys ( )
pure virtual

Implemented in dd::Table_impl.

◆ get_trigger()

virtual const Trigger* dd::Table::get_trigger ( const char *  name) const
pure virtual

Get dd::Trigger object for the given trigger name.

Returns
Trigger* - Pointer to Trigger.

Implemented in dd::Table_impl.

◆ has_trigger()

virtual bool dd::Table::has_trigger ( ) const
pure virtual

Check if table has any triggers.

Returns
true - if there are triggers on the table installed.
false - if not.

Implemented in dd::Table_impl.

◆ indexes() [1/2]

virtual const Index_collection& dd::Table::indexes ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ indexes() [2/2]

virtual Index_collection* dd::Table::indexes ( )
pure virtual

Implemented in dd::Table_impl.

◆ is_checked_for_upgrade()

virtual bool dd::Table::is_checked_for_upgrade ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ is_explicit_tablespace()

virtual bool dd::Table::is_explicit_tablespace ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ is_temporary()

virtual bool dd::Table::is_temporary ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ leaf_partitions() [1/2]

virtual const Partition_leaf_vector& dd::Table::leaf_partitions ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ leaf_partitions() [2/2]

virtual Partition_leaf_vector* dd::Table::leaf_partitions ( )
pure virtual

Implemented in dd::Table_impl.

◆ mark_as_checked_for_upgrade()

virtual void dd::Table::mark_as_checked_for_upgrade ( )
pure virtual

Implemented in dd::Table_impl.

◆ partition_expression()

virtual const String_type& dd::Table::partition_expression ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ partition_expression_utf8()

virtual const String_type& dd::Table::partition_expression_utf8 ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ partition_type()

virtual enum_partition_type dd::Table::partition_type ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ partitions() [1/2]

virtual const Partition_collection& dd::Table::partitions ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ partitions() [2/2]

virtual Partition_collection* dd::Table::partitions ( )
pure virtual

Implemented in dd::Table_impl.

◆ reload_foreign_key_parents()

virtual bool dd::Table::reload_foreign_key_parents ( THD thd)
pure virtual

Implemented in dd::Table_impl.

◆ row_format()

virtual enum_row_format dd::Table::row_format ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ se_private_data() [1/2]

virtual const Properties& dd::Table::se_private_data ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ se_private_data() [2/2]

virtual Properties& dd::Table::se_private_data ( )
pure virtual

Implemented in dd::Table_impl.

◆ se_private_id()

virtual Object_id dd::Table::se_private_id ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ serialize()

virtual void dd::Table::serialize ( Sdi_wcontext wctx,
Sdi_writer w 
) const
pure virtual

Converts *this into json.

Converts all member variables that are to be included in the sdi into json by transforming them appropriately and passing them to the rapidjson writer provided.

Parameters
wctxopaque context for data needed by serialization
wrapidjson writer which will perform conversion to json

Implemented in dd::Table_impl.

◆ set_collation_id()

virtual void dd::Table::set_collation_id ( Object_id  collation_id)
pure virtual

Implemented in dd::Table_impl.

◆ set_comment()

virtual void dd::Table::set_comment ( const String_type comment)
pure virtual

Implemented in dd::Table_impl.

◆ set_default_partitioning()

virtual void dd::Table::set_default_partitioning ( enum_default_partitioning  default_partitioning)
pure virtual

Implemented in dd::Table_impl.

◆ set_default_subpartitioning()

virtual void dd::Table::set_default_subpartitioning ( enum_default_partitioning  default_subpartitioning)
pure virtual

Implemented in dd::Table_impl.

◆ set_engine()

virtual void dd::Table::set_engine ( const String_type engine)
pure virtual

Implemented in dd::Table_impl.

◆ set_is_temporary()

virtual void dd::Table::set_is_temporary ( bool  is_temporary)
pure virtual

Implemented in dd::Table_impl.

◆ set_partition_expression()

virtual void dd::Table::set_partition_expression ( const String_type partition_expression)
pure virtual

Implemented in dd::Table_impl.

◆ set_partition_expression_utf8()

virtual void dd::Table::set_partition_expression_utf8 ( const String_type partition_expression)
pure virtual

Implemented in dd::Table_impl.

◆ set_partition_type()

virtual void dd::Table::set_partition_type ( enum_partition_type  partition_type)
pure virtual

Implemented in dd::Table_impl.

◆ set_row_format()

virtual void dd::Table::set_row_format ( enum_row_format  row_format)
pure virtual

Implemented in dd::Table_impl.

◆ set_se_private_data() [1/2]

virtual bool dd::Table::set_se_private_data ( const String_type se_private_data_raw)
pure virtual

Implemented in dd::Table_impl.

◆ set_se_private_data() [2/2]

virtual bool dd::Table::set_se_private_data ( const Properties se_private_data)
pure virtual

Implemented in dd::Table_impl.

◆ set_se_private_id()

virtual void dd::Table::set_se_private_id ( Object_id  se_private_id)
pure virtual

Implemented in dd::Table_impl.

◆ set_subpartition_expression()

virtual void dd::Table::set_subpartition_expression ( const String_type subpartition_expression)
pure virtual

Implemented in dd::Table_impl.

◆ set_subpartition_expression_utf8()

virtual void dd::Table::set_subpartition_expression_utf8 ( const String_type subpartition_expression)
pure virtual

Implemented in dd::Table_impl.

◆ set_subpartition_type()

virtual void dd::Table::set_subpartition_type ( enum_subpartition_type  subpartition_type)
pure virtual

Implemented in dd::Table_impl.

◆ set_tablespace_id()

virtual void dd::Table::set_tablespace_id ( Object_id  tablespace_id)
pure virtual

Implemented in dd::Table_impl.

◆ subpartition_expression()

virtual const String_type& dd::Table::subpartition_expression ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ subpartition_expression_utf8()

virtual const String_type& dd::Table::subpartition_expression_utf8 ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ subpartition_type()

virtual enum_subpartition_type dd::Table::subpartition_type ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ table() [1/2]

const Table& dd::Table::table ( ) const
inline

Dummy method to be able to use Partition and Table interchangeably in templates.

◆ table() [2/2]

Table& dd::Table::table ( )
inline

◆ tablespace_id()

virtual Object_id dd::Table::tablespace_id ( ) const
pure virtual

Implemented in dd::Table_impl.

◆ triggers() [1/2]

virtual const Trigger_collection& dd::Table::triggers ( ) const
pure virtual

Get const reference to Trigger_collection.

Returns
Trigger_collection& - Const reference to a collection of triggers.

Implemented in dd::Table_impl.

◆ triggers() [2/2]

virtual Trigger_collection* dd::Table::triggers ( )
pure virtual

Get non-const pointer to Trigger_collection.

Returns
Trigger_collection* - Pointer to collection of triggers.

Implemented in dd::Table_impl.

◆ update_aux_key() [1/2]

virtual bool dd::Table::update_aux_key ( Aux_key key) const
inlinevirtual

Reimplemented from dd::Abstract_table.

Reimplemented in dd::Table_impl.

◆ update_aux_key() [2/2]

bool Table::update_aux_key ( Aux_key key,
const String_type engine,
Object_id  se_private_id 
)
static

The documentation for this class was generated from the following files: