A pending metadata lock request.
A lock request and a granted metadata lock are represented by different classes because they have different allocation sites and hence different lifetimes. The allocation of lock requests is controlled from outside of the MDL subsystem, while allocation of granted locks (tickets) is controlled within the MDL subsystem.
MDL_request is a C structure, you don't need to call a constructor or destructor for it.
Definition at line 418 of file mdl.h.
void MDL_request::init |
( |
MDL_key::enum_mdl_namespace |
mdl_namespace, |
|
|
const char * |
db_arg, |
|
|
const char * |
name_arg, |
|
|
enum_mdl_type |
mdl_type_arg, |
|
|
enum_mdl_duration |
mdl_duration_arg |
|
) |
| |
Initialize a lock request.
This is to be used for every lock request.
Note that initialization and allocation are split into two calls. This is to allow flexible memory management of lock requests. Normally a lock request is stored in statement memory (e.g. is a member of struct TABLE_LIST), but we would also like to allow allocation of lock requests in other memory roots, for example in the grant subsystem, to lock privilege tables.
The MDL subsystem does not own or manage memory of lock requests.
- Parameters
-
mdl_namespace | Id of namespace of object to be locked |
db | Name of database to which the object belongs |
name | Name of of the object |
mdl_type | The MDL lock type for the request. |
Definition at line 1109 of file mdl.cc.