When does a mysql innodb database add a gap or next-key lock in an RR transaction?

is the gap or next-key lock added only if the current read is performed? Or do you want to take a snapshot and add it?
how to avoid phantom reading if snapshot reading is not added?

Mar.01,2021

take a look at this article, the introduction is very clear.
https://tech.meituan.com/inno.


coincidentally, I just wrote this article to help you figure out all the locks https://codeshelper.com/a/11.

.
Menu