UPDATE is not blocked by DELETE, resulting in incorrect final database state
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
### 1. Minimal reproduce step (Required)
Isolation Level: Read Committed & Repeatable Read.
```sql
/* init */ CREATE TABLE t (c1 TEXT);
/* init */ CREATE UNIQUE INDEX i1 ON t (c1(3));
/* init */ INSERT INTO t (c1) VALUES (‘a’);
/* init */ INSERT INTO t (c1) VALUES (‘b’);
/* t1 */ BEGIN;
/* t1 */ DELETE FROM t;
/* t2 */ BEGIN;
/* t2 */ UPDATE t SET c1 = ‘c’;
/* t1 */ ROLLBACK;
/* t2 */ COMMIT;
/* t2 */ SELECT * FROM t; -- [('a'), ('b')]
```
### 2. What did you expect to see? (Required)
We expect UPDATE statement to be blocked, and the final database is [('c'), ('c')].
### 3. What did you see instead (Required)
UPDATE statement is not blocked by the DELETE statement of another transaction, and does not update any rows, resulting in incorrect final database state.
In addition, if the initial database contains only one row of data ('a'), UPDATE statement will be blocked. If the index i1 is removed, UPDATE statement will also be blocked.
### 4. What is your TiDB version? (Required)
Release Version: v8.5.6
Edition: Community
Git Commit Hash: ae18096e023780bb56bfce33698abec0d4640d0a
Git Branch: HEAD
UTC Build Time: 2026-04-14 07:15:36
GoVersion: go1.25.8
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Contributor guide
Assessment
This issue has not been assessed yet.