Megabytes of text had been written already on InnoDB locking and
deadlocks. Still, even very simple cases of deadlocks while
working with a table having only one row sometimes make people
wonder what happened and why.
Today I want to check if this topic is explained well in the manual and existing blog posts and understood properly. So, it's an exercise for my dear readers and those who like to report bugs as much as I do.
Let's consider a very simple example. In session #1 with default transaction isolation level execute the following:
CREATE TABLE `tt` (
`id` int(11) NOT NULL,