My Project
|
#include <mdl.h>
Public Member Functions | |
void | init (MDL_key::enum_mdl_namespace namespace_arg, const char *db_arg, const char *name_arg, enum_mdl_type mdl_type_arg, enum_mdl_duration mdl_duration_arg) |
void | init (const MDL_key *key_arg, enum_mdl_type mdl_type_arg, enum_mdl_duration mdl_duration_arg) |
void | set_type (enum_mdl_type type_arg) |
MDL_request & | operator= (const MDL_request &rhs) |
MDL_request (const MDL_request *rhs) | |
Static Public Member Functions | |
static void * | operator new (size_t size, MEM_ROOT *mem_root) throw () |
static void | operator delete (void *ptr, MEM_ROOT *mem_root) |
Public Attributes | |
enum enum_mdl_type | type |
enum enum_mdl_duration | duration |
MDL_request * | next_in_list |
MDL_request ** | prev_in_list |
MDL_ticket * | ticket |
MDL_key | key |
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.
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.
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. |
void MDL_request::init | ( | const MDL_key * | key_arg, |
enum_mdl_type | mdl_type_arg, | ||
enum_mdl_duration | mdl_duration_arg | ||
) |
Initialize a lock request using pre-built MDL_key.
key_arg | The pre-built MDL key for the request. |
mdl_type_arg | The MDL lock type for the request. |
void MDL_request::set_type | ( | enum_mdl_type | type_arg | ) | [inline] |
Set type of lock request. Can be only applied to pending locks.
enum enum_mdl_duration MDL_request::duration |
Duration for requested lock.
A lock is requested based on a fully qualified name and type.
Pointers for participating in the list of lock requests for this context.
Pointer to the lock ticket object for this lock request. Valid only if this lock request is satisfied.
enum enum_mdl_type MDL_request::type |
Type of metadata lock.