point-get in a subquery of partition table cannot lock an non-exist row
Open
severity/moderate
sig/transaction
type/bug
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
connection 1:
```
create table t (id int primary key, v int) partition by hash (id) partitions 16;
begin pessimistic;
select * from (select * from t where id = 1 for update) as t1;
```
connection 2:
```
begin pessimistic;
insert into t values(1, 1);
```
### 2. What did you expect to see? (Required)
The `insert into t values(1, 1);` should be blocked because connection 1 has a pessimistic lock for id=1;
### 3. What did you see instead (Required)
The connection 2 can insert successfully.
### 4. What is your TiDB version? (Required)
Contributor guide
Assessment
This issue has not been assessed yet.