MySQL 8.0.39
Source Code Documentation
sql_backup_lock.cc File Reference
#include "sql_backup_lock.h"
#include <utility>
#include "m_string.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysqld_error.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/mdl.h"
#include "sql/system_variables.h"
#include "sql_class.h"

Classes

class  Release_all_backup_locks
 MDL_release_locks_visitor subclass to release MDL for BACKUP_LOCK. More...
 

Functions

static bool check_backup_admin_privilege (THD *thd)
 Check if a current user has the privilege BACKUP_ADMIN required to run the statement LOCK INSTANCE FOR BACKUP. More...
 
static bool acquire_mdl_for_backup (THD *thd, enum_mdl_type mdl_type, enum_mdl_duration mdl_duration, ulong lock_wait_timeout)
 Acquire either exclusive or shared Backup Lock. More...
 
void release_backup_lock (THD *thd)
 Release Backup Lock if it was acquired. More...
 
bool acquire_exclusive_backup_lock (THD *thd, ulong lock_wait_timeout, bool for_trx)
 
bool acquire_shared_backup_lock (THD *thd, ulong lock_wait_timeout, bool for_trx)
 

Function Documentation

◆ acquire_exclusive_backup_lock()

bool acquire_exclusive_backup_lock ( THD thd,
ulong  lock_wait_timeout,
bool  for_trx 
)

◆ acquire_mdl_for_backup()

static bool acquire_mdl_for_backup ( THD thd,
enum_mdl_type  mdl_type,
enum_mdl_duration  mdl_duration,
ulong  lock_wait_timeout 
)
static

Acquire either exclusive or shared Backup Lock.

Parameters
[in]thdCurrent thread context
[in]mdl_typeType of metadata lock to acquire for backup
[in]mdl_durationDuration of metadata lock
[in]lock_wait_timeoutHow many seconds to wait before timeout.
Returns
Operation status.
Return values
falseSuccess
trueFailure

◆ acquire_shared_backup_lock()

bool acquire_shared_backup_lock ( THD thd,
ulong  lock_wait_timeout,
bool  for_trx 
)

◆ check_backup_admin_privilege()

static bool check_backup_admin_privilege ( THD thd)
static

Check if a current user has the privilege BACKUP_ADMIN required to run the statement LOCK INSTANCE FOR BACKUP.

Parameters
thdCurrent thread
Return values
falseA user has the privilege BACKUP_ADMIN
trueA user doesn't have the privilege BACKUP_ADMIN

◆ release_backup_lock()

void release_backup_lock ( THD thd)

Release Backup Lock if it was acquired.

Parameters
[in]thdCurrent thread context