I am using the SELECT ... FOR UPDATE
syntax to reserve multiple rows of multiple InnoDB tables in MySQL 5.6. This allows me to isolate concurrent write operations from each other.
I am pretty sure that the locking works since I could prove that a concurrent transaction was suspended until the previous transaction finished. But this is a manual test only since it depends on timing.
Now I want to write some automated test.
Is there a statement to easily test if some rows are locked or maybe a statement that returns a list of currently locked rows?