![]() |
MySQL 8.0.43
Source Code Documentation
|
#include "sql/locking_service.h"#include <string.h>#include <sys/types.h>#include "my_inttypes.h"#include "my_macros.h"#include "my_sys.h"#include "mysql/service_parser.h"#include "mysqld_error.h"#include "sql/current_thd.h"#include "sql/error_handler.h"#include "sql/mdl.h"#include "sql/sql_class.h"#include "sql/sql_error.h"Classes | |
| class | Locking_service_deadlock_error_handler |
| We want to convert ER_LOCK_DEADLOCK error to ER_LOCK_SERVICE_DEADLOCK error. More... | |
| class | Release_all_locking_service_locks |
| class | Release_locking_service_locks |
Functions | |
| static bool | check_lock_name (const char *name) |
| Check if the given name has valid length. More... | |
| int | acquire_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace, const char **lock_names, size_t lock_num, enum_locking_service_lock_type lock_type, Timeout_type lock_timeout) |
| Acquire locking service locks. More... | |
| int | release_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace) |
| Release all lock service locks taken by the given connection in the given namespace. More... | |
| void | release_all_locking_service_locks (THD *thd) |
| Release all locking service locks taken by the given connection in all namespaces. More... | |
| int | mysql_acquire_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace, const char **lock_names, size_t lock_num, enum_locking_service_lock_type lock_type, Timeout_type lock_timeout) |
| int | mysql_release_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace) |
Variables | |
| static const size_t | MAX_LOCKING_SERVICE_LOCK_NAME_LENGTH = 64 |
| int acquire_locking_service_locks | ( | MYSQL_THD | opaque_thd, |
| const char * | lock_namespace, | ||
| const char ** | lock_names, | ||
| size_t | lock_num, | ||
| enum enum_locking_service_lock_type | lock_type, | ||
| Timeout_type | lock_timeout | ||
| ) |
Acquire locking service locks.
| opaque_thd | Thread handle. If NULL, current_thd will be used. |
| lock_namespace | Namespace of the locks to acquire. |
| lock_names | Array of names of the locks to acquire. |
| lock_num | Number of elements in 'lock_names'. |
| lock_type | Lock type to acquire. LOCKING_SERVICE_READ or _WRITE. |
| lock_timeout | Number of seconds to wait before giving up. |
| 1 | Acquisition failed, error has been reported. |
| 0 | Acquisition successful, all locks acquired. |
|
inlinestatic |
Check if the given name has valid length.
| name | Name to check (namespace or lock) |
| true | if invalid, false otherwise. |
| int mysql_acquire_locking_service_locks | ( | MYSQL_THD | opaque_thd, |
| const char * | lock_namespace, | ||
| const char ** | lock_names, | ||
| size_t | lock_num, | ||
| enum_locking_service_lock_type | lock_type, | ||
| Timeout_type | lock_timeout | ||
| ) |
| int mysql_release_locking_service_locks | ( | MYSQL_THD | opaque_thd, |
| const char * | lock_namespace | ||
| ) |
| void release_all_locking_service_locks | ( | THD * | thd | ) |
Release all locking service locks taken by the given connection in all namespaces.
| thd | Thread handle. |
| int release_locking_service_locks | ( | MYSQL_THD | opaque_thd, |
| const char * | lock_namespace | ||
| ) |
Release all lock service locks taken by the given connection in the given namespace.
| opaque_thd | Thread handle. If NULL, current_thd will be used. |
| lock_namespace | Namespace of the locks to release. |
| 1 | Release failed, error has been reported. |
| 0 | Release successful, all locks acquired. |
|
static |