MySQL  8.0.18
Source Code Documentation
RPL_TABLE_LIST Struct Reference

Extend the normal table list with a few new fields needed by the slave thread, but nowhere else. More...

#include <rpl_utility.h>

Inheritance diagram for RPL_TABLE_LIST:
TABLE_LIST

Public Member Functions

 RPL_TABLE_LIST (const char *db_name_arg, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, const char *alias_arg, enum thr_lock_type lock_type_arg)
 
- Public Member Functions inherited from TABLE_LIST
 TABLE_LIST ()=default
 
 TABLE_LIST (TABLE *table_arg)
 Only to be used by legacy code that temporarily needs a TABLE_LIST, more specifically: Query_result_create::binlog_show_create_table(). More...
 
 TABLE_LIST (const char *db_name, const char *table_name, enum thr_lock_type lock_type)
 Constructor that can be used when the strings are null terminated. More...
 
 TABLE_LIST (const char *db_name, const char *table_name, const char *alias, enum thr_lock_type lock_type)
 Constructor that can be used when the strings are null terminated. More...
 
 TABLE_LIST (TABLE *table_arg, const char *alias_arg, thr_lock_type lock_type_arg)
 
 TABLE_LIST (TABLE *table_arg, const char *alias_arg, enum_mdl_type mdl_type)
 Sets an explicit enum_mdl_type value, without initializing m_lock_descriptor. More...
 
 TABLE_LIST (const char *db_name, const char *table_name_arg, enum thr_lock_type lock_type_arg, enum enum_mdl_type mdl_request_type)
 
 TABLE_LIST (const char *db_name, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, enum thr_lock_type lock_type_arg, enum enum_mdl_type mdl_request_type)
 
 TABLE_LIST (const char *db_name, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, enum thr_lock_type lock_type_arg)
 
 TABLE_LIST (const char *db_name, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, const char *alias_arg, enum enum_mdl_type mdl_request_type)
 Sets an explicit enum_mdl_type value, without initializing m_lock_descriptor. More...
 
 TABLE_LIST (const char *db_name, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, const char *alias_arg, enum thr_lock_type lock_type_arg, enum enum_mdl_type mdl_request_type)
 
 TABLE_LIST (const char *db_name_arg, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, const char *alias_arg, enum thr_lock_type lock_type_arg)
 
Item ** join_cond_ref ()
 
Itemjoin_cond () const
 
void set_join_cond (Item *val)
 
Itemjoin_cond_optim () const
 
void set_join_cond_optim (Item *cond)
 
Item ** join_cond_optim_ref ()
 
bool is_sj_nest () const
 
bool is_aj_nest () const
 
bool is_sj_or_aj_nest () const
 
void set_sj_or_aj_nest ()
 Makes the next a semi/antijoin nest. More...
 
bool merge_underlying_tables (SELECT_LEX *select)
 Merge tables from a query block into a nested join structure. More...
 
void reset ()
 Reset table. More...
 
int view_check_option (THD *thd) const
 Evaluate the check option of a view. More...
 
void cleanup_items ()
 Cleanup field translations for a view. More...
 
void print (const THD *thd, String *str, enum_query_type query_type) const
 Produce a textual identification of this object. More...
 
bool check_single_table (TABLE_LIST **table_ref, table_map map)
 Check which single table inside a view that matches a table map. More...
 
bool set_insert_values (MEM_ROOT *mem_root)
 Allocate a buffer for inserted column values. More...
 
TABLE_LISTfirst_leaf_for_name_resolution ()
 Retrieve the first (left-most) leaf in a nested join tree with respect to name resolution. More...
 
TABLE_LISTlast_leaf_for_name_resolution ()
 Retrieve the last (right-most) leaf in a nested join tree with respect to name resolution. More...
 
bool is_leaf_for_name_resolution () const
 Test if this is a leaf with respect to name resolution. More...
 
const TABLE_LISTtop_table () const
 Return the outermost view this table belongs to, or itself. More...
 
TABLE_LISTtop_table ()
 
bool prepare_check_option (THD *thd, bool is_cascaded=false)
 Prepare check option for a view. More...
 
bool merge_where (THD *thd)
 Merge WHERE condition of view or derived table into outer query. More...
 
bool prepare_replace_filter (THD *thd)
 Prepare replace filter for a view (used for REPLACE command) More...
 
bool is_view () const
 Return true if this represents a named view. More...
 
bool is_derived () const
 Return true if this represents a derived table (an unnamed view) More...
 
bool is_view_or_derived () const
 Return true if this represents a named view or a derived table. More...
 
bool is_table_function () const
 Return true if this represents a table function. More...
 
bool is_recursive_reference () const
 
