How to Find Out Who Is Locking a Table in MySQL

https://www.xaprb.com/blog/2006/07/31/how-to-analyze-innodb-mysql-locks/

I’ve found only a very limited set of circumstances in which MySQL will say what’s happening with locks. These are all printed out in the text of SHOW ENGINE INNODB STATUS.