MySQL 8.4.3
Source Code Documentation
|
Typedefs | |
typedef std::pair< dd::String_type, bool > | Path_type |
Instantiation of std::pair to represent the full path to an sdi file. More... | |
typedef Prealloced_array< Path_type, 3 > | Paths_type |
Typedef for container type to use as out-parameter when expanding sdi file patterns into paths. More... | |
Functions | |
String_type | sdi_filename (Object_id id, const String_type &entity_name, const String_type &schema) |
Formats an sdi filename according to the mysql conventions for an entity name and schema name, where the schema may be "". More... | |
bool | store_tbl_sdi (const Sdi_type &sdi, const dd::Table &table, const dd::Schema &schema) |
Stores sdi for table in a file. More... | |
bool | remove (const String_type &fname) |
Remove a file name from the file system. More... | |
static bool | remove_sdi_file_if_exists (const String_type &fname) |
bool | drop_tbl_sdi (const dd::Table &table, const dd::Schema &schema) |
Removes sdi file for a table. More... | |
bool | load (THD *thd, const dd::String_type &fname, dd::String_type *buf) |
Read an sdi file from disk and store in a buffer. More... | |
bool | expand_pattern (THD *thd, const MYSQL_LEX_STRING &pattern, Paths_type *paths) |
Expand an sdi filename pattern into the set of full paths that match. More... | |
template<typename CLOS > | |
bool | with_str_error (CLOS &&clos) |
bool | check_data_files_exist (const dd::String_type &schema_name, const dd::String_type &table_name) |
Check that the MYD and MYI files for table exists. More... | |
Variables | |
const size_t | FILENAME_PREFIX_CHARS = 16 |
Number of character (not bytes) of a tablename which will contrubute to the sdi file name. More... | |
const String_type | EXT = ".sdi" |
File name extension for sdi files. More... | |
typedef std::pair<dd::String_type, bool> dd::sdi_file::Path_type |
Instantiation of std::pair to represent the full path to an sdi file.
Member first is the path, second is true if the path is inside datadir, false otherwise.
typedef Prealloced_array<Path_type, 3> dd::sdi_file::Paths_type |
Typedef for container type to use as out-parameter when expanding sdi file patterns into paths.
bool dd::sdi_file::check_data_files_exist | ( | const dd::String_type & | schema_name, |
const dd::String_type & | table_name | ||
) |
Check that the MYD and MYI files for table exists.
schema_name | schema name |
table_name | table name |
true | if an error occurs |
false | otherwise |
bool dd::sdi_file::drop_tbl_sdi | ( | const dd::Table & | table, |
const dd::Schema & | schema | ||
) |
Removes sdi file for a table.
table | dd object for which to remove sdi |
schema | object which table belongs to |
true | if an error occurs |
false | otherwise |
bool dd::sdi_file::expand_pattern | ( | THD * | thd, |
const MYSQL_LEX_STRING & | pattern, | ||
Paths_type * | paths | ||
) |
Expand an sdi filename pattern into the set of full paths that match.
The paths and a bool indicating if the path is inside data dir is appended to the Paths_type collection provided as argument.
thd | thread handle |
pattern | filenam pattern to expand |
paths | collection of expanded file paths |
true | if an error occurs |
false | otherwise |
bool dd::sdi_file::load | ( | THD * | thd, |
const dd::String_type & | fname, | ||
dd::String_type * | buf | ||
) |
Read an sdi file from disk and store in a buffer.
thd | thread handle |
fname | path to sdi file to load |
buf | where to store file content |
true | if an error occurs |
false | otherwise |
bool dd::sdi_file::remove | ( | const String_type & | fname | ) |
Remove a file name from the file system.
fname | file name to remove from file system. |
true | if an error occurs |
false | otherwise |
|
static |
String_type dd::sdi_file::sdi_filename | ( | Object_id | id, |
const String_type & | entity_name, | ||
const String_type & | schema | ||
) |
Formats an sdi filename according to the mysql conventions for an entity name and schema name, where the schema may be "".
id | object id if dd object |
entity_name | name (as returned by dd::Entity_object::name()) of dd object. |
schema | name of schema, or "" for schemaless entities (schemata). |
filename | to use for sdi file |
bool dd::sdi_file::store_tbl_sdi | ( | const Sdi_type & | sdi, |
const dd::Table & | table, | ||
const dd::Schema & | schema | ||
) |
Stores sdi for table in a file.
sdi | json string to store |
table | dd object from which sdi was generated |
schema | object which table belongs to |
true | if an error occurs |
false | otherwise |
bool dd::sdi_file::with_str_error | ( | CLOS && | clos | ) |
const String_type dd::sdi_file::EXT = ".sdi" |
File name extension for sdi files.
const size_t dd::sdi_file::FILENAME_PREFIX_CHARS = 16 |
Number of character (not bytes) of a tablename which will contrubute to the sdi file name.
The whole name is not needed as the Object_id is added so that uniqueness is ensured