MySQL 9.1.0
Source Code Documentation
|
For locks with EXPLICIT duration, MDL returns a new ticket every time a lock is granted. More...
Public Attributes | |
MDL_ticket * | ticket |
uint | refs |
For locks with EXPLICIT duration, MDL returns a new ticket every time a lock is granted.
This allows to implement recursive locks without extra allocation or additional data structures, such as below. However, if there are too many tickets in the same MDL_context, MDL_context::find_ticket() is getting too slow, since it's using a linear search. This is why a separate structure is allocated for a user level lock held by connection, and before requesting a new lock from MDL, GET_LOCK() checks thd->ull_hash if such lock is already granted, and if so, simply increments a reference counter.
uint User_level_lock::refs |
MDL_ticket* User_level_lock::ticket |