1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Add functions that retrieve some lock_t characteristics, needed in

INFORMATION_SCHEMA implementation:

lock_get_trx_id()
lock_get_mode_str()
lock_get_type_str()
lock_get_table_id()
lock_get_table_name()
lock_rec_get_index_name()
lock_rec_get_space_id()
lock_rec_get_page_no()

Approved by:	Marko
This commit is contained in:
vasil
2007-09-03 12:16:11 +00:00
parent 9d65ac4ca4
commit 8393a88e43
2 changed files with 229 additions and 0 deletions

View File

@@ -674,6 +674,82 @@ lock_number_of_rows_locked(
/*=======================*/
trx_t* trx); /* in: transaction */
/***********************************************************************
Gets the id of the transaction owning a lock. */
ullint
lock_get_trx_id(
/*============*/
/* out: transaction id */
const lock_t* lock); /* in: lock */
/***********************************************************************
Gets the mode of a lock in a human readable string.
The string should not be free()'d or modified. */
const char*
lock_get_mode_str(
/*==============*/
/* out: lock mode */
const lock_t* lock); /* in: lock */
/***********************************************************************
Gets the type of a lock in a human readable string.
The string should not be free()'d or modified. */
const char*
lock_get_type_str(
/*==============*/
/* out: lock type */
const lock_t* lock); /* in: lock */
/***********************************************************************
Gets the id of the table on which the lock is. */
ullint
lock_get_table_id(
/*==============*/
/* out: id of the table */
const lock_t* lock); /* in: lock */
/***********************************************************************
Gets the name of the table on which the lock is.
The string should not be free()'d or modified. */
const char*
lock_get_table_name(
/*================*/
/* out: name of the table */
const lock_t* lock); /* in: lock */
/***********************************************************************
For a record lock, gets the name of the index on which the lock is.
The string should not be free()'d or modified. */
const char*
lock_rec_get_index_name(
/*====================*/
/* out: name of the index */
const lock_t* lock); /* in: lock */
/***********************************************************************
For a record lock, gets the tablespace number on which the lock is. */
ulint
lock_rec_get_space_id(
/*==================*/
/* out: tablespace number */
const lock_t* lock); /* in: lock */
/***********************************************************************
For a record lock, gets the page number on which the lock is. */
ulint
lock_rec_get_page_no(
/*=================*/
/* out: page number */
const lock_t* lock); /* in: lock */
/* The lock system */
extern lock_sys_t* lock_sys;