CREATE TABLE `table0` (
`pkId` int DEFAULT NULL,
`pkAttr0` int NOT NULL,
`coAttr0_0` int DEFAULT NULL,
PRIMARY KEY (`pkAttr0`),
KEY `table0index_pk` (`pkAttr0`),
KEY `table0index_commAttr0` (`coAttr0_0`)
)
insert into table0 values(1,1,1);
操作序列:
session1 > begin;
session1 > update table0 set coAttr0_0=2;
session2 > begin;
session2 > select pkAttr0 from table0 for share; -- is not blocked
session1 > update table0 set coAttr0_0=2; 已经锁定了所有行,为什么 session2 > select pkAttr0 from table0 for share; 仍然能执行?