Pre-General Availability Draft: 2017-07-17
The INNODB_LOCKS table contains
information about each lock that an InnoDB
transaction has requested but not yet acquired, and each lock that
a transaction holds that is blocking another transaction.
This table is deprecated and is removed as of MySQL 8.0.1. Use
the Performance Schema data_locks
table instead. See Section 25.11.12.1, “The data_locks Table”.
Differences between INNODB_LOCKS
and data_locks:
If a transaction holds a lock,
INNODB_LOCKSdisplays the lock only if another transaction is waiting for it.data_locksdisplays the lock regardless of whether any transaction is waiting for it.The
data_lockstable has no columns corresponding toLOCK_SPACE,LOCK_PAGE, orLOCK_REC.The
INNODB_LOCKStable requires the globalPROCESSprivilege. Thedata_lockstable requires the usual Performance Schema privilege ofSELECTon the table to be selected from.
The following table shows the mapping from
INNODB_LOCKS columns to
data_locks columns. Use this
information to migrate applications from one table to the other.
Table 24.14 Mapping from INNODB_LOCKS to data_locks Columns
| INNODB_LOCKS Column | data_locks Column |
|---|---|
LOCK_ID | ENGINE_LOCK_ID |
LOCK_TRX_ID | ENGINE_TRANSACTION_ID |
LOCK_MODE | LOCK_MODE |
LOCK_TYPE | LOCK_TYPE |
LOCK_TABLE (combined schema/table names) | OBJECT_SCHEMA (schema name),
OBJECT_NAME (table name) |
LOCK_INDEX | INDEX_NAME |
LOCK_SPACE | None |
LOCK_PAGE | None |
LOCK_REC | None |
LOCK_DATA | LOCK_DATA |