MySQL deadlocks explanation
问题 I need help solving a deadlock situation I'm facing. Thanks for your help. I think the deadlock is related to the SELECT subquery of transaction 2, but I don't understand several things: Why is it holding a S lock and then waiting for a X lock of the same row... why didn't it get an X lock to begin with? In any case, why is transaction 1 blocking anything? I would expect it to just need one lock, therefore not get a lock of anything else, and just wait until that lock is available to be