Are record locks, gap locks, Next-key locks, Insert Intention Locks and AUTO-INC Locks the part of Intention Locks?

According to the documentation of MySQL all the types of the locking are the different types of locks. But all of them use FOR SHARE or FOR UPDATE instruction as the Intention Locks. So I can’t understand are the record locks, gap locks, Next-key locks, Insert Intention Locks and AUTO-INC Locks the part of Intention Locks or this is the absolutely different types of locks but with the same syntax

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

No, you are mixing up intention locks with the different type of actual locks!

As mysql documentation you linked in your question says (emphasis is mine):

Intention locks are table-level locks that indicate which type of lock (shared or exclusive) a transaction requires later for a row in a table.

All the other locks you listed are actual locks used when you execute insert, update or delete statements.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x