1、select
2、lock table xxx in share update mode;
3、for update update insert delete
4、create index
5、lock table xxx in share row exclusive mode;
6、alter table drop table drop index truncate table

lock table xxx in row share mode; 2 SS(RS)
lock table xxx in row exclusive mode; 3 SX(RX)
lock table xxx in share mode; 4 S
lock table xxx in share row exclusive mode; 5 SSX(SRX)
lock table xxx in exclusive mode; 6 X
同一个事务里,先加3/4再加4/3锁,会自动变成5
3+4=5 4+3=5
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69991048/viewspace-2743458/
,如需转载,请注明出处,否则将追究法律责任。