YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
class Item; /* Needed by ORDER */ typedef Item (*Item_ptr); class Item_subselect; class Item_field; class Item_func_hash; class GRANT_TABLE; class st_select_lex_unit; class st_select_lex; class partition_info; class COND_EQUAL; class Security_context; struct TABLE_LIST; class ACL_internal_schema_access; class ACL_internal_table_access; class Field; class Copy_field; class Table_statistics; class With_element; struct TDC_element; class Virtual_column_info; class Table_triggers_list; class TMP_TABLE_PARAM; class SEQUENCE; class Range_rowid_filter_cost_info; class derived_handler; class Pushdown_derived; struct Name_resolution_context; class Table_function_json_table; class Open_table_context; class MYSQL_LOG; struct rpl_group_info; class Opt_hints_qb; class Opt_hints_table;
enum enum_table_ref_type
{ /** Initial value set by the parser */
TABLE_REF_NULL= 0,
TABLE_REF_VIEW,
TABLE_REF_BASE_TABLE,
TABLE_REF_I_S_TABLE,
TABLE_REF_TMP_TABLE
};
typedefint (*fast_field_copier)(Field *to, Field *from); class Item_window_func;
typedefstruct st_order { struct st_order *next;
Item **item; /* Point at item in select fields */
Item *item_ptr; /* Storage for initial item */ /* Referencetothefunctionwearetryingtooptimizecopyto atemporarytable
*/
fast_field_copier fast_field_copier_func; /* Field for which above optimizer function setup */
Field *fast_field_copier_setup; int counter; /* position in SELECT list, correct
only if counter_used is true*/ enum enum_order {
ORDER_NOT_RELEVANT,
ORDER_ASC,
ORDER_DESC
};
enum_order direction; /* Requested direction of ordering */ bool in_field_list; /* true if in select field list */ bool counter_used; /* parameter was counter of columns */
Field *field; /* If tmp-table group */ char *buff; /* If tmp-table group */
table_map used; /* NOTE: the below is only set to 0 but is still used by eq_ref_table */
table_map depend_map;
List<Item_window_func> window_funcs;
} ORDER;
/** Stateinformationforinternaltablesgrants. ThisstructureispartoftheTABLE_LIST,andisupdated duringtheACLcheckprocess. @saGRANT_INFO
*/ struct st_grant_internal_info
{ /** True if the internal lookup by schema name was done. */ bool m_schema_lookup_done; /** Cached internal schema access. */ const ACL_internal_schema_access *m_schema_access; /** True if the internal lookup by table name was done. */ bool m_table_lookup_done; /** Cached internal table access. */ const ACL_internal_table_access *m_table_access;
}; typedefstruct st_grant_internal_info GRANT_INTERNAL_INFO;
enum __attribute__((packed)) field_visibility_t {
VISIBLE= 0,
INVISIBLE_USER, /* automatically added by the server. Can be queried explicitly
in SELECT, otherwise invisible from anything" */
INVISIBLE_SYSTEM,
INVISIBLE_FULL
};
class TABLE_STATISTICS_CB
{
uint usage_count; // Instances of this stat
public:
TABLE_STATISTICS_CB();
~TABLE_STATISTICS_CB();
MEM_ROOT mem_root; /* MEM_ROOT to allocate statistical data for the table */
Table_statistics *table_stats; /* Structure to access the statistical data */
uint stats_available; bool histograms_exists_on_disk;
/** Category of this table. */
TABLE_CATEGORY table_category;
/* hash of field names (contains pointers to elements of field array) */
HASH name_hash; /* hash of field names */
MEM_ROOT mem_root;
TYPELIB keynames; /* Pointers to keynames */
TYPELIB fieldnames; /* Pointer to fieldnames */
TYPELIB *intervals; /* pointer to interval info */
mysql_mutex_t LOCK_ha_data; /* To protect access to ha_data */
mysql_mutex_t LOCK_share; /* To protect TABLE_SHARE */
mysql_mutex_t LOCK_statistics; /* To protect against concurrent load */
void lock_share() { if (!tmp_table) mysql_mutex_lock(&LOCK_share); } void unlock_share() { if (!tmp_table) mysql_mutex_unlock(&LOCK_share); }
TDC_element *tdc;
LEX_CUSTRING tabledef_version;
engine_option_value *option_list; /* text options for table */ /* Structurewithparsedoptions.Table-wide,enginesshoulduse handler::option_struct,otherwisetheywon'tseeper-partitionoptions.
*/
ha_table_option_struct *option_struct_table;
/* The following is copied to each TABLE on OPEN */
Field **field;
Field **found_next_number_field;
KEY *key_info; /* data of keys in database */
Virtual_column_info **check_constraints;
uint *blob_field; /* Index to blobs in Field arrray*/
LEX_CUSTRING vcol_defs; /* definitions of generated columns */
union { void *hlindex_data; /* for hlindex tables */
TABLE_SHARE *hlindex; /* for normal tables */
};
/* The set of ignored indexes for a table. */
key_map ignored_indexes;
key_map keys_for_keyread;
ha_rows min_rows, max_rows; /* create information */
ulong avg_row_length; /* create information */
ulong mysql_version; /* 0 if .frm is created before 5.0 */
ulong reclength; /* Recordlength */ /* Stored record length. No generated-only virtual fields are included */
ulong stored_rec_length;
/** Transactional or not. */ enum ha_choice transactional; /** Per-page checksums or not. */ enum ha_choice page_checksum;
uint key_block_size; /* create key_block_size, if used */
uint stats_sample_pages; /* number of pages to sample during
stats estimation, if used, otherwise 0. */
enum_stats_auto_recalc stats_auto_recalc; /* Automatic recalc of stats. */
uint null_bytes, last_null_bit_pos; /* Sameasnull_bytes,exceptthatifthereisonlya'delete-marker'in therecordthenthisvalueis0.
*/
uint null_bytes_for_compare;
uint fields; /* number of fields */ /* number of stored fields, purely virtual not included */
uint stored_fields;
uint virtual_fields; /* number of purely virtual fields */ /* number of purely virtual not stored blobs */
uint virtual_not_stored_blob_fields;
uint null_fields; /* number of null fields */
uint blob_fields; /* number of blob fields */
uint varchar_fields; /* number of varchar fields */
uint default_fields; /* number of default fields */
uint visible_fields; /* number of visible fields */
uint rec_buff_length; /* Size of table->record[] buffer */
uint keys; /* Number of KEY's for the engine */
uint total_keys; /* total number of KEY's, including
high level indexes */
uint hlindexes() { return total_keys - keys; }
uint key_parts;
uint ext_key_parts; /* Total number of key parts in extended keys */
uint max_key_length, max_unique_length;
/* OlderversionshadTABLE_SHARE::uniquesbutnowitisreplacedwith per-indexHA_UNIQUE_HASHflag
*/ bool have_unique_constraint() const
{ for (uint i=0; i < keys; i++) if (key_info[i].flags & HA_UNIQUE_HASH) returntrue; returnfalse;
}
uint db_create_options; /* Create options from database */
uint db_options_in_use; /* Options in use */
uint db_record_offset; /* if HA_REC_IN_SEQ */
uint rowid_field_offset; /* Field_nr +1 to rowid field */ /* Primary key index number, used in TABLE::key_info[] */
uint primary_key;
uint next_number_index; /* autoincrement key number */
uint next_number_key_offset; /* autoinc keypart offset in a key */
uint next_number_keypart; /* autoinc keypart number in a key */ enum open_frm_error error; /* error from open_table_def() */
uint open_errno; /* error from open_table_def() */
uint column_bitmap_size;
uchar frm_version;
uchar *record[3]; /* Pointer to records */
uchar *write_row_record; /* Used as optimisation in
THD::write_row */
uchar *insert_values; /* used by INSERT ... UPDATE */ /* Mapofkeysthatcanbeusedtoretrievealldatafromthistable neededbythequerywithoutreadingtherow.
*/
key_map covering_keys, intersect_keys; /* Asetofkeysthatcanbeusedinthequerythatreferencesthis table.
Thesetisimplementedasabitmap.
*/
key_map keys_in_use_for_query; /* Map of keys that can be used to calculate GROUP BY without sorting */
key_map keys_in_use_for_group_by; /* Map of keys that can be used to calculate ORDER BY without sorting */
key_map keys_in_use_for_order_by; /* Map of keys that can be used to build ROWID filters */
key_map keys_in_use_for_rowid_filter; /* Map of keys dependent on some constraint */
key_map constraint_dependent_keys;
KEY *key_info; /* data of keys in database */
Field **field; /* Pointer to fields */
Field **vfield; /* Pointer to virtual fields*/
Field **default_field; /* Fields with non-constant DEFAULT */
Field *next_number_field; /* Set if next_number is activated */
Field *found_next_number_field; /* Set on open */
Virtual_column_info **check_constraints;
/* Table's triggers, 0 if there are no of them */
Table_triggers_list *triggers;
TABLE_LIST *pos_in_table_list;/* Element referring to this table */ /* Position in thd->locked_table_list under LOCK TABLES */
TABLE_LIST *pos_in_locked_tables; /* Tables used in DEFAULT and CHECK CONSTRAINT (normally sequence tables) */
TABLE_LIST *internal_tables;
TABLE *hlindex; /* Not-nullfortemporarytablesonly.Non-nullvaluesmeansthistableis usedtocomputeGROUPBY,ithasauniqueofGROUPBYcolumns. (setbycreate_tmp_table)
*/ union {
ORDER *group; /* only for temporary tables */ void *context; /* only for hlindexes */
};
String alias; /* alias or table name */
uchar *null_flags;
MY_BITMAP def_read_set, def_write_set, tmp_set;
MY_BITMAP def_rpl_write_set;
MY_BITMAP eq_join_set; /* used to mark equi-joined fields */
MY_BITMAP cond_set; /* used to mark fields from sargable conditions*/ /* Active column sets */
MY_BITMAP *read_set, *write_set, *rpl_write_set; /* On INSERT: fields that the user specified a value for */
MY_BITMAP has_value_set;
table_map map; /* ID bit of table (1,2,4,8,16...) */
uint lock_position; /* Position in MYSQL_LOCK.table */
uint lock_data_start; /* Start pos. in MYSQL_LOCK.locks */
uint lock_count; /* Number of locks */
uint tablenr,used_fields;
uint temp_pool_slot; /* Used by intern temp tables */
uint status; /* What's in record[0] */
uint db_stat; /* mode of file as in handler.h */ /* number of select if it is derived table */
uint derived_select_number; /* Possiblevalues: -0bydefault -JOIN_TYPE_{LEFT|RIGHT}ifthetableisinnerw.r.tanouterjoin operation -1iftheSELECThasmixed_implicit_grouping=1.example: selectmax(col1),col2fromt1.Inthiscase,thequeryproduces onerowwithallcolumnshavingNULLvalues.
Interpretation:Ifmaybe_null!=0,allfieldsofthetableareconsidered NULLable(andhaveNULLvalueswhennull_row=true)
*/
uint maybe_null;
uint max_keys; /* Size of allocated key_info array. */ int current_lock; /* Type of lock on table */ /* Number of cost info elements for possible range filters */
uint range_rowid_filter_cost_info_elems;
uint32 instance; /** Table cache instance this TABLE is belonging to */
/* variables of type bool */ bool copy_blobs; /* copy_blobs when storing */ /* Setifnext_number_fieldisintheUPDATEfieldsofINSERT...ONDUPLICATE KEYUPDATE.
*/ bool next_number_field_updated;
bool no_keyread; /** Ifset,indicatethatthetableisnotreplicatedbytheserver.
*/ bool locked_by_logger; bool locked_by_name; bool fulltext_searched; bool no_cache; /* To signal that the table is associated with a HANDLER statement */ bool open_by_handler; /* Toindicatethatanon-nullvalueoftheauto_incrementfield wasprovidedbytheuserorretrievedfromthecurrentrecord. UsedonlyintheMODE_NO_AUTO_VALUE_ON_ZEROmode.
*/ bool auto_increment_field_not_null; /* NOTE:alias_name_usedisonlyahint!Itworksonlyinneed_correct_ident() condition.OnothercasesitisFALSEeveniftable_nameisalias.
E.g.inupdatet1asxseta=1
*/ bool alias_name_used; /* true if table_name is alias */ bool get_fields_in_item_tree; /* Signal to fix_field */ private: bool m_needs_reopen; bool created; /* For tmp tables. TRUE <=> tmp table was actually created.*/ public: #ifdef HAVE_REPLICATION /* used in RBR Triggers */ bool master_had_triggers; #endif /* Temporary value used by binlog_write_table_maps(). Does not need init */ bool restore_row_logging; bool stats_is_read; /* Persistent statistics is read for the table */ bool histograms_are_read; #ifdef WITH_PARTITION_STORAGE_ENGINE /* If true, all partitions have been pruned away */ bool all_partitions_pruned_away; #endif bool vers_write; // For versioning
List<Virtual_column_info> vcol_refix_list;
REGINFO reginfo; /* field connections */
MEM_ROOT mem_root; /* this is for temporary tables created inside Item_func_group_concat */ union { bool group_concat; /* used during create_tmp_table() */
Blob_mem_storage *blob_storage; /* used after create_tmp_table() */
};
GRANT_INFO grant; /* Thearenawhichtheitemsforexpressionsfromthetabledefinition areassociatedwith. Currentlyonlytheitemsoftheexpressionsforvirtualcolumnsare associatedwiththisarena. TODO:Toattachthepartitioningexpressionstothisarena.
*/
Query_arena *expr_arena; #ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info; /* Partition related information */ #endif
MDL_ticket *mdl_ticket;
int hlindex_open(uint nr); int hlindex_lock(uint nr); int hlindex_read_first(uint nr, Item *item, ulonglong limit); int hlindex_read_next(); int hlindex_read_end();
int open_hlindexes_for_write(); int hlindexes_on_insert(); int hlindexes_on_update(); int hlindexes_on_delete(const uchar *buf); int hlindexes_on_delete_all(bool truncate); int unlock_hlindexes();
Field **field_to_fill(); bool validate_default_values_of_unset_fields(THD *thd) const;
// Check if the value list is assignable to the explicit field list staticbool check_assignability_explicit_fields(List<Item> fields,
List<Item> values, bool ignore); // Check if the value list is assignable to all visible fields bool check_assignability_all_visible_fields(List<Item> &values, bool ignore) const; /* Checkifthevaluelistisassignableto: -Theexplicitfieldlistiffields.elements>0,e.g. INSERTINTOt1(a,b)VALUES(1,2); -Allvisiblefields,iffields.elements==0,e.g. INSERTINTOt1VALUES(1,2);
*/ bool check_assignability_opt_fields(List<Item> fields,
List<Item> values, bool ignore) const
{
DBUG_ASSERT(values.elements); return fields.elements ?
check_assignability_explicit_fields(fields, values, ignore) :
check_assignability_all_visible_fields(values, ignore);
}
bool insert_all_rows_into_tmp_table(THD *thd,
TABLE *tmp_table,
TMP_TABLE_PARAM *tmp_table_param, bool with_cleanup); bool check_sequence_privileges(THD *thd); bool vcol_fix_expr(THD *thd); bool vcol_cleanup_expr(THD *thd);
Field *find_field_by_name(const LEX_CSTRING *str) const; bool export_structure(THD *thd, class Row_definition_list *defs) const; bool is_splittable() { return spl_opt_info != NULL; } void set_spl_opt_info(SplM_opt_info *spl_info); void deny_splitting(); double get_materialization_cost(); // Now used only if is_splittable()==true void add_splitting_info_for_key_field(struct KEY_FIELD *key_field);
key_map with_impossible_ranges;
/* Pointer to the array of cost info elements for range filters */
Range_rowid_filter_cost_info *range_rowid_filter_cost_info; /* The array of pointers to cost info elements for range filters */
Range_rowid_filter_cost_info **range_rowid_filter_cost_info_ptr;
int update_generated_fields(); void period_prepare_autoinc(); int period_make_insert(Item *src, Field *dst); int insert_portion_of_time(THD *thd, const vers_select_conds_t &period_conds,
ha_rows *rows_inserted); bool vers_check_update(List<Item> &items); staticbool check_period_overlaps(const KEY &key, const uchar *lhs, const uchar *rhs); inlineint delete_row(){ return delete_row<false>(versioned(VERS_TIMESTAMP)); } template <bool replace> int delete_row(bool versioned); /* Used in majority of DML (called from fill_record()) */ bool vers_update_fields(); /* Used in DELETE, DUP REPLACE and insert history row */ void vers_update_end(); #ifdef HAVE_REPLICATION void vers_fix_old_timestamp(rpl_group_info *rgi); #endif void find_constraint_correlated_indexes();
/* Mark that table is not up to date in binary log */ void mark_as_not_binlogged()
{ if (s->tmp_table && s->table_creation_was_logged == 1 &&
file->mark_trx_read_write_done)
{ /* Do not log anything more to binlog for this table */
s->table_creation_was_logged= 2;
}
}
/** Number of additional fields used in versioned tables */ #define VERSIONING_FIELDS 2
};
/* Number of bits used by all phases: */ #define DT_PHASES 9U /* Phases that are applicable to all derived tables. */ #define DT_COMMON (DT_INIT + DT_PREPARE + DT_REINIT + DT_OPTIMIZE + DT_OPTIMIZE_STAGE2) /* Phases that are applicable only to materialized derived tables. */ #define DT_MATERIALIZE (DT_CREATE + DT_FILL)
/* Listoftableslocaltoasubquery(usedbySQL_I_List).Considers viewsasleaves(unlike'next_leaf'below).Createdatparsetime inst_select_lex::add_table_to_list()->table_list.link_in_list().
*/
TABLE_LIST *next_local; /* link in a global list of all queries tables */
TABLE_LIST *next_global, **prev_global;
TABLE_LIST *linked_table; // For sequence tables used in default
Lex_ident_db db;
Lex_ident_table table_name;
Lex_ident_i_s_table schema_table_name;
Lex_ident_table alias; constchar *option; /* Used by cache index */
Item *on_expr; /* Used with outer join */
Name_resolution_context *on_context; /* For ON expressions */
Table_function_json_table *table_function; /* If it's the table function. */
Item *sj_on_expr; /* (Validonlyforsemi-joinnests)Bitmapoftablesthatarewithinthe semi-join(thisisdifferentfrombitmapofallnest'schildrenbecause tablesthatwerepulledoutofthesemi-joinnestremainlistedas nest'schildren).
*/
table_map sj_inner_tables; /* Number of IN-compared expressions */
uint sj_in_exprs;
/* If this is a non-jtbm semi-join nest: corresponding subselect predicate */
Item_in_subselect *sj_subq_pred;
table_map original_subq_pred_used_tables;
/* If this is a jtbm semi-join object: corresponding subselect predicate */
Item_in_subselect *jtbm_subselect; /* TODO: check if this can be joined with tablenr_exec */
uint jtbm_table_no;
uint ora_join_table_no;
SJ_MATERIALIZATION_INFO *sj_mat_info;
/* ThestructureofONexpressionpresentedinthememberabove canbechangedduringcertainoptimizations.Thismember containsasnapshotofAND-ORstructureoftheONexpression madeafterpermanenttransformationsoftheparsetree,andis usedtorestoreONclausebeforeeveryreexecutionofaprepared statementorstoredprocedure.
*/
Item *prep_on_expr;
COND_EQUAL *cond_equal; /* Used with outer join */ /* Duringparsing-leftoperandofNATURAL/USINGjoinwhere'this'is therightoperand.Afterparsing(this->natural_join==this)iff 'this'representsaNATURALorUSINGjoinoperation.Thusafter parsing'this'isaNATURAL/USINGjoiniff(natural_join!=NULL).
*/
TABLE_LIST *natural_join; /* Trueif'this'representsanestedjointhatisaNATURALJOIN. Foroneoftheoperandsof'this',themember'natural_join'points totheotheroperandof'this'.
*/ bool is_natural_join; /* Field names in a USING clause for JOIN ... USING. */
List<String> *join_using_fields; /* ExplicitlystoretheresultcolumnsofeitheraNATURAL/USINGjoinor anoperandofsuchajoin.
*/
List<Natural_join_column> *join_columns; /* TRUE if join_columns contains all columns of this table reference. */ bool is_join_columns_complete;
/* Listofnodesinanestedjointree,thatshouldbeconsideredas leaveswithrespecttonameresolution.Theleavesare:views, top-mostnodesrepresentingNATURAL/USINGjoins,subqueries,and basetables.AlloftheseTABLE_LISTinstancescontaina materializedlistofcolumns.Thelistislocaltoasubquery.
*/
TABLE_LIST *next_name_resolution_table; /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
List<Index_hint> *index_hints;
TABLE *table; /* opened table */
ulonglong table_id; /* table id (from binlog) for opened table */ /* select_resultforderivedtabletopassitfromtablecreationtotable fillingprocedure
*/
select_unit *derived_result; /* Stub used for materialized derived tables. */ bool delete_while_scanning;
table_map map; /* ID bit of table (1,2,4,8,16...) */
table_map get_map()
{ return jtbm_subselect? table_map(1) << jtbm_table_no : table->map;
}
uint get_tablenr()
{ return jtbm_subselect? jtbm_table_no : table->tablenr;
} void set_tablenr(uint new_tablenr)
{ if (jtbm_subselect)
{
jtbm_table_no= new_tablenr;
} if (table)
{
table->tablenr= new_tablenr;
table->map= table_map(1) << new_tablenr;
}
} /* Referencefromaux_tablestolocallistentryofmainselectof multi-deletestatement: deletet1fromt2,t1wheret1.a<'B'andt2.b=t1.b; hereitwillbereferenceoffirstoccurrenceoft1tosecond(asyou canseethislistscan'tbemerged)
*/
TABLE_LIST *correspondent_table; /** @briefNormally,thisfieldisnon-nullforanonymousderivedtablesonly.
@detailsThisfieldissettonon-nullfor -Anonymousderivedtables,InthiscaseitpointstotheSELECT_LEX_UNIT representingthederivedtable.E.g.foraquery @verbatimSELECT*FROM(SELECTaFROMt1)b@endverbatim Forthe@cTABLE_LISTrepresentingthederivedtable@cb,@cderived pointstotheSELECT_LEX_UNITrepresentingtheresultofthequerywithin parentheses. -Views.Thisissetforviewswith@verbatimALGORITHM=TEMPTABLE @endverbatimbymysql_make_view(). @noteInsideviews,asubqueryinthe@cFROMclauseisnotallowed. @noteDonotusethisfieldtoseparateviews/basetables/anonymous derivedtables.UseTABLE_LIST::is_anonymous_derived_table(). @note_column_names_belowareassociatedwiththesederivedtables SELECT*FROM(SELECTaFROMt1)b(listofcolumnnames) @note_original_names_belowareusedtosave*item_list.nameinthe select_lexformultipleexecutions
*/
st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */
With_element *with; /* With element defining this table (if any) */
List<Lex_ident_sys> *column_names; /* list of correlation column names */
List<Lex_ident_sys> *original_names;/* list of original column names */
st_select_lex *original_names_source; bool save_original_names(st_select_lex *derived);
/* Bitmap of the defining with element */
table_map with_internal_reference_map;
TABLE_LIST * next_with_rec_ref; bool is_derived_with_recursive_reference; bool block_handle_derived; /* The interface employed to materialize the table by a foreign engine */
derived_handler *dt_handler; /* Theobjectusedtoorganizeexecutionofthequerythatspecifies thederivedtablebyaforeignengine
*/
Pushdown_derived *pushdown_derived;
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex; /* Truewhentheviewfieldtranslationtableisusedtoconvert schematablefieldsforbackwardscompatibilitywithSHOWcommand.
*/ bool schema_table_reformed;
TMP_TABLE_PARAM *schema_table_param; /* link to select_lex where this table was used */
st_select_lex *select_lex;
LEX *view; /* link on VIEW lex for merging */
Field_translator *field_translation; /* array of VIEW fields */ /* pointer to element after last one in translation table above */
Field_translator *field_translation_end; bool field_translation_updated; /* List(basedonnext_local)ofunderlyingtablesofthisview.I.e.it doesnotincludethetablesofsubqueriesusedintheview.Issetonly formergedviews.
*/
TABLE_LIST *merge_underlying_list; /* -0forbasetables -incaseoftheviewitisthelistofall(notonlyunderlying tablesbutalsousedinsubqueryones)tablesoftheview.
*/
List<TABLE_LIST> *view_tables; /* most upper view this table belongs to */
TABLE_LIST *belong_to_view; /* A merged derived table this table belongs to */
TABLE_LIST *belong_to_derived; /* Theviewdirectlyreferencingthistable (non-zeroonlyformergedunderlyingtablesofaview).
*/
TABLE_LIST *referencing_view;
table_map view_used_tables;
table_map map_exec; /* TODO: check if this can be joined with jtbm_table_no */
uint tablenr_exec;
uint maybe_null_exec;
/* Ptr to parent MERGE table list item. See top comment in ha_myisammrg.cc */
TABLE_LIST *parent_l; /* Securitycontext(non-zeroonlyfortableswhichbelong toviewwithSQLSECURITYDEFINER)
*/
Security_context *security_ctx;
uchar tabledef_version_buf[MY_UUID_SIZE >
MICROSECOND_TIMESTAMP_BUFFER_SIZE-1 ?
MY_UUID_SIZE + 1 :
MICROSECOND_TIMESTAMP_BUFFER_SIZE];
LEX_CUSTRING tabledef_version;
/* Thisviewsecuritycontext(non-zeroonlyforviewswith SQLSECURITYDEFINER)
*/
Security_context *view_sctx; bool allowed_show;
Item *where; /* VIEW WHERE clause condition */
Item *check_option; /* WITH CHECK OPTION condition */
LEX_STRING select_stmt; /* text of (CREATE/SELECT) statement */
LEX_CSTRING md5; /* md5 of query text */
LEX_CSTRING source; /* source of CREATE VIEW */
Lex_ident_db view_db; /* saved view database */
Lex_ident_table view_name; /* saved view name */
LEX_STRING hr_timestamp; /* time stamp of last operation */
LEX_USER definer; /* definer of view */
ulonglong file_version; /* version of file's field set */
ulonglong mariadb_version; /* version of server on creation */
ulonglong updatable_view; /* VIEW can be updated */
LEX_CSTRING m_sql_path; /* The session PATH on creation */ /** @briefThedeclaredalgorithm,ifthisisaview. @detailsOneof -VIEW_ALGORITHM_UNDEFINED -VIEW_ALGORITHM_TMPTABLE -VIEW_ALGORITHM_MERGE @todoReplacewithanenum
*/
ulonglong algorithm;
ulonglong view_suid; /* view is suid (TRUE dy default) */
ulonglong with_check; /* WITH CHECK OPTION */ /* effectivevalueofWITHCHECKOPTION(differfortemporarytable algorithm)
*/
uint8 effective_with_check; /** @briefTheviewalgorithmthatisactuallyused,ifthisisaview. @detailsOneof -VIEW_ALGORITHM_UNDEFINED -VIEW_ALGORITHM_TMPTABLE -VIEW_ALGORITHM_MERGE @todoReplacewithanenum
*/
uint8 derived_type;
GRANT_INFO grant; /* data need by some engines in query cache*/
ulonglong engine_data; /* call back function for asking handler about caching in query cache */
qc_engine_callback callback_func;
thr_lock_type lock_type;
uint outer_join; /* Which join type */
uint shared; /* Used in multi-upd */ bool updatable; /* VIEW/TABLE can be updated now */ bool straight; /* optimize with prev table */ bool updating; /* for replicate-do/ignore table */ bool ignore_leaves; /* preload only non-leaf nodes */ bool crashed; /* Table was found crashed */ bool skip_locked; /* Skip locked in view definition */
table_map dep_tables; /* tables the table depends on */
table_map on_expr_dep_tables; /* tables on expression depends on */ struct st_nested_join *nested_join; /* if the element is a nested join */
TABLE_LIST *embedding; /* nested join containing the table */
List<TABLE_LIST> *join_list;/* join list the table belongs to */ bool lifted; /* set to true when the table is moved to
the upper level at the parsing stage */ bool cacheable_table; /* stop PS caching */ /* used in multi-upd/views privilege check */ bool table_in_first_from_clause; /** Specifieswhichkindoftableshouldbeopenforthiselement oftablelist.
*/ enum enum_open_type open_type; /* TRUE if this merged view contain auto_increment field */ bool contain_auto_increment; bool compact_view_format; /* Use compact format for SHOW CREATE VIEW */ /* view where processed */ bool where_processed; /* TRUE <=> VIEW CHECK OPTION expression has been processed */ bool check_option_processed; /* TABLE_TYPE_UNKNOWN if any type is acceptable */
Table_type required_type;
handlerton *db_type; /* table_type for handler */ char timestamp_buffer[MICROSECOND_TIMESTAMP_BUFFER_SIZE]; /* ThisTABLE_LISTobjectisjustplaceholderforprelocking,itwillbe usedforimplicitLOCKTABLESonlyandwon'tbeusedinrealstatement.
*/
prelocking_types prelocking_placeholder; /** IndicatesthatifTABLE_LISTobjectcorrespondstothetable/view whichrequiresspecialhandling.
*/ enum enum_open_strategy
{ /* Normal open. */
OPEN_NORMAL= 0, /* Associate a table share only if the table exists. */
OPEN_IF_EXISTS, /* Don't associate a table share. */
OPEN_STUB
} open_strategy; /** TRUE if an alias for this table was specified in the SQL. */ bool is_alias; /** TRUE if the table is referred to in the statement using a fully qualifiedname(<db_name>.<table_name>).
*/ bool is_fqtn;
/* TRUE <=> derived table should be filled right after optimization. */ bool fill_me; /* TRUE <=> view/DT is merged. */ /* TODO: replace with derived_type */ bool merged; bool merged_for_insert; bool sequence; /* Part of NEXTVAL/CURVAL/LASTVAL */ /* Protectsinglethreadfromrepeatingpartitionauto-createover multipleshareinstances(astheshareisclosedonbackoffaction).
slave_fk_event_mapisfilledontheslavesidewithbitmapsvalue representingrow-basedeventoperationtohelpfindandprelock possibleFKconstrain-relatedchildtables.
*/
uint8 trg_event_map, slave_fk_event_map; /* TRUE <=> this table is a const one and was optimized away. */ bool optimized_away;
/** TRUE<=>alreadymaterialized.Validonlyformaterializedderived tables/views.
*/ bool materialized; /* I_S: Flags to open_table (e.g. OPEN_TABLE_ONLY or OPEN_VIEW_ONLY) */
uint i_s_requested_object;
/* Something like a "query plan" for reading INFORMATION_SCHEMA table */
IS_table_read_plan *is_table_read_plan;
MDL_request mdl_request;
#ifdef WITH_PARTITION_STORAGE_ENGINE /* List to carry partition names from PARTITION (...) clause in statement */
List<String> *partition_names; #endif/* WITH_PARTITION_STORAGE_ENGINE */
/** Table level optimizer hints for this table. */
Opt_hints_table *opt_hints_table; /* Hints for query block of this table. */
Opt_hints_qb *opt_hints_qb;
/* Check that the integer is in the internal */ staticinlineint set_zone(int nr,int min_zone,int max_zone)
{ if (nr <= min_zone) return min_zone; if (nr >= max_zone) return max_zone; return nr;
}
ThistableholdstransactionIDs,theircorrespondingtimesandother transaction-relateddatawhichisusedfortransactionorderresolution. WhenversionedtablemarksitsrecordslifetimewithtransactionIDs,
TRT is used to get their actual timestamps. */
class TR_table: public TABLE_LIST
{
THD *thd;
Open_tables_backup *open_tables_backup;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.131Bemerkung:
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.