2 concurrent do not start transactions.
Concurrent A locks 1-3-5 sequentially, of course, the actual locking process must be one by one.Concurrent B locks 5-8-1 sequentially, of course, the actual locking process must be one by one.(1-3-5 and 5-8-1 is primary key)
Assume that when concurrent A locks to 1-3, concurrent B locks to 5-8.Next, concurrent A lock 5 and wait, and concurrent B lock 1 and wait.Is there any possibility of this causing a deadlock?
If so, why doesn't MySQL automatically give a concurrent exit lock to avoid deadlock?
Assuming that the transaction is opened, this mechanism is definitely not allowed, because the result has been returned in the transaction.If don't open the transaction, it can in principle.