reference article: Innodb lock mechanism: Next-Key Lock talk about-jyzhou-blog Park
Why should Next-Key Lock be designed as a left open and right closed interval? Can"t be designed as a gap lock? Why is right closed?
ask the boss to answer.
< H1 > add: < / H1 >
BEGIN;
SELECT * FROM a WHERE id=3 FOR UPDATE; -sharp
UPDATE a SET id=2 WHERE id=3 -sharpid
UPDATE a SET id=5 WHERE id=3 -sharp
SELECT * FROM a WHERE id=6 FOR UPDATE; -sharp 66
UPDATE a SET id=6 WHERE id=6 -sharp 66
Why are boundaries treated differently?