bool set_recursive_reference ()
 
bool is_internal () const
 
bool is_placeholder () const
 
bool is_mergeable () const
 Return true if view or derived table and can be merged. More...
 
bool materializable_is_const () const
 Checks if this is a table that contains zero rows or one row, and that can be materialized during optimization. More...
 
bool is_merged () const
 Return true if this is a derived table or view that is merged. More...
 
void set_merged ()
 Set table to be merged. More...
 
bool uses_materialization () const
 Return true if this is a materializable derived table/view. More...
 
void set_uses_materialization ()
 Set table to be materialized. More...
 
bool is_updatable () const
 Return true if table is updatable. More...
 
void set_updatable ()
 Set table as updatable. (per default, a table is non-updatable) More...
 
bool is_insertable () const
 Return true if table is insertable-into. More...
 
void set_insertable ()
 Set table as insertable-into. (per default, a table is not insertable) More...
 
void set_readonly ()
 Set table as readonly, ie it is neither updatable, insertable nor deletable during this statement. More...
 
bool is_multiple_tables () const
 Return true if this is a view or derived table that is defined over more than one base table, and false otherwise. More...
 
uint leaf_tables_count () const
 Return no. of base tables a merged view or derived table is defined over. More...
 
TABLE_LISTfirst_leaf_table ()
 Return first leaf table of a base table or a view/derived table. More...
 
TABLE_LISTany_outer_leaf_table ()
 Return any leaf table that is not an inner table of an outer join. More...
 
void set_view_query (LEX *lex)
 Set the LEX object of a view (will also define this as a view). More...
 
LEXview_query () const
 Return the valid LEX object for a view. More...
 
void set_derived_unit (SELECT_LEX_UNIT *query_expr)
 Set the query expression of a derived table or view. More...
 
SELECT_LEX_UNITderived_unit () const
 Return the query expression of a derived table or view. More...
 
void save_name_temporary ()
 Save names of materialized table. More...
 
void set_name_temporary ()
 Set temporary name from underlying temporary table: More...
 
void reset_name_temporary ()
 Reset original name for temporary table. More...
 
bool resolve_derived (THD *thd, bool apply_semijoin)
 Resolve a derived table or view reference. More...
 
bool optimize_derived (THD *thd)
 Optimize the query expression representing a derived table/view. More...
 
bool create_materialized_table (THD *thd)
 Create result table for a materialized derived table/view. More...
 
bool materialize_derived (THD *thd)
 Materialize derived table. More...
 
bool cleanup_derived (THD *thd)
 Clean up the query expression for a materialized derived table. More...
 
bool prepare_security (THD *thd)
 Prepare security context for a view. More...
 
Security_contextfind_view_security_context (THD *thd)
 Find security context of current view. More...
 
bool prepare_view_security_context (THD *thd)
 Load security context information for this view. More...
 
void reinit_before_use (THD *thd)
 Cleanup for re-execution in a prepared statement or a stored procedure. More...
 
bool process_index_hints (const THD *thd, TABLE *table)
 Compiles the tagged hints list and fills up TABLE::keys_in_use_for_query, TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by, TABLE::force_index and TABLE::covering_keys. More...
 
bool is_table_ref_id_equal (TABLE_SHARE *s) const
 Compare the version of metadata from the previous execution (if any) with values obtained from the current table definition cache element. More...
 
void set_table_ref_id (TABLE_SHARE *s)
 Record the value of metadata version of the corresponding table definition cache element in this parse tree node. More...
 
void set_table_ref_id (enum_table_ref_type table_ref_type_arg, ulonglong table_ref_version_arg)
 
uint query_block_id () const
 If a derived table, returns query block id of first underlying query block. More...
 
uint query_block_id_for_explain () const
 This is for showing in EXPLAIN. More...
 
const char * get_db_name () const
 Returns the name of the database that the referenced table belongs to. More...
 
const char * get_table_name () const
 Returns the name of the table that this TABLE_LIST represents. More...
 
int fetch_number_of_rows ()
 Retrieve number of rows in the table. More...
 
bool update_derived_keys (THD *, Field *, Item **, uint, bool *)
 
bool generate_keys ()
 Generate keys for a materialized derived table/view. More...
 
bool setup_materialized_derived (THD *thd)
 Setup a derived table to use materialization. More...
 
bool setup_materialized_derived_tmp_table (THD *thd)
 Sets up the tmp table to contain the derived table's rows. More...
 
bool setup_table_function (THD *thd)
 Setup a table function to use materialization. More...
 
bool create_field_translation (THD *thd)
 Create field translation for merged derived table/view. More...
 
