Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb支持共享锁吗?
Currently using TiDB version 5.4, I would like to ask which version of TiDB supports shared locks?
For example, a shared lock like this:
start transaction;
select * from test where id = 1 lock in share mode;
Shared lock:
Allows different transactions to share locked reads, but does not allow other transactions to modify or add exclusive locks.
If there are modifications, they must wait for a transaction to complete before execution, which can easily lead to deadlocks.
I know TiDB supports select for update
for exclusive locks, but I want to use MySQL-like shared locks. Does TiDB support this, and how can it be used?