|
static void | init_tdc_psi_keys (void) |
| Initialize performance schema instrumentation points used by the table cache. More...
|
|
static bool | check_and_update_table_version (THD *thd, Table_ref *tables, TABLE_SHARE *table_share) |
| Compare metadata versions of an element obtained from the table definition cache and its corresponding node in the parse tree. More...
|
|
static bool | open_table_entry_fini (THD *thd, TABLE_SHARE *share, TABLE *entry) |
| Finalize the process of TABLE creation by taking action if a HEAP table's content was emptied implicitly. More...
|
|
static bool | auto_repair_table (THD *thd, Table_ref *table_list) |
| Auxiliary routine which is used for performing automatic table repair. More...
|
|
static TABLE * | find_temporary_table (THD *thd, const char *table_key, size_t table_key_length) |
| Find a temporary table specified by a key in the THD::temporary_tables list. More...
|
|
static bool | tdc_open_view (THD *thd, Table_ref *table_list, const char *cache_key, size_t cache_key_length) |
| Open view by getting its definition from disk (and table cache in future). More...
|
|
static bool | add_view_place_holder (THD *thd, Table_ref *table_list) |
| Add a dummy LEX object for a view. More...
|
|
static size_t | create_table_def_key (const char *db_name, const char *table_name, char *key) |
| Create a table cache/table definition cache key for a table. More...
|
|
static size_t | create_table_def_key_tmp (const THD *thd, const char *db_name, const char *table_name, char *key) |
| Create a table cache/table definition cache key for a temporary table. More...
|
|
std::string | create_table_def_key_secondary (const char *db_name, const char *table_name) |
| Create a table cache/table definition cache key for a table in a secondary storage engine. More...
|
|
size_t | get_table_def_key (const Table_ref *table_list, const char **key) |
| Get table cache key for a table list element. More...
|
|
bool | table_def_init (void) |
|
void | table_def_start_shutdown (void) |
| Notify table definition cache that process of shutting down server has started so it has to keep number of TABLE and TABLE_SHARE objects minimal in order to reduce number of references to pluggable engines. More...
|
|
void | table_def_free (void) |
|
uint | cached_table_definitions (void) |
|
static TABLE_SHARE * | process_found_table_share (THD *thd, TABLE_SHARE *share, bool open_view) |
|
static bool | read_histograms (THD *thd, TABLE_SHARE *share, const dd::Schema *schema, const dd::Abstract_table *table_def) |
| Read any existing histogram statistics from the data dictionary and store a copy of them in the TABLE_SHARE. More...
|
|
static void | update_schema_options (const dd::Schema *sch_obj, TABLE_SHARE *share) |
| Update TABLE_SHARE with options from dd::Schema object. More...
|
|
TABLE_SHARE * | get_table_share (THD *thd, const char *db, const char *table_name, const char *key, size_t key_length, bool open_view, bool open_secondary) |
| Get the TABLE_SHARE for a table. More...
|
|
static TABLE_SHARE * | get_table_share_with_discover (THD *thd, Table_ref *table_list, const char *key, size_t key_length, bool open_secondary, int *error) |
| Get a table share. More...
|
|
void | release_table_share (TABLE_SHARE *share) |
| Mark that we are not using table share anymore. More...
|
|
TABLE_SHARE * | get_cached_table_share (const char *db, const char *table_name) |
| Get an existing table definition from the table definition cache. More...
|
|
OPEN_TABLE_LIST * | list_open_tables (THD *thd, const char *db, const char *wild) |
|
void | intern_close_table (TABLE *table) |
|
void | free_io_cache (TABLE *table) |
|
bool | close_cached_tables (THD *thd, Table_ref *tables, bool wait_for_refresh, ulong timeout) |
|
static void | mark_temp_tables_as_free_for_reuse (THD *thd) |
| Mark all temporary tables which were used by the current statement or substatement as free for reuse, but only if the query_id can be cleared. More...
|
|
void | mark_tmp_table_for_reuse (TABLE *table) |
| Reset a single temporary table. More...
|
|
static void | mark_used_tables_as_free_for_reuse (THD *thd, TABLE *table) |
|
static void | close_open_tables (THD *thd) |
| Auxiliary function to close all tables in the open_tables list. More...
|
|
static void | close_all_tables_for_name (THD *thd, const char *key, size_t key_length, const char *db, const char *table_name, bool remove_from_locked_tables, TABLE *skip_table) |
| Close all open instances of the table but keep the MDL lock. More...
|
|
void | close_all_tables_for_name (THD *thd, TABLE_SHARE *share, bool remove_from_locked_tables, TABLE *skip_table) |
| Close all open instances of the table but keep the MDL lock. More...
|
|
void | close_all_tables_for_name (THD *thd, const char *db, const char *table_name, bool remove_from_locked_tables) |
| Close all open instances of the table but keep the MDL lock. More...
|
|
static bool | in_LTM (THD *thd) |
|
static bool | belongs_to_dd_table (const Table_ref *tl) |
| Check if the given Table_ref belongs to a DD table. More...
|
|
void | close_thread_tables (THD *thd) |
| Close all tables used by the current substatement, or all tables used by this thread if we are on the outer-most level. More...
|
|
static void | release_or_close_table (THD *thd, TABLE *table) |
| Helper function which returns TABLE to Table Cache or closes if table is marked as needing re-open. More...
|
|
void | close_thread_table (THD *thd, TABLE **table_ptr) |
|
static uint | tmpkeyval (TABLE *table) |
|
bool | close_temporary_tables (THD *thd) |
|
Table_ref * | find_table_in_global_list (Table_ref *table, const char *db_name, const char *table_name) |
| Find table in global list. More...
|
|
static Table_ref * | find_dup_table (const Table_ref *table, Table_ref *table_list, bool check_alias) |
| Test that table is unique (It's only exists once in the table list) More...
|
|
Table_ref * | unique_table (const Table_ref *table, Table_ref *table_list, bool check_alias) |
| Test that the subject table of INSERT/UPDATE/DELETE/CREATE or (in case of MyISAMMRG) one of its children are not used later in the query. More...
|
|
void | update_non_unique_table_error (Table_ref *update, const char *operation, Table_ref *duplicate) |
| Issue correct error message in case we found 2 duplicate tables which prevent some update operation. More...
|
|
TABLE * | find_temporary_table (THD *thd, const char *db, const char *table_name) |
| Find temporary table specified by database and table names in the THD::temporary_tables list. More...
|
|
TABLE * | find_temporary_table (THD *thd, const Table_ref *tl) |
| Find a temporary table specified by Table_ref instance in the THD::temporary_tables list. More...
|
|
void | drop_temporary_table (THD *thd, Table_ref *table_list) |
| Drop a temporary table. More...
|
|
void | close_temporary_table (THD *thd, TABLE *table, bool free_share, bool delete_table) |
|
void | close_temporary (THD *thd, TABLE *table, bool free_share, bool delete_table) |
|
bool | rename_temporary_table (THD *thd, TABLE *table, const char *db, const char *table_name) |
|
bool | wait_while_table_is_used (THD *thd, TABLE *table, enum ha_extra_function function) |
| Force all other threads to stop using the table by upgrading metadata lock on it and remove unused TABLE instances from cache. More...
|
|
static bool | check_if_table_exists (THD *thd, Table_ref *table, bool *exists) |
| Check that table exists in data-dictionary or in some storage engine. More...
|
|
static bool | open_table_get_mdl_lock (THD *thd, Open_table_context *ot_ctx, Table_ref *table_list, uint flags, MDL_ticket **mdl_ticket) |
| Try to acquire an MDL lock for a table being opened. More...
|
|
static bool | tdc_wait_for_old_version (THD *thd, const char *db, const char *table_name, ulong wait_timeout, uint deadlock_weight) |
| Check if table's share is being removed from the table definition cache and, if yes, wait until the flush is complete. More...
|
|
bool | open_table (THD *thd, Table_ref *table_list, Open_table_context *ot_ctx) |
| Open a base table. More...
|
|
TABLE * | find_locked_table (TABLE *list, const char *db, const char *table_name) |
| Find table in the list of open tables. More...
|
|
TABLE * | find_table_for_mdl_upgrade (THD *thd, const char *db, const char *table_name, bool no_error) |
| Find instance of TABLE with upgradable or exclusive metadata lock from the list of open tables, emit error if no such table found. More...
|
|
void | assign_new_table_id (TABLE_SHARE *share) |
|
static bool | check_and_update_routine_version (THD *thd, Sroutine_hash_entry *rt, sp_head *sp) |
| Compares versions of a stored routine obtained from the sp cache and the version used at prepare. More...
|
|
static bool | fix_row_type (THD *thd, Table_ref *table_list) |
| Auxiliary routine for automatically updating row format for the table. More...
|
|
thr_lock_type | read_lock_type_for_table (THD *thd, Query_tables_list *prelocking_ctx, Table_ref *table_list, bool routine_modifies_data) |
|
static void | process_table_fks (THD *thd, Query_tables_list *prelocking_ctx, TABLE_SHARE *share, bool is_insert, bool is_update, bool is_delete, Table_ref *belong_to_view, bool *need_prelocking) |
| Process table's foreign keys (if any) by prelocking algorithm. More...
|
|
static bool | open_and_process_routine (THD *thd, Query_tables_list *prelocking_ctx, Sroutine_hash_entry *rt, Prelocking_strategy *prelocking_strategy, bool has_prelocking_list, Open_table_context *ot_ctx, bool *need_prelocking, bool *routine_modifies_data) |
| Handle element of prelocking set other than table. More...
|
|
static bool | open_and_process_table (THD *thd, LEX *lex, Table_ref *const tables, uint *counter, Prelocking_strategy *prelocking_strategy, bool has_prelocking_list, Open_table_context *ot_ctx) |
| Handle table list element by obtaining metadata lock, opening table or view and, if prelocking strategy prescribes so, extending the prelocking set with tables and routines used by it. More...
|
|
int | run_before_dml_hook (THD *thd) |
| Run the server hook called "before_dml". More...
|
|
static bool | is_temporary_table_being_opened (const Table_ref *table) |
| Check whether a table being opened is a temporary table. More...
|
|
bool | get_and_lock_tablespace_names (THD *thd, Table_ref *tables_start, Table_ref *tables_end, ulong lock_wait_timeout, uint flags) |
| Acquire IX metadata locks on tablespace names used by LOCK TABLES or by a DDL statement. More...
|
|
bool | lock_table_names (THD *thd, Table_ref *tables_start, Table_ref *tables_end, ulong lock_wait_timeout, uint flags, Prealloced_array< MDL_request *, 1 > *schema_reqs) |
| Acquire "strong" (SRO, SNW, SNRW) metadata locks on tables used by LOCK TABLES or by a DDL statement. More...
|
|
static bool | open_tables_check_upgradable_mdl (THD *thd, Table_ref *tables_start, Table_ref *tables_end) |
| Check for upgradable (SNW, SNRW) metadata locks on tables to be opened for a DDL statement. More...
|
|
static bool | acquire_backup_lock_in_lock_tables_mode (THD *thd, Table_ref *tables_start, Table_ref *tables_end) |
| Iterate along a list of tables and acquire BACKUP LOCK in shared mode in case a strong MDL request (DDL/LOCK TABLES-type) was specified for a table. More...
|
|
static bool | set_non_locking_read_for_IS_view (THD *thd, Table_ref *tl) |
| Check if this is a DD table used under a I_S view then request InnoDB to do non-locking reads on the table. More...
|
|
bool | is_acl_table_in_non_LTM (const Table_ref *tl, enum enum_locked_tables_mode ltm) |
| Check if given Table_ref is a acl table and is being read and not in LOCK TABLE mode. More...
|
|
static bool | set_non_locking_read_for_ACL_table (THD *thd, Table_ref *tl, const bool &issue_warning) |
| Check if this is a ACL table is requested for read and then request InnoDB to do non-locking reads on the table. More...
|
|
bool | open_tables (THD *thd, Table_ref **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy) |
| Open all tables in list. More...
|
|
static bool | check_lock_and_start_stmt (THD *thd, Query_tables_list *prelocking_ctx, Table_ref *table_list) |
| Check that lock is ok for tables; Call start stmt if ok. More...
|
|
TABLE * | open_n_lock_single_table (THD *thd, Table_ref *table_l, thr_lock_type lock_type, uint flags, Prelocking_strategy *prelocking_strategy) |
| Open and lock one table. More...
|
|
TABLE * | open_ltable (THD *thd, Table_ref *table_list, thr_lock_type lock_type, uint lock_flags) |
|
bool | open_and_lock_tables (THD *thd, Table_ref *tables, uint flags, Prelocking_strategy *prelocking_strategy) |
| Open all tables in list, locks them and optionally process derived tables. More...
|
|
static bool | open_secondary_engine_tables (THD *thd, uint flags) |
| Check if a secondary engine can be used to execute the current statement, and if so, replace the opened tables with their secondary counterparts. More...
|
|
bool | open_tables_for_query (THD *thd, Table_ref *tables, uint flags) |
| Open all tables for a query or statement, in list started by "tables". More...
|
|
static void | mark_real_tables_as_free_for_reuse (Table_ref *table_list) |
|
bool | lock_tables (THD *thd, Table_ref *tables, uint count, uint flags) |
| Lock all tables in a list. More...
|
|
bool | lock_dictionary_tables (THD *thd, Table_ref *tables, uint count, uint flags) |
| Simplified version of lock_tables() call to be used for locking data-dictionary tables when reading or storing data-dictionary objects. More...
|
|
void | close_tables_for_reopen (THD *thd, Table_ref **tables, const MDL_savepoint &start_of_statement_svp) |
| Prepare statement for reopening of tables and recalculation of set of prelocked tables. More...
|
|
TABLE * | open_table_uncached (THD *thd, const char *path, const char *db, const char *table_name, bool add_to_temporary_tables_list, bool open_in_engine, const dd::Table &table_def) |
| Open a single table without table caching and don't add it to THD::open_tables. More...
|
|
bool | rm_temporary_table (THD *thd, handlerton *base, const char *path, const dd::Table *table_def) |
| Delete a temporary table. More...
|
|
bool | open_temporary_table (THD *thd, Table_ref *tl) |
| Find a temporary table specified by Table_ref instance in the cache and prepare its TABLE instance for use. More...
|
|
bool | open_temporary_tables (THD *thd, Table_ref *tl_list) |
| Pre-open temporary tables corresponding to table list elements. More...
|
|
static bool | find_field_in_view (THD *thd, Table_ref *tr, const char *field_name, const char *alias, Item_ident **ref_field) |
| Find a field by name in a view that uses merge algorithm. More...
|
|
static bool | find_field_in_natural_join (THD *thd, Table_ref *tr, const char *name, const char *alias, Find_field_result *result, Field **base_field, Item_ident **ref_field) |
| Find field by name in a NATURAL/USING join table reference. More...
|
|
Field * | find_field_in_table (TABLE *table, const char *field_name, bool allow_rowid, uint *field_index) |
| Find field by name in a base table. More...
|
|
bool | find_field_in_table_ref (THD *thd, Table_ref *tr, const char *field_name, size_t length, const char *alias, const char *db_name, const char *table_name, Access_bitmask want_privilege, bool allow_rowid, Find_field_result *result, Field **base_field, Item_ident **ref_field) |
| Given a table reference and the name of a field, attempt to find the field in the referenced table. More...
|
|
Field * | find_field_in_table_sef (TABLE *table, const char *field_name) |
| Find field in table, no side effects, only purpose is to check for field in table object and get reference to the field if found. More...
|
|
bool | find_field_in_tables (THD *thd, Item_ident *item, Table_ref *first_table, Table_ref *last_table, int report_error, Access_bitmask want_privilege, Find_field_result *result, Field **base_field, Item_ident **ref_field) |
| Find field in list of tables inside one query block. More...
|
|
bool | find_item_in_list (THD *thd, Item *find, mem_root_deque< Item * > *items, Item ***found, uint *counter, enum_resolution_type *resolution) |
| Find Item in list of items (find_field_in_tables analog) More...
|
|
static bool | test_if_string_in_list (const char *find, List< String > *str_list) |
|
static bool | set_new_item_local_context (THD *thd, Item_ident *item, Table_ref *table_ref) |
|
static bool | mark_common_columns (THD *thd, Table_ref *table_ref_1, Table_ref *table_ref_2, List< String > *using_fields, uint *found_using_fields) |
|
static bool | store_natural_using_join_columns (THD *thd, Table_ref *natural_using_join, Table_ref *table_ref_1, Table_ref *table_ref_2, List< String > *using_fields, uint found_using_fields) |
|
static bool | store_top_level_join_columns (THD *thd, Table_ref *table_ref, Table_ref *left_neighbor, Table_ref *right_neighbor) |
|
bool | setup_natural_join_row_types (THD *thd, mem_root_deque< Table_ref * > *from_clause, Name_resolution_context *context) |
|
bool | resolve_var_assignments (THD *thd, LEX *lex) |
| Resolve variable assignments from LEX object. More...
|
|
bool | setup_fields (THD *thd, Access_bitmask want_privilege, bool allow_sum_func, bool split_sum_funcs, bool column_update, const mem_root_deque< Item * > *typed_items, mem_root_deque< Item * > *fields, Ref_item_array ref_item_array) |
| Resolve a list of expressions and setup appropriate data. More...
|
|
bool | insert_fields (THD *thd, Query_block *query_block, const char *db_name, const char *table_name, mem_root_deque< Item * > *fields, mem_root_deque< Item * >::iterator *it, bool any_privileges) |
|
bool | fill_record (THD *thd, TABLE *table, const mem_root_deque< Item * > &fields, const mem_root_deque< Item * > &values, MY_BITMAP *bitmap, MY_BITMAP *insert_into_fields_bitmap, bool raise_autoinc_has_expl_non_null_val) |
| Fill fields with given items. More...
|
|
static bool | check_record (THD *thd, const mem_root_deque< Item * > &fields) |
| Check the NOT NULL constraint on all the fields of the current record. More...
|
|
bool | check_record (THD *thd, Field **ptr) |
| Check the NOT NULL constraint on all the fields of the current record. More...
|
|
static bool | check_inserting_record (THD *thd, Field **ptr) |
| Check the NOT NULL constraint on all the fields explicitly set in INSERT INTO statement or implicitly set in BEFORE trigger. More...
|
|
bool | invoke_table_check_constraints (THD *thd, const TABLE *table) |
| Invoke check constraints defined on the table. More...
|
|
static bool | command_can_invoke_insert_triggers (enum enum_trigger_event_type event, enum_sql_command sql_command) |
| Check if SQL-statement is INSERT/INSERT SELECT/REPLACE/REPLACE SELECT and trigger event is ON INSERT. More...
|
|
bool | call_before_insert_triggers (THD *thd, TABLE *table, enum enum_trigger_event_type event, MY_BITMAP *insert_into_fields_bitmap) |
| Execute BEFORE INSERT trigger. More...
|
|
bool | fill_record_n_invoke_before_triggers (THD *thd, COPY_INFO *optype_info, const mem_root_deque< Item * > &fields, const mem_root_deque< Item * > &values, TABLE *table, enum enum_trigger_event_type event, int num_fields, bool raise_autoinc_has_expl_non_null_val, bool *is_row_changed) |
| Fill fields in list with values from the list of items and invoke before triggers. More...
|
|
bool | fill_record (THD *thd, TABLE *table, Field **ptr, const mem_root_deque< Item * > &values, MY_BITMAP *bitmap, MY_BITMAP *insert_into_fields_bitmap, bool raise_autoinc_has_expl_non_null_val) |
| Fill field buffer with values from Field list. More...
|
|
bool | fill_record_n_invoke_before_triggers (THD *thd, Field **ptr, const mem_root_deque< Item * > &values, TABLE *table, enum enum_trigger_event_type event, int num_fields) |
| Fill fields in array with values from the list of items and invoke before triggers. More...
|
|
bool | mysql_rm_tmp_tables (void) |
| Drop all temporary tables which have been left from previous server run. More...
|
|
void | tdc_flush_unused_tables () |
|
void | tdc_remove_table (THD *thd, enum_tdc_remove_table_type remove_type, const char *db, const char *table_name, bool has_lock) |
| Remove all or some (depending on parameter) instances of TABLE and TABLE_SHARE from the table definition cache. More...
|
|
int | setup_ftfuncs (const THD *thd, Query_block *query_block) |
|
bool | init_ftfuncs (THD *thd, Query_block *query_block) |
|
bool | open_trans_system_tables_for_read (THD *thd, Table_ref *table_list) |
| Open and lock transactional system tables for read. More...
|
|
void | close_trans_system_tables (THD *thd) |
| Close transactional system tables, opened with open_trans_system_tables_for_read(). More...
|
|
void | close_mysql_tables (THD *thd) |
| A helper function to close a mysql. More...
|
|
TABLE * | open_log_table (THD *thd, Table_ref *one_table, Open_tables_backup *backup) |
| Open a log table. More...
|
|
void | close_log_table (THD *thd, Open_tables_backup *backup) |
| Close a log table. More...
|
|