TABLE_LISTouter_join_nest () const
 Returns the outer join nest that this TABLE_LIST belongs to, if any. More...
 
bool is_inner_table_of_outer_join () const
 Return true if this table is an inner table of some outer join. More...
 
const TABLE_LISTupdatable_base_table () const
 Return the base table entry of an updatable table. More...
 
TABLE_LISTupdatable_base_table ()
 
void add_join_natural (TABLE_LIST *b)
 Mark that there is a NATURAL JOIN or JOIN ... More...
 
void set_privileges (ulong privilege)
 Set granted privileges for a table. More...
 
void set_lock (const Lock_descriptor &descriptor)
 
const Lock_descriptorlock_descriptor () const
 
void set_tableno (uint tableno)
 Set table number. More...
 
uint tableno () const
 Return table number. More...
 
table_map map () const
 Return table map derived from table number. More...
 
Common_table_exprcommon_table_expr () const
 If non-NULL, the CTE which this table is derived from. More...
 
void set_common_table_expr (Common_table_expr *c)
 
const Create_col_name_listderived_column_names () const
 
void set_derived_column_names (const Create_col_name_list *d)
 
void propagate_table_maps (table_map map_arg)
 Propagate table map of a table up by nested join tree. More...
 

Public Attributes

bool m_tabledef_valid
 
table_def m_tabledef
 
TABLEm_conv_table
 
- Public Attributes inherited from TABLE_LIST
TABLE_LISTnext_local {nullptr}
 
TABLE_LISTnext_global {nullptr}
 
TABLE_LIST ** prev_global {nullptr}
 
const char * db {nullptr}
 
const char * table_name {nullptr}
 
const char * alias {nullptr}
 
LEX_CSTRING target_tablespace_name {nullptr, 0}
 
const char * schema_table_name {nullptr}
 
char * option {nullptr}
 
Opt_hints_tableopt_hints_table {nullptr}
 Table level optimizer hints for this table. More...
 
Opt_hints_qbopt_hints_qb {nullptr}
 
table_map sj_inner_tables {0}
 
TABLE_LISTnatural_join {nullptr}
 
bool is_natural_join {false}
 
List< String > * join_using_fields {nullptr}
 
List< Natural_join_column > * join_columns {nullptr}
 
bool is_join_columns_complete {false}
 
TABLE_LISTnext_name_resolution_table {nullptr}
 
List< Index_hint > * index_hints {nullptr}
 
TABLEtable {nullptr}
 
Table_id table_id {}
 
Query_result_unionderived_result {nullptr}
 
TABLE_LISTcorrespondent_table {nullptr}
 
Table_functiontable_function {nullptr}
 
ST_SCHEMA_TABLEschema_table {nullptr}
 
SELECT_LEXschema_select_lex {nullptr}
 
bool schema_table_reformed {false}
 
Temp_table_paramschema_table_param {nullptr}
 
SELECT_LEXselect_lex {nullptr}
 
Field_translatorfield_translation {nullptr}
 Array of selected expressions from a derived table or view. More...
 
Field_translatorfield_translation_end {nullptr}
 pointer to element after last one in translation table above More...
 
TABLE_LISTmerge_underlying_list {nullptr}
 
List< TABLE_LIST > * view_tables {nullptr}
 
TABLE_LISTbelong_to_view {nullptr}
 
TABLE_LISTreferencing_view {nullptr}
 
TABLE_LISTparent_l {nullptr}
 
Security_contextsecurity_ctx {nullptr}
 
Security_contextview_sctx {nullptr}
 
TABLE_LISTnext_leaf {nullptr}
 
Itemderived_where_cond {nullptr}
 WHERE condition from derived table. More...
 
Itemcheck_option {nullptr}
 WITH CHECK OPTION condition. More...
 
Itemreplace_filter {nullptr}
 Filter for REPLACE command. More...
 
LEX_STRING select_stmt {nullptr, 0}
 text of (CREATE/SELECT) statement More...
 
LEX_STRING source {nullptr, 0}
 source of CREATE VIEW More...
 
LEX_CSTRING view_db {nullptr, 0}
 saved view database More...
 
LEX_CSTRING view_name {nullptr, 0}
 saved view name More...
 
LEX_STRING timestamp {nullptr, 0}
 GMT time stamp of last operation. More...
 
LEX_USER definer
 definer of view More...
 
ulonglong updatable_view {0}
 
ulonglong algorithm {0}
 The declared algorithm, if this is a view. More...
 
ulonglong view_suid {0}
 view is suid (true by default) More...
 
ulonglong with_check {0}
 WITH CHECK OPTION. More...
 
GRANT_INFO grant
 
uint outer_join {0}
 
uint shared {0}
 
