PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5
TheINNODB_LOCKS table provides information about each lock that anInnoDB transaction has requested but not yet acquired, and each lock that a transaction holds that is blocking another transaction.
This table is deprecated as of MySQL 5.7.14 and is removed in MySQL 8.0.
TheINNODB_LOCKS table has these columns:
LOCK_IDA unique lock ID number, internal to
InnoDB. Treat it as an opaque string. AlthoughLOCK_IDcurrently containsTRX_ID, the format of the data inLOCK_IDis subject to change at any time. Do not write applications that parse theLOCK_IDvalue.LOCK_TRX_IDThe ID of the transaction holding the lock. To obtain details about the transaction, join this column with the
TRX_IDcolumn of theINNODB_TRXtable.LOCK_MODEHow the lock is requested. Permitted lock mode descriptors are
S,X,IS,IX,GAP,AUTO_INC, andUNKNOWN. Lock mode descriptors may be used in combination to identify particular lock modes. For information aboutInnoDBlock modes, seeSection 14.7.1, “InnoDB Locking”.LOCK_TYPEThe type of lock. Permitted values are
RECORDfor a row-level lock,TABLEfor a table-level lock.LOCK_TABLEThe name of the table that has been locked or contains locked records.
LOCK_INDEXThe name of the index, if
LOCK_TYPEisRECORD; otherwiseNULL.LOCK_SPACEThe tablespace ID of the locked record, if
LOCK_TYPEisRECORD; otherwiseNULL.LOCK_PAGEThe page number of the locked record, if
LOCK_TYPEisRECORD; otherwiseNULL.LOCK_RECThe heap number of the locked record within the page, if
LOCK_TYPEisRECORD; otherwiseNULL.LOCK_DATAThe data associated with the lock, if any. A value is shown if the
LOCK_TYPEisRECORD, otherwise the value isNULL. Primary key values of the locked record are shown for a lock placed on the primary key index. Secondary index values of the locked record are shown for a lock placed on a unique secondary index. Secondary index values are shown with primary key values appended if the secondary index is not unique. If there is no primary key,LOCK_DATAshows either the key values of a selected unique index or the uniqueInnoDBinternal row ID number, according to the rules governingInnoDBclustered index use (seeSection 14.6.2.1, “Clustered and Secondary Indexes”).LOCK_DATAreports“supremum pseudo-record” for a lock taken on a supremum pseudo-record. If the page containing the locked record is not in the buffer pool because it was written to disk while the lock was held,InnoDBdoes not fetch the page from disk. Instead,LOCK_DATAreportsNULL.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS\G*************************** 1. row *************************** lock_id: 3723:72:3:2lock_trx_id: 3723 lock_mode: X lock_type: RECORD lock_table: `mysql`.`t` lock_index: PRIMARY lock_space: 72 lock_page: 3 lock_rec: 2 lock_data: 1, 9*************************** 2. row *************************** lock_id: 3722:72:3:2lock_trx_id: 3722 lock_mode: S lock_type: RECORD lock_table: `mysql`.`t` lock_index: PRIMARY lock_space: 72 lock_page: 3 lock_rec: 2 lock_data: 1, 9Notes
Use this table to help diagnose performance problems that occur during times of heavy concurrent load. Its contents are updated as described inSection 14.16.2.3, “Persistence and Consistency of InnoDB Transaction and Locking Information”.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For usage information, seeSection 14.16.2.1, “Using InnoDB Transaction and Locking Information”.
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5