Open TonsnakeLin opened 2 years ago
Why shouldn't session2 be blocked by the lock?
because on session1, the key 1
is not filtered out by the condition 'id2 = 2', it should release the lock on key 1
.
because on session1, the key
1
is not filtered out by the condition 'id2 = 2', it should release the lock on key1
.
Emm OK I get it
Bug Report
Please answer these questions before submitting your issue. Thanks! RC isolation
1. Minimal reproduce step (Required)
create table t1(id1 int, id2 int, id3 int, PRIMARY KEY(id1), UNIQUE KEY udx_id2 (id2)); INSERT INTO t1 VALUES(1,1,1); -- session1 begin; select from t1 where id1 = 1 and id2 = 2 for update; -- session2 begin select from t1 where id1 = 1 for update;
2. What did you expect to see? (Required)
session2 returns the result immediately.
3. What did you see instead (Required)
session2 was blocked by the lock of the key whose values is ```
4. What is your TiDB version? (Required)
Release Version: v6.2.0 Edition: Community Git Commit Hash: daf2b17cdfe30c02ce282361009fb5bdb05f2b0e