|
const uchar * | ptr () const |
|
uint | length () const |
|
const char * | db_name () const |
|
uint | db_name_length () const |
|
const char * | name () const |
|
uint | name_length () const |
|
const char * | col_name () const |
|
uint | col_name_length () const |
|
enum_mdl_namespace | mdl_namespace () const |
|
void | mdl_key_init (enum_mdl_namespace mdl_namespace, const char *db, const char *name) |
| Construct a metadata lock key from a triplet (mdl_namespace, database and name). More...
|
|
void | mdl_key_init (enum_mdl_namespace mdl_namespace, const char *db, const char *name, const char *column_name) |
| Construct a metadata lock key from a quadruplet (mdl_namespace, database, table and column name). More...
|
|
void | mdl_key_init (enum_mdl_namespace mdl_namespace, const char *db, const char *normalized_name, size_t normalized_name_len, const char *name) |
| Construct a metadata lock key from a quadruplet (mdl_namespace, database, normalized object name buffer and the object name). More...
|
|
void | mdl_key_init (enum_mdl_namespace mdl_namespace, const char *part_key, size_t part_key_length, size_t db_length) |
| Construct a metadata lock key from namespace and partial key, which contains info about object database and name. More...
|
|
void | mdl_key_init (const MDL_key *rhs) |
|
void | reset () |
|
bool | is_equal (const MDL_key *rhs) const |
|
int | cmp (const MDL_key *rhs) const |
| Compare two MDL keys lexicographically. More...
|
|
| MDL_key (const MDL_key &rhs) |
|
MDL_key & | operator= (const MDL_key &rhs) |
|
| MDL_key (enum_mdl_namespace namespace_arg, const char *db_arg, const char *name_arg) |
|
| MDL_key ()=default |
|
const PSI_stage_info * | get_wait_state_name () const |
| Get thread state name to be used in case when we have to wait on resource identified by key. More...
|
|
Metadata lock object key.
A lock is requested or granted based on a fully qualified name and type. E.g. They key for a table consists of <0 (=table)>+<database>+<table name>. Elsewhere in the comments this triple will be referred to simply as "key" or "name".
void MDL_key::mdl_key_init |
( |
enum_mdl_namespace |
mdl_namespace, |
|
|
const char * |
db, |
|
|
const char * |
normalized_name, |
|
|
size_t |
normalized_name_len, |
|
|
const char * |
name |
|
) |
| |
|
inline |
Construct a metadata lock key from a quadruplet (mdl_namespace, database, normalized object name buffer and the object name).
Routine, Event and Resource group names are case sensitive and accent sensitive. So normalized object name is used to form a MDL_key.
With the UTF8MB3 charset space reserved for the db name/object name is 64 * 3 bytes. utf8mb3_general_ci collation is used for the Routine, Event and Resource group names. With this collation, the normalized object name uses just 2 bytes for each character (max length = 64 * 2 bytes). MDL_key has still some space to store the object names. If there is a sufficient space for the object name in the MDL_key then it is stored in the MDL_key (similar to the column names in the MDL_key). Actual object name is used by the PFS. Not listing actual object name from the PFS should be OK when there is no space to store it (instead of increasing the MDL_key size). Object name is not used in the key comparisons. So only (mdl_namespace + strlen(db) + 1 + normalized_name_len + 1) value is stored in the m_length member.
- Parameters
-
mdl_namespace | Id of namespace of object to be locked. |
db | Name of database to which the object belongs. |
normalized_name | Normalized name of the object. |
normalized_name_len | Length of the normalized object name. |
name | Name of the object. |