MySQL 8.0.40
Source Code Documentation
|
#include "sql/sql_handler.h"
#include <limits.h>
#include <string.h>
#include <sys/types.h>
#include <memory>
#include <new>
#include <unordered_map>
#include <utility>
#include "lex_string.h"
#include "m_ctype.h"
#include "m_string.h"
#include "map_helpers.h"
#include "my_bitmap.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_loglevel.h"
#include "my_pointer_arithmetic.h"
#include "my_sys.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysqld_error.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/dd/types/abstract_table.h"
#include "sql/error_handler.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/key.h"
#include "sql/lock.h"
#include "sql/mdl.h"
#include "sql/protocol.h"
#include "sql/psi_memory_key.h"
#include "sql/sql_audit.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/thd_raii.h"
#include "sql/transaction.h"
#include "sql/transaction_info.h"
#include "sql/xa.h"
#include "sql_string.h"
#include "typelib.h"
Macros | |
#define | HANDLER_TABLES_HASH_SIZE 120 |
Functions | |
static bool | mysql_ha_open_table (THD *thd, Table_ref *hash_tables) |
Auxiliary function which opens or re-opens table for HANDLER statements. More... | |
static void | mysql_ha_close_table (THD *thd, Table_ref *tables) |
Close a HANDLER table. More... | |
static Table_ref * | mysql_ha_find (THD *thd, Table_ref *tables) |
Scan the handler tables hash for matching tables. More... | |
void | mysql_ha_rm_tables (THD *thd, Table_ref *tables) |
Remove matching tables from the HANDLER's hash table. More... | |
void | mysql_ha_flush_tables (THD *thd, Table_ref *all_tables) |
Close cursors of matching tables from the HANDLER's hash table. More... | |
void | mysql_ha_flush_table (THD *thd, const char *db_name, const char *table_name) |
Close cursors on the table from the HANDLER's hash. More... | |
void | mysql_ha_flush (THD *thd) |
Flush (close and mark for re-open) all tables that should be should be reopen. More... | |
void | mysql_ha_rm_temporary_tables (THD *thd) |
Remove temporary tables from the HANDLER's hash table. More... | |
void | mysql_ha_cleanup (THD *thd) |
Close all HANDLER's tables. More... | |
void | mysql_ha_set_explicit_lock_duration (THD *thd) |
Set explicit duration for metadata locks corresponding to open HANDLERs to protect them from being released at the end of transaction. More... | |
Variables | |
static enum_ha_read_modes | rkey_to_rnext [] |
#define HANDLER_TABLES_HASH_SIZE 120 |
void mysql_ha_cleanup | ( | THD * | thd | ) |
Close all HANDLER's tables.
thd | Thread identifier. |
Close a HANDLER table.
thd | Thread identifier. |
tables | A list of tables with the first entry to close. |
Scan the handler tables hash for matching tables.
thd | Thread identifier. |
tables | The list of tables to remove. |
void mysql_ha_flush | ( | THD * | thd | ) |
Flush (close and mark for re-open) all tables that should be should be reopen.
thd | Thread identifier. |
void mysql_ha_flush_table | ( | THD * | thd, |
const char * | db_name, | ||
const char * | table_name | ||
) |
Close cursors on the table from the HANDLER's hash.
thd | Thread context. |
db_name | Database name for the table. |
table_name | Table name. |
Close cursors of matching tables from the HANDLER's hash table.
thd | Thread identifier. |
all_tables | The list of tables to flush. |
Auxiliary function which opens or re-opens table for HANDLER statements.
thd | Thread context.. |
hash_tables | Table list element for table to open. |
false | - Success. |
true | - Failure. |
Remove matching tables from the HANDLER's hash table.
thd | Thread identifier. |
tables | The list of tables to remove. |
void mysql_ha_rm_temporary_tables | ( | THD * | thd | ) |
Remove temporary tables from the HANDLER's hash table.
The reason for having a separate function, rather than calling mysql_ha_rm_tables() is that it is not always feasible (e.g. in close_temporary_tables) to obtain a Table_ref containing the temporary tables.
thd | Thread identifier. |
void mysql_ha_set_explicit_lock_duration | ( | THD * | thd | ) |
Set explicit duration for metadata locks corresponding to open HANDLERs to protect them from being released at the end of transaction.
thd | Thread identifier. |
|
static |