size_t db_length {0}
 
size_t table_name_length {0}
 
bool straight {false}
 
bool updating {false}
 True for tables and views being changed in a data change statement. More...
 
bool force_index {false}
 True if using an index is preferred over a table scan. More...
 
bool ignore_leaves {false}
 preload only non-leaf nodes (IS THIS USED???) More...
 
table_map dep_tables {0}
 The set of tables in the query block that this table depends on. More...
 
table_map join_cond_dep_tables {0}
 The outer tables that an outer join's join condition depends on. More...
 
NESTED_JOINnested_join {nullptr}
 Is non-NULL if this table reference is a nested join, ie it represents the inner tables of an outer join, the tables contained in the parentheses of an inner join (eliminated during resolving), the tables referenced in a derived table or view, in a semi-join nest, the tables from the subquery. More...
 
TABLE_LISTembedding {nullptr}
 The nested join containing this table reference. More...
 
List< TABLE_LIST > * join_list {nullptr}
 The join list immediately containing this table reference. More...
 
bool cacheable_table {false}
 stop PS caching More...
 
enum_open_type open_type {OT_TEMPORARY_OR_BASE}
 Specifies which kind of table should be open for this element of table list. More...
 
bool contain_auto_increment {false}
 
bool check_option_processed {false}
 true <=> VIEW CHECK OPTION condition is processed (also for prep. stmts) More...
 
bool replace_filter_processed {false}
 true <=> Filter condition is processed More...
 
dd::enum_table_type required_type {}
 
char timestamp_buffer [20] {0}
 
bool prelocking_placeholder {false}
 
enum TABLE_LIST:: { ... }  OPEN_NORMAL
 Indicates that if TABLE_LIST object corresponds to the table/view which requires special handling. More...
 
bool internal_tmp_table {false}
 
bool is_alias {false}
 true if an alias for this table was specified in the SQL. More...
 
bool is_fqtn {false}
 true if the table is referred to in the statement using a fully qualified name (<db_name>. More...
 
View_creation_ctxview_creation_ctx {nullptr}
 
LEX_CSTRING view_client_cs_name {nullptr, 0}
 
LEX_CSTRING view_connection_cl_name {nullptr, 0}
 
LEX_STRING view_body_utf8 {nullptr, 0}
 
bool is_system_view {false}
 
bool is_dd_ctx_table {false}
 
List< Derived_keyderived_key_list
 
uint8 trg_event_map {0}
 Indicates what triggers we need to pre-load for this TABLE_LIST when opening an associated TABLE. More...
 
uint i_s_requested_object {0}
 
bool has_db_lookup_value {false}
 
bool has_table_lookup_value {false}
 
uint table_open_method {0}
 
enum_schema_table_state schema_table_state {NOT_PROCESSED}
 
MDL_request mdl_request
 
bool view_no_explain {false}
 if true, EXPLAIN can't explain view due to insufficient rights. More...
 
List< String > * partition_names {nullptr}
 
COND_EQUALcond_equal {nullptr}
 Used with outer join. More...
 
bool optimized_away {false}
 true <=> this table is a const one and was optimized away. More...
 
bool derived_keys_ready {false}
 true <=> all possible keys for a derived table were collected and could be re-used while statement re-execution. More...
 

Additional Inherited Members

- Public Types inherited from TABLE_LIST
enum  { OPEN_NORMAL = 0, OPEN_IF_EXISTS, OPEN_FOR_CREATE, OPEN_STUB }
 Indicates that if TABLE_LIST object corresponds to the table/view which requires special handling. More...
 
- Static Public Member Functions inherited from TABLE_LIST
static TABLE_LISTnew_nested_join (MEM_ROOT *allocator, const char *alias, TABLE_LIST *embedding, List< TABLE_LIST > *belongs_to, SELECT_LEX *select)
 Create a TABLE_LIST object representing a nested join. More...
 

Detailed Description

Extend the normal table list with a few new fields needed by the slave thread, but nowhere else.

Constructor & Destructor Documentation

◆ RPL_TABLE_LIST()

RPL_TABLE_LIST::RPL_TABLE_LIST ( const char *  db_name_arg,
size_t  db_length_arg,
const char *  table_name_arg,
size_t  table_name_length_arg,
const char *  alias_arg,
enum thr_lock_type  lock_type_arg 
)
inline

Member Data Documentation

◆ m_conv_table

TABLE* RPL_TABLE_LIST::m_conv_table

◆ m_tabledef

table_def RPL_TABLE_LIST::m_tabledef

◆ m_tabledef_valid

bool RPL_TABLE_LIST::m_tabledef_valid

The documentation for this struct was generated from the following file: