MySQL 8.4.3
Source Code Documentation
sql_tablespace.cc File Reference
#include "sql/sql_tablespace.h"
#include <string.h>
#include <memory>
#include <string>
#include <utility>
#include "my_base.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_sys.h"
#include "mysql/strings/m_ctype.h"
#include "mysql_com.h"
#include "mysqld.h"
#include "mysqld_error.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/dd/cache/dictionary_client.h"
#include "sql/dd/dd.h"
#include "sql/dd/dd_kill_immunizer.h"
#include "sql/dd/dd_table.h"
#include "sql/dd/impl/sdi_utils.h"
#include "sql/dd/properties.h"
#include "sql/dd/string_type.h"
#include "sql/dd/types/table.h"
#include "sql/dd/types/tablespace.h"
#include "sql/dd/types/tablespace_file.h"
#include "sql/debug_sync.h"
#include "sql/derror.h"
#include "sql/handler.h"
#include "sql/item_strfunc.h"
#include "sql/mdl.h"
#include "sql/parse_tree_helpers.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_error.h"
#include "sql/sql_plugin_ref.h"
#include "sql/sql_table.h"
#include "sql/strfunc.h"
#include "sql/system_variables.h"
#include "sql/thd_raii.h"
#include "sql/transaction.h"

Classes

class  anonymous_namespace{sql_tablespace.cc}::Rollback_guard
 

Namespaces

namespace  anonymous_namespace{sql_tablespace.cc}
 

Typedefs

template<typename T >
using anonymous_namespace{sql_tablespace.cc}::Mod_pair = std::pair< const T *, T * >
 
typedef std::vector< Mod_pair< dd::Table > > anonymous_namespace{sql_tablespace.cc}::Table_pair_list
 

Enumerations

enum class  anonymous_namespace{sql_tablespace.cc}::Tablespace_engine_clause { anonymous_namespace{sql_tablespace.cc}::allowed , anonymous_namespace{sql_tablespace.cc}::invalid }
 

Functions

template<typename LEXSTR >
bool anonymous_namespace{sql_tablespace.cc}::validate_tspnamelen (const LEXSTR &name)
 
bool validate_tablespace_name_length (const char *tablespace_name)
 Check if tablespace name has valid length. More...
 
bool validate_tablespace_name (ts_command_type ts_cmd, const char *tablespace_name, const handlerton *engine)
 Check if a tablespace name is valid. More...
 
template<typename DISABLE_ROLLBACK >
bool anonymous_namespace{sql_tablespace.cc}::complete_stmt (THD *thd, handlerton *hton, DISABLE_ROLLBACK &&dr, bool using_trans=true, bool dont_write_to_binlog=false)
 
bool anonymous_namespace{sql_tablespace.cc}::lock_rec (THD *thd, MDL_request_list *rlst, const LEX_STRING &tsp)
 
template<typename... Names>
bool anonymous_namespace{sql_tablespace.cc}::lock_rec (THD *thd, MDL_request_list *rlst, const LEX_STRING &tsp, Names... names)
 
template<typename... Names>
bool anonymous_namespace{sql_tablespace.cc}::lock_tablespace_names (THD *thd, Names... names)
 
template<typename T >
Mod_pair< T > anonymous_namespace{sql_tablespace.cc}::get_mod_pair (dd::cache::Dictionary_client *dcp, const dd::String_type &name)
 
template<typename T >
Mod_pair< T > anonymous_namespace{sql_tablespace.cc}::get_mod_pair (dd::cache::Dictionary_client *dcp, const dd::String_type &sch_name, const dd::String_type &name)
 
const char * anonymous_namespace{sql_tablespace.cc}::real_engine_name (THD *thd, const LEX_CSTRING &alias)
 
bool anonymous_namespace{sql_tablespace.cc}::get_stmt_hton (THD *thd, const LEX_CSTRING &engine, const char *object_name, const char *statement, handlerton **htonp)
 
bool anonymous_namespace{sql_tablespace.cc}::get_dd_hton (THD *thd, const dd::String_type &dd_engine, const LEX_CSTRING &stmt_engine, const char *tblspc, const char *stmt, handlerton **htonp, Tablespace_engine_clause engine_clause)
 
bool anonymous_namespace{sql_tablespace.cc}::intermediate_commit_unless_atomic_ddl (THD *thd, handlerton *hton)
 
bool anonymous_namespace{sql_tablespace.cc}::map_errors (int se_error, const char *statement_txt, const st_alter_tablespace *ts_info)
 
static bool set_table_encryption_type (THD *thd, const dd::Tablespace &ts, dd::Tablespace_table_ref_vec *trefs, Table_pair_list *tpl, const LEX_STRING &requested_encryption, MDL_request_list *table_mdl_reqs)
 
static bool upgrade_lock_for_tables_in_tablespace (THD *thd, MDL_request_list *table_mdl_reqs)
 

Function Documentation

◆ set_table_encryption_type()

static bool set_table_encryption_type ( THD thd,
const dd::Tablespace ts,
dd::Tablespace_table_ref_vec trefs,
Table_pair_list *  tpl,
const LEX_STRING requested_encryption,
MDL_request_list table_mdl_reqs 
)
static

◆ upgrade_lock_for_tables_in_tablespace()

static bool upgrade_lock_for_tables_in_tablespace ( THD thd,
MDL_request_list table_mdl_reqs 
)
static

◆ validate_tablespace_name()

bool validate_tablespace_name ( ts_command_type  ts_cmd,
const char *  tablespace_name,
const handlerton engine 
)

Check if a tablespace name is valid.

SE specific validation is done by the SE by invoking a handlerton method.

Parameters
ts_cmdWhether this is tablespace DDL or not.
tablespace_nameName of the tablespace
engineHandlerton for the tablespace.
Return values
falseNo error encountered while checking the name.
trueError encountered and reported.

◆ validate_tablespace_name_length()

bool validate_tablespace_name_length ( const char *  tablespace_name)

Check if tablespace name has valid length.

Parameters
tablespace_nameName of the tablespace
Note
Tablespace names are not reflected in the file system, so character case conversion or consideration is not relevant.
Checking for path characters or ending space is not done. The checks are for identifier length, both in terms of number of characters and number of bytes.
Return values
falseNo error encountered while checking length.
trueError encountered and reported.