Q:

Logging for Locks in MySQL

How do i enable logs for locks in MySQL? For example, if i run select * from table on my InnoDB table, MySQL must internally lock this table.
I want to learn how and when MySQL locks my table and in what modes. A log would help.

A:

It is important to clarify that SELECT * FROM table will not set locks with your InnoDB table.  Please see my answer here:
Confusion regarding INNODB locking
Regarding a log for locks:
It is likely the case that this would generate far too much information, and reduce throughput for high traffic database servers.
You may be interested in checking out performance_schema which is a set of internal meta data tables inside of MySQL that can be queried to show lock wait information.

