Are MySQL-InnoDb Lockable?

The following queries

SELECT * FROM (SELECT * FROM Users) WHERE Id = 1

and

SELECT * FROM Users Where Id = 1

are equivalent. But, according to the documentation, in Serializable mode, all samples are performed in LOCK IN SHARED MODE. Does this mean that in the first example, the entire Users table will be locked in shared mode?

+3
source share
1 answer

I think you misunderstand the concept of blocking exchange mode. From the MySQL documentation :

SELECT ... LOCK IN SHARE MODE sets the split mode lock in read lines. General mode locking allows other sessions to read lines, but not to change them.

, . , .

+1

All Articles