Examine the mydata table and SELECT statements:
You issue:
mysql> begin;
mysql> update mydata set a=0 where b=3;
How many rows are now protected by locks with the default InnoDB configuration?
A. one
B. one row and a next-key lock for supremum
C. one row and a gap-lock
D. five
Answer: D
b列没有索引,所以即使是Innodb,也是加表锁。
版权声明:本文为博主原创文章,未经博主允许不得转载。
MYSQL