24#ifndef DD_SDI_API_INCLUDED
25#define DD_SDI_API_INCLUDED
A pending metadata lock request.
Definition: mdl.h:802
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: partition.h:51
State and operations for importing an sdi file into the DD.
Definition: sdi_api.h:43
Import_target(String_type &&path, bool in_datadir)
Creates an instance to handle the import of a single sdi file.
Definition: sdi_api.cc:61
Import_target(Import_target &&)=default
Having a unique_ptr as member makes this a move-only type.
const dd::String_type * can_table_name() const
Obtains the canonical table name for use with MDL and privilege-checking.
Definition: sdi_api.cc:82
dd::String_type m_path
Full path to the sdi file being imported.
Definition: sdi_api.h:45
dd::String_type m_tmp_sdi_filename
Temporary name for sdi files in data dir when import is ongoing.
Definition: sdi_api.h:51
Import_target(const Import_target &)=delete
std::unique_ptr< dd::String_type > m_lc_sname
Lower-case representation of schema name if lower_case_table_names==2, nullptr otherwise.
Definition: sdi_api.h:69
bool m_in_datadir
True if path points inside data dir.
Definition: sdi_api.h:48
bool load(THD *thd, String_type *shared_buffer)
Reads the sdi file from disk and dserializes it into a Table object and its schema name,...
Definition: sdi_api.cc:90
bool rollback() const
Restore old state by renaming tmp sdi file back to its original name when importing from sdi file in ...
Definition: sdi_api.cc:76
bool commit() const
Finish import by removing tmp sdi file when importing from sdi file in datadir.
Definition: sdi_api.cc:66
std::unique_ptr< dd::String_type > m_lc_tname
Lower-case representation of table name if lower_case_table_names==2, nullptr otherwise.
Definition: sdi_api.h:63
bool store_in_dd(THD *thd) const
Update the schema reference in the Table object and store it in the DD so that it becomes visible.
Definition: sdi_api.cc:145
Table_ref make_table_ref() const
Constructs a Table_ref object with info from this Import_target.
Definition: sdi_api.cc:136
std::unique_ptr< dd::Table > m_table_object
Table object which the sdi will be deserialized into.
Definition: sdi_api.h:54
const dd::String_type * can_schema_name() const
Obtains the canonical schema name for use with MDL and privilege-checking.
Definition: sdi_api.cc:86
dd::String_type m_schema_name_in_sdi
Schema name found in sdi.
Definition: sdi_api.h:57
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
bool drop_all_for_table(THD *thd, const Table *tp)
Drop all SDIs from all tablespaces associated with table.
Definition: sdi.cc:685
bool drop_all_for_part(THD *thd, const Partition *pp)
Drop all SDIs from all tablespaces associated with partition or sub-partition.
Definition: sdi.cc:689
static char * path
Definition: mysqldump.cc:149
bool check_privileges(THD *thd, const Import_target &t)
Check that we have the the necessary privileges to import this table.
Definition: sdi_api.cc:214
MDL_request * mdl_request(const Import_target &t, MEM_ROOT *mem_root)
Creates an MDL_request for exclusive MDL on the table being imported.
Definition: sdi_api.cc:247
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83