My Project
Public Member Functions | Static Public Member Functions | Public Attributes
MDL_request Class Reference

#include <mdl.h>

List of all members.

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_requestoperator= (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_requestnext_in_list
MDL_request ** prev_in_list
MDL_ticketticket
MDL_key key

Detailed Description

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.


Member Function Documentation

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_namespaceId of namespace of object to be locked
dbName of database to which the object belongs
nameName of of the object
mdl_typeThe 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.

See also:
MDL_request::init(namespace, db, name, type).
Parameters:
key_argThe pre-built MDL key for the request.
mdl_type_argThe 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.


Member Data Documentation

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines